Queue Cure — paper-free live clinic queue with per-patient QR
5-sec patient add · <300 ms multi-screen sync · 0 paper printed · ETA from real data
5 sec
Patient registered
<300ms
Multi-screen sync
0
Paper slips printed
Overview
76% of India's 1.5 million clinics still run on paper token slips. Patients wait 2–3 hours with zero visibility into the queue. Receptionists track everyone from memory. Doctors have no dashboard. The result: missed slots, no-shows, frustration on both sides — plus a recurring cost of paper, printer cartridges, and thrown-away slips. Every clinic already owns a smartphone, a laptop, and often a wall TV. The missing piece is a live, shared queue that runs on the hardware they already have. Process Started from the brief's three questions: token in <10 sec, no-refresh updates, real ETA. Each became a hard design constraint. First pass used Socket.IO for both reads AND writes. Scrapped within an hour — mutations over sockets meant no HTTP error codes, no curl-testable endpoints, no centralised middleware. Pivoted to REST writes + socket broadcast: one mutation → one snapshot → every client re-renders. No client state machine, no drift. Token assignment was the second pivot. count() + 1 has a textbook race condition. Replaced with Counter.findOneAndUpdate({$inc}, {upsert}) — atomic at the MongoDB level. Two receptionists adding patients at the same millisecond can never collide. Originally planned printed slips with QR codes. Realised the paper waste contradicted the zero-infra pitch. Results Patient registration in ~5 seconds (Name + Enter, phone optional). Cross-screen sync benchmarked <300 ms on local network. ETA accuracy improves with every served consultation — rolling avg becomes data-driven from the very first patient. Zero paper printed: per-patient QR shown on the receptionist's existing monitor, scanned in ~3 seconds. Concurrency: status-guarded transitions + atomic counter mean a double-clicked Call Next is a clean no-op, and 50 parallel addPatient() calls produce 50 unique tokens. Reflection Patient registration in ~5 seconds (Name + Enter, phone optional). Cross-screen sync benchmarked <300 ms on local network. ETA accuracy improves with every served consultation — rolling avg becomes data-driven from the very first patient. Zero paper printed: per-patient QR shown on the receptionist's existing monitor, scanned in ~3 seconds. Concurrency: status-guarded transitions + atomic counter mean a double-clicked Call Next is a clean no-op, and 50 parallel addPatient() calls produce 50 unique tokens.