SARAN S CSE
Featured project
TokenFlow
Indian clinics run entirely on paper token slips. A patient walks in, gets a numbered chit, and sits waiting with no idea how long they'll be there. When their number is called, it's shouted across a crowded room. Receptionists can't handle emergencies or senior patients without manually reshuffling physical slips. There's no way to see the queue from outside, no estimated wait time, and no record of how long consultations actually took. The result: chaotic waiting rooms, frustrated patients, and receptionists managing paper instead of people. Process Mapped the clinic workflow: patient arrives → gets token → waits → gets called → consults → leaves. Found three gaps — no visibility for patients, no flexibility for receptionists handling priority cases, and no data on actual consultation durations. Built a priority queue: emergencies first, seniors before normal, FIFO within each tier. Chose in-memory state over a database since a clinic queue resets each morning by design. Used full-state broadcast over delta events — simpler, drift-proof, and reconnecting screens automatically get current state. Wait times are adaptive — the system learns from actual consultation durations during the session, not hardcoded estimates. Results Queue updates propagate to all screens in under 100ms. Wait time estimates adapt in real time based on actual consultation durations from the current session — no hardcoded numbers. Emergency patients reach the front of queue in one click with a voice announcement distinguishing urgency level. The receptionist screen handles adding, calling, reordering, pausing, and doctor assignment without leaving the page. Reconnection recovery is seamless — any tab that drops and rejoins gets the full current state instantly via reconnect:sync. Reflection Add per-doctor wait time estimates — currently uses a global average. A patient assigned to a doctor with 5 people ahead should see a different estimate than one assigned to a doctor with 2. Also would add SMS/WhatsApp notification when the token 2 positions away, so patients can wait outside instead of in the room.