KM
All projects

ClinicQueue طابور العيادة

Patients wait hours in crowded clinics because nobody knows when their turn will come. ClinicQueue lets them book and watch how many people are ahead of them from home, and gives each clinic a live, isolated queue it fully controls.

Role
Designed and built the backend and React app
Type
SaaS product, multi-tenant
Timeline
2026
Status
Working product with demo accounts
Stack
ASP.NET Core 10, PostgreSQL 16, Redis 7, SignalR, Hangfire, React 19, TypeScript, Docker, Nginx
Code
github.com/Kimoo193/ClinicQueue

The problem

In many clinics patients arrive early and wait in a full room, because the only way to keep your place is to be there. Reception juggles walk-ins, bookings and urgent cases on paper, and when the doctor is delayed nobody is told.

What I built

  • Patients book and see how many people are ahead of them, with clear states: wait at home, head to the clinic now, it's your turn, the clinic is paused.
  • Reception confirms arrivals and numbers them, inserts urgent cases between regular ones, books for walk-ins and closes the day.
  • Doctors pause the queue and record visits. Owners manage their clinics; platform admins manage clinics and subscriptions.

Architecture

A modular monolith in ASP.NET Core 10: domain, application and infrastructure projects behind Minimal APIs, with a SignalR hub for the live queue. Background work runs in a separate Hangfire worker built from the same image.

ClinicQueue containers: one API and one background worker share PostgreSQL, which enforces clinic isolation, and Redis.The React app talks to the API through Nginx over HTTPS using cookie authentication with a CSRF token, and receives live queue updates over WebSocket. The ASP.NET Core 10 API is a modular monolith with Minimal APIs and a SignalR hub. A Hangfire worker runs from the same image. Both use PostgreSQL 16, which enforces row-level security per clinic, and Redis 7 as the SignalR backplane.React 19 apppatient · receptiondoctor · owner · adminEnglish / ArabicNginxClinicQueue APIASP.NET Core 10modular monolithMinimal APIs + SignalR hubHangfire workersame image, jobs onlyshared dataPostgreSQL 16row-levelsecurity perclinicRedis 7SignalRbackplaneHTTPS · cookie auth + CSRF tokenlive queue over WebSocket
ClinicQueue containers: one API and one background worker share PostgreSQL, which enforces clinic isolation, and Redis.

Key decisions

Show people ahead, not an estimated wait time

Situation
Consultation times vary a lot. An estimated time that turns out wrong makes patients leave home too early or too late, and they stop trusting the app.
Decision
The patient sees a count of people ahead and a plain instruction: wait at home, or head to the clinic now.
Trade-off
Less precise-looking than a countdown, but it is always true.

Enforce clinic isolation in the database

Situation
Many clinics share one database. A single missing filter in one query would show one clinic's patients to another.
Decision
PostgreSQL row-level security policies scope every row to its clinic, on top of the application's own checks. I audited the policies, closed four critical gaps, and added a dedicated set of isolation integration tests.
Trade-off
Migrations and queries need care with the tenant context, and tests have to run on real PostgreSQL to mean anything.

Cookies and a CSRF token instead of tokens in the browser

Situation
Medical booking data deserves more than a token in local storage that any injected script could read.
Decision
Access and refresh tokens live in HttpOnly cookies; every state-changing request must send a header that matches a separate CSRF cookie.
Trade-off
Slightly more work in the React client and for cross-origin setups.

Modular monolith, not microservices

Situation
One developer, one product, and features that share most of their data.
Decision
One deployable API with clear module boundaries, plus one worker process for jobs.
Trade-off
Scaling is all-or-nothing for the API, which is fine at this size, and modules can be split out later if needed.

Quality and operations

  • 140+ unit and integration tests; integration tests run on real PostgreSQL with Testcontainers.
  • k6 load tests, a security pass, and a backup and restore drill.
  • CI on every change. Docker Compose with Nginx for deployment, with backup and monitoring helpers.
  • Written spec, plan and API contracts (GitHub Spec Kit) before the code.

Screens

More projects

Hiring a .NET or full-stack developer?

I'm based in Cairo and ready to relocate to Saudi Arabia or elsewhere in the Gulf. Notice period: 30 days.

Kareemmoursy75432@gmail.com