Developed a Doctor Appointment Booking App for a Saudi Clinic Network to Reduce Missed Appointments by 35%

Doctor booking app screens: slot picker, home and payment

Project Overview

Our client runs clinics in three Saudi cities. Almost every appointment started with a phone call. Patients waited on hold, and a lot of booked visits ended with them not showing up.

Their main purpose was to develop a doctor booking app that shows free doctor slots live and reminds patients before they arrive.

We built the app, the staff dashboard, and the backend branch by branch. Clinics kept taking bookings the whole time. Patients can use Arabic or English apps.

Business Challenges

  • Booking by phone only

    There were problems with taking bookings by phone and the receptionist had to enter each booking by hand.

  • Same Slot Booking

    If a branch did not have a calendar, then two people might book the same slot.

  • Empty slots

    If one patient cancelled on the same day, the hour was left unused.

  • Timetables out of order

    Leave days and doctor hours in separate and usually incorrect files.

Our Solution

A single API gateway handles each call from the patient app and the staff dashboard. Node.js services behind it cover authentication and payments.

  • REST endpoints for slot search, booking, rescheduling, cancellation, waitlist offers and visit history
  • JSON schema validation at the gateway with a uniform error envelope and machine-readable error codes
  • Per service timeouts, retries with exponential backoff and jitter on idempotent calls only, and circuit breakers on facing routes
  • Token bucket rate limiting per user and per client application, which also blocks bots that scrape doctor slots
  • Independent deployment of each service

An integration adapter converts the native message formats of the Hospital Information System into a clean internal domain model that doesn't contain legacy field names. Patient, Practitioner, Schedule, Slot and Appointment data becomes HL7 FHIR R4 resources, and the HIS is the sole source of medical data.

  • Doctor schedules stored as weekly availability rules plus exceptions for leave, clinic holidays, and prayer breaks
  • Slots generated from those rules at search time instead of being stored in advance
  • PostgreSQL exclusion constraint on doctor and time range, so the database rejects any overlapping appointment from any screen
  • Redis slot holds with a time to live of a few minutes during checkout
  • Optimistic locking with a version column on appointment rows
  • Timestamps stored in UTC and displayed in Arabia Standard Time

  • The app generates a UUID idempotency key per booking attempt
  • A retry with a known key returns the stored booking, and the same key with a different payload is rejected as a conflict
  • Confirmation waits for the payment provider's webhook and a valid signature
  • Bookings stuck in pending enter a reconciliation queue with bounded polling, then release the slot if payment never completes
  • The app shows "awaiting payment" and disables a second attempt until the state resolves

  • Appointment states modeled as a finite state machine: held, pending payment, confirmed, rescheduled, checked in, completed, cancelled and no show, with only legal transitions accepted
  • BullMQ jobs schedule reminders 24 hours and 2 hours before each visit
  • Failed sends retry with backoff, then move to a dead letter queue with alerting
  • Firebase Cloud Messaging and APNs for push, with SMS as the fallback when push fails
  • Signed deep links in each reminder for one-tap confirm or cancel
  • No-show risk score from booking lead time, earlier missed visits and reminder replies

  • Cancellation publishes an event with a slot identifier and a version number
  • Waitlist service selects the next patient whose branch, doctor and time window match
  • Offers expire after a few minutes, then pass to the next patient in line

  • Correlation identifiers propagated through gateway headers, service logs, queue job metadata and adapter calls
  • OpenTelemetry tracing and structured JSON logs with masked personal fields
  • Dashboards for slot search p50, p95 and p99 latency, booking success rate, reminder delivery rate, queue depth and no-show rate per branch and doctor
  • Append only audit records for every booking change and staff action
Doctor booking app: slot picker with a held slot, payment screen and a visit reminder
Clinic staff dashboard on a laptop cycling through the results: waitlist refills, missed appointments, reminders and booking time

