🎯 The Problem I Was Actually Solving

When I read the brief, the real problem wasn't "build a queue system." It was:

The solution had to be zero-learning-curve for the receptionist (she's busy), zero-interaction for the patient (they just look at a screen), and real-time so both sides trust the same data.

πŸ’‘ A clinic owner watching the demo sees the receptionist click "Call Next" on one screen β€” and before she lifts her finger, the number on the patient's phone has already changed. No refresh. No delay. No one touched the patient's phone. That's the moment she realizes this isn't a form β€” it's infrastructure.


⚑ Why Socket.io Over HTTP Polling

My first instinct was HTTP polling β€” hit /api/state every 2 seconds. Simple. But:

Socket.io WebSocket gives instant push from server to all clients the moment state changes. The receptionist clicks "Call Next" β†’ server emits queue_update β†’ both screens update in under 100ms.


πŸ—οΈ Data Flow Decision β€” Single Source of Truth

I kept all state on the server, not split across clients. This was deliberate.

If I let clients hold their own state: