Nazmul Khalid

DocBee

Lead Software Engineer / System Architect

A telemedicine platform spanning five services — Flutter apps for patients and doctors, a Vue 3 admin dashboard, a Node.js/MongoDB API, and a public web app — supporting real-time video consultations, appointment booking, and doctor payouts.

Problem

Patients in Bangladesh often can't get timely access to a doctor, and doctors don't have an easy way to see patients outside clinic hours or get paid for a remote consultation. DocBee is built as a two-sided marketplace, not a directory: a patient books and pays for a real-time video consultation with a doctor from their phone, and a doctor gets a schedule, a live video and chat channel, and an actual payout mechanism for the fees they earn.

Approach

Five separate applications share one Node.js/Express API: Flutter apps for patients and doctors, a Vue 3 admin dashboard for the operations team, and a Next.js public site. The API runs on MongoDB/Mongoose with Redis-backed Socket.IO — the Redis adapter is what lets booking and chat events broadcast correctly once the API runs on more than one instance — Agora for the actual video/audio consultation once a booking is confirmed, Firebase Cloud Messaging for push, and SSLCommerz, Bangladesh's dominant payment gateway, for in-app payment. Doctors don't just see a running total: every completed, paid consultation credits a per-doctor transaction ledger they can request a payout against, against a company account that tracks the platform's own cut of the same transaction — the money side of the marketplace is a real ledger, not a display number.

A hard problem I solved

The concrete problem was making sure two patients can never book the same doctor's slot, without locking the whole schedule or trusting application code to always check correctly under concurrent requests. When a patient picks a slot, the API creates a hold document with a MongoDB unique compound index on doctor, date, and slot — so a second, simultaneous hold attempt on that exact slot fails at the database layer itself, not in application logic that could race. If the patient abandons checkout, a MongoDB TTL index expires and removes the hold automatically, so nobody has to run a cleanup job to free a slot nobody's paying for. The booking write, the payment ledger entry, and the hold's deletion all happen inside one MongoDB transaction, and Socket.IO broadcasts the result to every other patient currently viewing that doctor's calendar — so a slot disappears from someone else's screen the instant it's taken, instead of them finding out only when their own booking attempt fails.

Status

Live at docbeebd.com. Built and iterated over roughly two years across five repositories — the patient app starting September 2024, the doctor app and API in December 2024, and the admin panel in mid-2025 — with a rebuilt public web front end currently in progress.

Technology

  • Flutter
  • Vue 3
  • Next.js
  • Node.js
  • Express
  • MongoDB
  • Redis
  • Socket.IO
  • AWS
Visit DocBee →

Writeup