Project 04 / 04
The Gen
Backend of a doctor and patient app
The backend of a mobile app where patients book doctors, pay, and meet them in live audio and video sessions.
About the project
The brief was a doctor to patient app: a patient talks to doctors, books an appointment in a free slot, pays, and meets the doctor in a live audio or video session.
I designed and built the backend for it in Node.js, Express and TypeScript: appointment booking with live slot scheduling, payments, call sessions on the Agora SDK, transcripts, heavy records, and KYC handling with real-time verification.
The app itself is a Flutter app built by another developer. I documented the API so it could be integrated easily, and deployed the backend on Google Cloud with CI/CD, so it holds up under concurrent traffic.

Challenges
The hard problems of this project, and how each one was solved.
- 01
Two patients, one slot
Claiming a slot is one atomic step, so of two requests that arrive together exactly one wins and the other sees the updated schedule at once. A slot is held while the patient pays and released if the payment fails.
- 02
A payment and a booking that must always agree
A booking is confirmed only by the payment provider's signed webhook, handled idempotently, so a retry or a duplicate event never charges or books twice.
- 03
Calls for the right people at the right time
The backend issues short-lived Agora tokens per appointment, only to the booked doctor and patient and only inside the session window.
- 04
Identity checks while the user waits
KYC runs as an asynchronous flow: the result comes back by callback and the app is told the outcome live, so nobody waits on a frozen screen or gets in unverified.
- 05
Heavy records and transcripts
Files go to object storage through signed links, away from the API servers. Lists are indexed and paginated, and transcripts are produced by background jobs after the call.
- 06
An API another developer has to build on
Every endpoint is documented with request and response examples, in one consistent error format, so the Flutter developer could integrate it without waiting on me.
- 07
Concurrent traffic
The services are stateless and run in containers on Google Cloud, scaling out under load. Every release is built, tested and deployed by the CI/CD pipeline.
