Om Magdum
Featured project
Queue Cure: Real-Time Clinic Queue Manager with Live WebSocket Sync
Every neighborhood clinic in India runs the same broken system: a paper token dispenser, a whiteboard with a hand-written number, and patients who have no idea if they're 5 minutes or 45 minutes away from being seen. The receptionist calls a number verbally — patients step out, miss their turn, and chaos follows. The core pain is information asymmetry. The receptionist knows the queue state. Patients and the waiting room don't. There's also zero data on consultation durations, so wait estimates are pure guesswork. Process I tackled the waiting room system by addressing three core constraints. First, real-time sync: polling caused unacceptable lag, so I implemented WebSockets (STOMP over SockJS) to broadcast state snapshots to all screens in under 100ms. Second, concurrency: to prevent two receptionists from calling the same patient, I applied a pessimistic database lock (SELECT FOR UPDATE in PostgreSQL). One request successfully acquires the patient, while the other receives a handled error. Finally, wait estimates: I replaced hardcoded values with a Redis cache tracking a rolling average of actual consultation durations, ensuring predictions dynamically improve as the day progresses. Results The system is live end-to-end. Patient check-ins sync to displays in under 100ms via WebSockets. Concurrency is solved with a SELECT FOR UPDATE lock—verified live via a built-in demo simulating parallel requests. Wait time estimates dynamically recalculate on every queue event using Redis-cached consultation data, improving accuracy throughout the day. The full stack (PostgreSQL, Redis, Spring Boot, React) deploys locally via docker-compose up --build and is live at queue-cure.netlify.app Reflection To scale for a real clinic, I would prioritise four upgrades: 1. Multi-doctor support: Redesigning the data model to handle parallel queues via a doctor_id foreign key. 2. Scalability: Replacing the in-memory broker with Redis Pub/Sub or RabbitMQ to enable horizontal backend scaling. 3. Estimate accuracy: Shifting from a simple rolling average to a windowed median to prevent outliers from skewing wait times. 4. Security: Implementing Role-Based Access Control (RBAC): receptionist, admin, and read-only—to secure the dashboard.