Technology Stack

  • Patient app

    React Native

    One codebase for iOS and Android, right to left layout for Arabic

  • Staff dashboard

    React

    Schedule grids with filters and inline editing

  • Backend

    Node.js, REST

    Non-blocking I/O for many short search and booking calls

  • Database

    PostgreSQL

    Exclusion constraints reject overlapping appointments

  • Cache

    Redis

    Slot search caching and holds with a time to live

  • Queue

    BullMQ

    Scheduled reminders, retries, dead letter queue

  • Health data

    HL7 FHIR R4

    Defined resource shapes for Patient, Slot and Appointment

  • Notifications

    FCM, APNs, SMS gateway

    SMS delivers when push fails

  • Auth

    OAuth 2.0, OpenID Connect

    Short-lived access tokens, refresh token rotation

  • Cloud

    AWS EC2, RDS, S3, CloudWatch

    Managed databases, automated backups, metric alerts

Saudi Specific Integrations

  • Nafath

    national digital identity login for sign up and sensitive actions

  • Arabic and RTL

    bilingual doctor and specialty names, Hijri and Gregorian dates

  • Payments

    Mada, Apple Pay and STC Pay, priced in SAR with VAT on receipts

  • Insurance

    policy details captured at booking, forwarded for NPHIES claims

  • Calendar

    Friday and Saturday weekends, public holidays, Ramadan hours and prayer breaks applied during slot generation

  • PDPL

    consent records, encryption at rest and in transit, data residency planning

  • SMS

    Saudi licensed gateway with Arabic sender names

Development Process

  1. Discovery

    Identified all the issues that the manual process had and that need to be considered in creating the online doctor appointment app.

  2. Design and prototyping

    Designed Arabic-first wireframes and clickable prototypes. Then tested them with patients and receptionists before any code.

  3. Scheduling build

    Built the slot model and the appointment state machine before any screen.

  4. Concurrency testing

    Simulated hundreds of users booking the same doctor at once and confirmed that no slot was booked twice. Profiling led to composite indexes and a larger connection pool.

  5. Failure injection

    Delayed payment webhooks took the system offline and cut out mobile connections mid-booking to validate retries and slot release.

  6. Pilot and branch rollout

    Implemented at one branch first and then tested it for 4 weeks. Opened the remaining branches in stages, and submitted to the App Store and Google Play.

Measurable Results

  • Missed appointments down 35%, from about 22% of booked visits to about 14%

  • Double bookings: zero since the constraint went live

  • Booking time: about 6 minutes by phone, under 90 seconds in the app

  • 61% of cancelled slots refilled from the waitlist

  • Reminder delivery above 98%, about 54% of patients confirmed or cancelled through the link

  • Booking calls to reception down about 48%

  • Slot search p95 under 300 milliseconds

Planning a Doctor Appointment Booking App in Saudi Arabia?

Our healthcare app development company develops solutions based on your precise needs.

Get a Free Quote
Contact Us

Ready To Fuel Your Vision With AI-Powered Innovation?

Our Presence

Level- 18, Dubai World Trade Centre Tower, Sheikh Rashid Tower, Sheikh Zayed Rd, Dubai, UAE

business@code-brew.com +971-55-645-7972

Plot no I - 36, Sector 83 Alpha, Mohali SAS Nagar 140308

business@code-brew.com +91-771-976-8427

Al Akaria 2, 6926 Olaya Street, RHOA2566, Riyadh, Saudi Arabia.

business@code-brew.com

Av. Miguel Hidalgo y Costilla 1995, Arcos Vallarta, 44600 Guadalajara, Mexico

business@code-brew.com +1(213)2614953

4231 Balboa Ave #512 San Diego, CA 92117 United States

business@code-brew.com +1(213)2614953

2nd floor, College House, 17 King Edwards Rd, London HA4 7AE, UK

business@code-brew.com +44 (20) 82644493

Partner With Experts Who Leverage AI & Tech To Transform Ideas Into Market-Leading Solutions.

Wait! Looking for Right Technology Partner For Your Business Growth?

It's Time To Convert Your Business Idea Into Success!

Get Free Consultation From Top Industry Experts:
gif
I would like to keep it to myself