Hassan
Featured project
Queue Cure
Most small clinics still manage queues using paper tokens and manual announcements, causing long wait times, poor visibility, and administrative confusion. Patients often wait 2–3 hours without updates, while staff struggle to manage queues efficiently. The goal was to build a real-time digital queue system that predicts wait times dynamically and synchronizes data across reception and waiting-room displays. Process I built the solution during a 6-day sprint using Node.js, Express, PostgreSQL, Prisma, React, and Socket.io. Research showed that REST polling created delays, so I implemented WebSockets for instant updates. My first wait-time model depended on manually marking patients as completed, which proved unreliable. I replaced it with an Inter-Call Delta algorithm that calculates averages from consecutive patient calls. A major challenge arose when Prisma 7 conflicted with Supabase PgBouncer, requiring a switch to Prisma's PostgreSQL adapter. I also prevented queue race conditions using database transactions and idempotency keys. Results The prototype successfully delivered real-time queue management with sub-second synchronization between reception and display screens. Database transactions eliminated race conditions and duplicate actions, achieving reliable queue progression. The forecasting engine replaced static wait estimates with live predictions based on doctor pacing. User testing showed the debounced action controls reduced accidental clicks, while break detection prevented misleading countdowns during extended doctor absences. Reflection Given more time, I would adopt automated testing from day one using Jest and Supertest to validate queue logic and edge cases. I would replace the temporary PIN-based access system with JWT authentication and role-based permissions for stronger security. Finally, I would make the platform offline-first by converting it into a PWA with IndexedDB caching, allowing receptionists to continue working during internet outages and synchronize data once connectivity returns.