Bly
Healthcare

Doctor booking platform

A multi-role web platform handling the full lifecycle — from a patient finding a doctor, to the doctor's application being reviewed by an admin, to the appointment being booked and confirmed.

3

user roles

Stack

Next.jsTypeScriptDrizzle ORMPostgreSQLBetter Authshadcn/uiUploadThingResend

The challenge

Healthcare access in Djibouti is fragmented. Finding the right doctor, understanding availability, and booking an appointment required phone calls, word of mouth, and luck. There was no centralised system — let alone one that handled the verification of medical credentials.

What we built

We built a three-role platform: patients browse and book, doctors apply and manage their schedule, admins review applications and approve credentials. The onboarding flow uses magic links — no password friction. File uploads handle credential documents. A stepped form wizard guides new doctors through the application without overwhelming them.

Key decisions

Role stored in appUser, not the auth table

Better Auth owns the session layer but knowing nothing about business roles. We store role exclusively in our own appUser table — keeps auth concerns separate from product logic and makes role changes clean.

No auth entities until admin approval

Doctor applications live in a doctorApplication table with no corresponding auth user. Only after admin approval does the system call signUpMagicLink() and create the auth record. This prevents unverified doctors from ever having an active session.

SteppedFormBuilder for onboarding

Rather than a single long form, we built a wizard component with per-step Zod validation and a preview step before final submission. Reduces drop-off and makes the credential upload feel guided, not bureaucratic.

The outcome

A live platform serving doctors and patients in Djibouti. The admin approval flow has processed every doctor currently on the platform. Zero credential breaches since launch.