Usman Ali
← Work

Telehealth platform

A bilingual Arabic and English telehealth platform. Patients book and pay for video visits with licensed doctors. I own it from the requirements to the production deploys.

Healthtech. Lead developer and product lead. Web, plus a companion mobile app.

My part

  1. Requirements
  2. Explaining it to the client
  3. Build
  4. DevOps
  5. Production deploys

The system

One API serves every clinic, and each clinic's data stays its own.

The flow

From a new doctor to a paid doctor.

  1. Doctor registers

    License, documents and bank details. An admin checks and approves.

  2. Schedule published

    The doctor publishes it from a template. Slots are generated on read.

  3. Patient books and pays

    The patient picks a specialty or a doctor, sees the price and pays.

  4. E‑invoice issued

    Each payment gets an e‑invoice with its own counter.

  5. Video visit

    Chat opens before the visit. The JWT-secured call ends by itself. Then the e‑prescription.

  6. Visit closed

    The visit is marked completed or no-show, and the earnings are recorded.

  7. Monthly payout

    Batches are generated, reviewed, then released to verified doctor bank accounts.

The decision

The visit time is over. Who decides what happened?

A visit can end three ways: it happened, the patient never joined, or the doctor never joined. The answer drives the doctor's payout, so it must be decided exactly once.

  1. One delayed job per appointment. It runs after the scheduled end plus a grace period, re-reads the state and checks who joined.

Two more rules the platform follows

  1. A slot is locked once, so two patients cannot take the same slot.
  2. A shift can cross midnight. "Today" always means today in the local time zone.

What broke, and what I changed

  1. A data reset would have restarted the invoice chain

    I persisted the last invoice hash in settings and verified it before the reset ran.

  2. The reset script hit a rate limit

    The FHIR server throttled it after about 2,000 writes. I added retry with backoff.

Built with

TypeScript, NestJS, TypeORM, PostgreSQL, a FHIR R4 server. Redis and BullMQ. Socket.IO. Next.js, React, Redux Toolkit, Tailwind CSS, in Arabic RTL and English. Docker, GitHub Actions.

Next