See Clearly, Care Confidently

Ward View is a simple, secure web app that shows every bed in a hospital ward on one screen, coloured by the doctor responsible for it. Doctors log in, see the whole ward, then admit, update or discharge patients.

Take the tour Source code is private for security.
Ward page on desktop: 40 beds in four rows, coloured blue and green by doctor
Bed details on mobile

Problem

Two doctors share one ward of 40 beds. Nobody has a single, up-to-date picture of which bed belongs to which doctor, or which patient is lying in it.

  • There is no single view of bed ownership across the ward.
  • Paper lists and chat messages go out of date and are hard to read on a round.
  • Patient details shared in chats and on paper are not secure.

Solution

One small Django website, protected by a login, replaces the paper list. Every change one doctor makes reaches the other doctor's screen within 30 seconds.

  1. 1Each doctor signs in with their own account.
  2. 2See all 40 beds at once, coloured by doctor.
  3. 3Admit, update or discharge a patient in a few taps.
  4. 4Hand a bed over to a colleague with one button.

App Tour

The main screens of the web app. Every screen works on a ward PC and on a phone at the bedside.

One account per doctor. Five wrong passwords lock the account for 30 minutes.

Sign in on desktop
Sign in on mobile

All beds in rows of ten, a colour key per doctor and live totals. The page refreshes every 30 seconds.

Ward grid on desktop
Ward grid on mobile

Patient details, who last changed the bed and when, plus Assign to me and Assign to another doctor.

Bed details on desktop
Bed details on mobile

BHT number, name, condition, a problem list and investigations to be done as checkboxes.

Patient form on desktop
Patient form on mobile

Discharge asks for confirmation, then clears every patient field. Nothing about the patient is kept.

Discharge confirmation on desktop
Discharge confirmation on mobile

Each doctor picks a bed colour from a fixed palette. A colour already taken by a colleague cannot be chosen.

My profile colour picker on desktop
My profile colour picker on mobile

Features

A small feature set for two doctors and one admin, kept simple enough to use during a ward round.

  • Secure login

    Personal accounts with passwords of at least 10 characters. Five wrong attempts lock the account for 30 minutes.

  • Colour-coded ward

    Every bed shows its number, patient and doctor:

  • Live updates

    The ward page refreshes every 30 seconds, so the other doctor's changes appear without reloading.

  • Patient record

    Admit, edit and discharge. Each change records who made it and when, in Sri Lanka time.

  • One-tap handover

    Assign to me or Assign to another doctor changes only the doctor. The patient stays and the bed changes colour.

  • Bed management

    Add, renumber or remove beds. A bed with a patient cannot be deleted until the patient is discharged.

  • One-time setup

    The admin creates all 40 beds split between the doctors in one form, with no gaps or overlaps.

  • Privacy by design

    Discharge keeps nothing. Pages are never indexed by search engines, and admin history never shows patient details.

Architecture

One Django app does everything: pages, login, admin and database access. There is no separate frontend and no JavaScript framework.

Client Browser

Doctors & admin
Ward PC · phone
Server-rendered HTML
Plain CSS · no JavaScript
Auto refresh every 30 s

App Render

Django 5.2 LTS
Gunicorn · WhiteNoise
Security middleware · HSTS · CSRF
django-axes login lockout
Ward & accounts views · templates
Django Admin (secret URL)

Data & delivery

PostgreSQL
Neon · users, beds, investigations
GitHub
Private repo · deploy on push to main
build.sh: install · collectstatic · migrate

Data Flow

Four flows show how data moves through the system: signing in, recording a patient, handing over a bed and discharging.

Sign in

  1. The doctor submits POST /login/ with a CSRF token.
  2. django-axes checks whether the username is locked.
  3. Django checks the hashed password. A wrong one shows a general error.
  4. A secure session cookie lasts one day or until the browser closes.

Admit or update a patient

  1. The doctor opens /beds/<n>/patient/ and fills in the form.
  2. The form needs a BHT number or a name.
  3. The bed is saved in PostgreSQL with updated by and updated at.
  4. The other doctor's ward page shows the change within 30 seconds.

Hand over a bed

  1. The doctor taps Assign to me or chooses another doctor.
  2. POST /beds/<n>/assign-me/ or /reassign/ is sent.
  3. Only the bed's doctor field changes. The patient stays.
  4. The bed takes the new doctor's colour on the ward page.

Discharge

  1. GET /beds/<n>/discharge/ shows a confirmation page.
  2. Only the confirming POST discharges the patient.
  3. One transaction clears every patient field and investigation.
  4. The bed shows Empty. No patient data is kept.

Tech Stack

Open-source tools with free hosting tiers.

Backend
Python 3.14Django 5.2 LTSDjango AdminGunicornWhiteNoise
Frontend
Django templatesPlain CSSNo JavaScript
Security
Django authdjango-axesCSRF protectionHSTSSecure cookies
Database
PostgreSQLpsycopg 3dj-database-url
Quality
Django test runnerRuff
DevOps
GitGitHubDocker Compose
Hosting
RenderNeonGitHub Pages