All works
Case study · Zeeneeds · Clinic SaaS

Doctor OS

Clinic software for Indian practices, from the first token in the morning to the collection report at night, plus a Patient Passport that the patient, not the clinic, controls.

My role: Designed and built end to end: data model, API, web app, desktop app and AWS deployment.

  • Node.js 22
  • Express 5
  • PostgreSQL
  • React 18
  • Vite
  • Electron
  • React Native
  • AWS
Doctor OS home: next patient, token queue and today's schedule

Screen 1 of 5: Doctor OS home: next patient, token queue and today's schedule

01 · Context

The problem

Small Indian clinics run on paper registers, re-typed prescriptions and WhatsApp chases. Patient history is scattered across every clinic and lab a patient has visited, and none of it is shareable without either losing privacy or losing the record.

02 · Architecture

How it fits together

Request path
ClientsWeb · Desktop · Mobilenginxstatic + load balancerExpress 5 APIN stateless replicasPostgreSQL 16data + LISTEN/NOTIFYS3 / MinIOfiles, signed URLsOTP SMSsign-in

Clients — React 18 web app, an Electron desktop app and an Expo mobile app, all talking to the same /api/v1.

03 · Demo

See it running

Doctor OS in two minutes: the doctor app, the Patient Passport and the lab.
04 · Decisions

Key decisions

A stateless API from day one

Every replica is interchangeable: sessions, OTPs, rate limits and idempotency keys live in Postgres, realtime fan-out uses LISTEN/NOTIFY, and files go to S3 behind signed URLs. Scaling out is `docker compose up --scale api=N`, and SIGTERM drains in-flight requests so rolling deploys are safe.

Consent as data, not as a checkbox

Access requests record what was asked, grants record what was allowed (never wider than the request), scoped to patient, clinic, doctor and record type, with an expiry. One service decides what each scope reveals, and the same rules serve the patient's own view, clinic views and share links.

Separate token issuers per surface

Staff, Passport and share-link tokens each have their own issuer, so no token works outside the surface it was minted for. Receptionists never receive clinical fields at all; they are removed on the server, not hidden in the UI.

Immutable clinical records

Signed lab results are never edited: an amendment inserts version n+1. Bill corrections mark the original and record a replacement in the same transaction. Every mutation lands in an audit log with before and after values.

Trade-offs

What I traded, and why

  • Postgres does jobs Redis or a queue would normally do (rate limits, realtime fan-out). That keeps operations to one database today; each piece sits behind a small interface so it can move to Redis or NATS without rework.
  • Payments are record-only, with no gateway. Clinics already take cash and UPI; recording them well mattered more than processing them.
Next

What I'd do next, or differently

  • Move background work (SMS reminders, report PDFs) into a worker process with pg-boss, keeping the API request/response only.
  • Point reporting queries at a read replica as clinics grow.