Demo

The exact workflow for the live demo. It covers every user-facing feature, in an order that tells one story: a Patient owns their record, a Clinician reads it only with consent, every access is recorded, and withdrawing consent takes effect immediately.

Exact seeded IDs, the backend checks and the teardown steps are in RUNNING.md. This file covers what to click and what to say while doing it.

Status: read before rehearsing

  • Verified: the consent grant form asks for the password and calls /auth/step-up first, and only Provider Staff see “File new entry”.
  • Rehearsed 2026-10-14: a fresh clone in a scratch directory, docker compose up --build -d --wait — all six containers healthy, landing page (/en/login, /hi/login) returns 200, Mailpit reachable. npm run test:e2e:live (the live spine spec, real browser against the real backend, no mocks) passed: file → grant with step-up → clinician read → audit → revoke → lockout. Stack torn down after with docker compose down -v. This is the post-shadcn-rebuild (PR #59) rehearsal #56 asked for; it exercises the full spine mechanically but is not a substitute for a human clicking through the script below and watching the UI.
  • Locales: Hindi, Tamil and Malayalam have not been reviewed by a native speaker. See locale-review.md.

Feature coverage

FeatureStep
Registration, email verification (Mailpit)1
Seeded logins, one per role2
Provider Staff files a Medical Entry (coded fields, document attachment)3
Timeline: chronological, filterable by type, label as well as colour4
Consent grant: one named clinician, scoped, open-ended until revoked, step-up5
Clinician reads a record with consent6
“Who accessed my records” audit view7
Revoke with no step-up8
Immediate lockout with 404, not 4039
Break-glass emergency access, patient banner, CRITICAL audit10
Notifications and per-channel preferences11
Analytics computed on read through accessible_entries12
Admin dashboard with no clinical data13
Duplicate review, human-only merge, reversal14
Four locales; clinical content never translated15

Corrections are demonstrable in the UI. As Provider Staff, open a filed entry’s detail page and choose the correction action. Pulse creates a new entry that supersedes the original; it does not overwrite the original.

Email verification: local Mailpit or Gmail SMTP

The default Compose setup uses Mailpit, a local fake mail server. It accepts messages on SMTP port 1025 and displays them at http://localhost:8025; it does not deliver to real inboxes. This keeps a fresh clone runnable without credentials.

To send through the configured personal Gmail account, create a .env (gitignored) at the repo root with these variables, where SMTP_PASSWORD is a Google App Password:

SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_STARTTLS=true
SMTP_USERNAME=<Gmail address>
SMTP_PASSWORD=<App Password>
MAIL_FROM=<sender address>

The App Password is used instead of the normal Google password; Google requires 2-Step Verification for App Passwords. Keep .env out of Git. The same variables can be set as deployment secrets for a hosted app.

Google links: Gmail SMTP settings and App Password requirements.

Configuration: with no .env, Compose uses the Mailpit defaults. When .env is present, Compose passes its SMTP settings into the backend:

SettingWhereValue
SMTP_HOST / SMTP_PORTbackend envmailpit / 1025 by default; Gmail uses smtp.gmail.com / 587
SMTP_USERNAME / SMTP_PASSWORDlocal .env or deployment secretsGmail address / App Password; blank for Mailpit
SMTP_STARTTLS / SMTP_SSLbackend envfalse / false by default; Gmail uses true / false
PUBLIC_BASE_URLbackend envDefaults to http://localhost; use a public HTTPS URL for recipients outside this machine
MAIL_FROMbackend envDefaults to the SMTP username, or no-reply@pulse.local for Mailpit
Mailpit inboxmailpit publishes 8025http://localhost:8025 when using the default configuration

Flow: register, and the backend stores a challenge in Redis (it expires) and emails the link {PUBLIC_BASE_URL}/{locale}/verify?challenge=…&token=…. Open it from Mailpit and the account is verified.

For a Gmail message opened on the same development machine, PUBLIC_BASE_URL=http://localhost is fine. If the recipient is someone else, the link must use an HTTPS hostname or tunnel they can reach; localhost in their browser points to their own machine. Automated tests use fake email providers and never send messages through Gmail.

Setup (before the audience is in the room)

git clone https://github.com/moneytosms/Pulse.git && cd Pulse
docker compose up --build      # or: uv run run.py
docker compose ps              # wait until all six are healthy

Always pass --build. Without it, Compose reuses an old frontend image: the landing page loads but every other route returns 404.

To start from clean seed data (safe, because the seed is deterministic):

docker compose down -v && docker compose up --build

Open three windows:

  1. Patient: http://localhost/en/login
  2. Clinician: a private window, http://localhost/en/login
  3. Mailpit: http://localhost:8025

All seeded accounts use the password Pulse@demo1 and have quick-login buttons on /en/login.

ButtonEmailPatient ID
Patient (EN)demo.patient.en@example.com0c96112a-1653-5403-999c-30ec1ef6dda8
Patient (HI)demo.patient.hi@example.com3688d458-8442-5c8a-863d-362215ef3c6c
Provider staffstaff000@example.comnone
Clinicianclinician0@example.comnone
Administratoradmin0@example.comnone (ADR-0007)

Keep the Patient ID above ready to paste. There is no patient search.

  1. Register and verify. Go to /en/register. Enter any email and a password of at least 12 characters (for example TestPassword123!) and submit — sign-up creates a Patient, so there is no role choice. You land on “Confirm your email address”. In Mailpit, open “Verify your Pulse account” and click the link. Say: every account starts unverified, and the email went to a local catcher, so nothing leaves this laptop.

  2. Log in with history. In the Patient window, click Patient (EN). A new signup has an empty record, so the rest of the demo uses a seeded patient.

  3. File an entry (as Provider Staff). Only Provider Staff can file. In the Clinician window, click Provider staff. On /en/clinician, paste the Patient ID into the Patient ID box to open the record, then File new entry. The Patient ID is already filled in. Choose “Diagnosis” and set “Occurred at”. Enter code system ICD-10, code E11 and display name Type 2 diabetes mellitus. Attach a PDF and point out the upload progress. Submit, then click “View entry”. Log this window out after. Say: providers contribute records and patients own them; a Patient can’t file clinical entries. Entries are never edited in place. A correction inserts a new entry and marks the old one superseded. To demonstrate this, open the filed entry and use the correction action; submit a changed value and show that the replacement links back to the original. The original remains in the record history.

  4. Timeline. In the Patient window, go to /en/timeline. The new entry is on top. Show the entry-type filter and the “Critical” label on an abnormal lab. Say: colour never carries meaning alone; there is always a label.

  5. Grant consent. Go to Access, “Grant access” (/en/consent/new). Enter clinician0@example.com as “Clinician email” and leave all “Entry types” unticked, which grants every type. Set “Purpose” to “Treatment” (access stays on until revoked). Enter Pulse@demo1 in “Confirm with your password” (step-up) and submit. Say: consent goes to one named clinician, never an organisation, it lasts until you revoke it, and granting it asks for your password again. Also show that an email which is not a registered clinician gets “No clinician is registered with that email.”

  6. Clinician reads. In the Clinician window, click Clinician. You land on “Clinician access” (/en/clinician). Click the Patient’s name under “Patients who have given you access”. The Diagnosis entry is listed. Open it. Say: this works because of the consent grant. The Clinician role on its own gives no access, and the list is never cached — revoke it and the name disappears on the next load, not on some later expiry.

  7. Audit view. In the Patient window, open /en/audit (“Who accessed my records”). The clinician’s read is listed with their name and organisation and no clinical content. Say: one audit event per access, not per row. The audit table is append-only by a database GRANT.

  8. Revoke. Go to /en/consent, click “Revoke” on the grant and confirm. There is no password prompt. Say: withdrawing access is deliberately the easy direction.

  9. Lockout. In the Clinician window, reload the record. It shows “Record not found”, the same as for a patient ID that doesn’t exist. Say: this is a 404, not a 403, because a 403 would reveal that the person is a patient. Revocation applied mid-session because permissions are never cached.

  10. Break-glass. The entry point is a Clinician opening /patients/{id}/records without consent: the “not found” state shows the emergency access form. Enter a written justification. The grant is 60 minutes and unscoped. In the Patient window, reload: an “Emergency access to your record” banner appears, and the access is in /en/audit. Say: emergencies aren’t blocked, but they are loud: a CRITICAL audit event and an immediate notification to the patient.

  11. Notifications. As the patient, open /en/notifications. The break-glass notice is there. Open /en/notifications/preferences. Say: mandatory events (break-glass, for example) don’t appear as toggles at all, because they can’t be turned off. Notifications carry no clinical data.

Part 2: analytics, admin, deduplication, locales

  1. Analytics. As Patient (EN), open /en/analytics. Show the lab trend picker, visit frequency, active medications and the data-quality flags. Say: every chart is computed when the page loads, through the same consent filter as the timeline. There is no stored insight table to go stale or leak.

  2. Admin dashboard. Log in as Administrator and open /en/admin. Say: administrators see identity fields and counts only, never clinical data, on any endpoint.

  3. Duplicate review. Open /en/admin/duplicates. A candidate shows name, date of birth, phone, account status and “Records on file”, and nothing clinical. Click “Merge”. It appears under “Reversible merges”; “Reverse merge” undoes it, and “Not a duplicate” dismisses a candidate. If the queue is empty, earlier sessions reviewed the seeded pairs: say so, or reset with docker compose down -v. Say: the seed plants duplicates and near-miss non-duplicates, so precision can be measured. Merges are human-only and reversible.

  4. Locales. Log in as Patient (HI), or switch /en to /hi, /ta or /ml on any screen. Open the timeline. Say: the interface is translated, but clinical content such as “Type 2 diabetes mellitus” stays exactly as recorded, because translating it would invent a medical claim. Dates and numbers come from Intl with lakh grouping. Mention that Hindi, Tamil and Malayalam are machine-translated and unreviewed.

Fallbacks

  • No email in Mailpit: run docker compose logs backend | rg -i smtp. Registration and email delivery are decoupled, so the account may exist anyway.
  • Every route but / returns 404: the frontend image is stale. Run docker compose up --build frontend.
  • Local next build crashes on /_global-error: the shell exports NODE_ENV=development. Use NODE_ENV=production npm run build.

This page is docs/demo.md in the repository, rendered as written.