Token Doctor — Real-Time OPD Queue & Clinic Management System
Real-time OPD queue management, live WebSocket TV token broadcasting, and multi-tenant clinic administration platform.
Traditional hospital outpatient departments (OPDs) and private clinics face severe operational bottlenecks: chaotic physical waiting room queues, high receptionist workload verbally calling out numbers, complex differential consultation fee structures (old vs new cases, treatment fees, medicine costs), and fragmented patient records during walk-in registrations.
Business Challenge & Strategic Solution
Managing physical OPD waiting lines is noisy and error-prone. Receptionists spend high operational effort manually issuing paper tokens and calling patient numbers, while doctors lack streamlined tools to log consultation charges, manage differential case fees (old vs. new cases), or broadcast next tokens in real time.
Connected TV display monitors to Socket.io WebSocket rooms (hospital_management), allowing instantaneous token screen updates when doctors call next patient.
Implemented MongoDB aggregation queries filtering YYYY-MM-DD boundaries (getTokenNoForDate) to ensure daily sequential token numbering starting at 1 each morning without race conditions.
Engineered dynamic tariff rules distinguishing new consultation fees from follow-up old case tariffs based on configurable effective date ranges and treatment charges.
Created a lightweight i18n localization engine supporting seamless Gujarati and English UI switching for regional receptionist and nursing staff.
We architected a real-time Next.js and Node.js microservices architecture integrated with Socket.io WebSockets. We designed a dedicated `/token` display board route optimized for wall-mounted clinic TV monitors, implemented atomic MongoDB aggregation pipelines for daily sequential token numbering (`1, 2, 3...`), created dynamic tariff configurators for differential case fees, and built a custom RBAC permission validator for module-level staff access.
Technology Stack by Layer
The 11 technologies Token Doctor runs on, grouped by the layer of the system they power.
Frontend & UI 4 technologies
- Next.js Server-rendered React framework
- React Component-based UI
- Redux Predictable app state
- Bootstrap 5 Responsive UI toolkit
Backend & APIs 3 technologies
- Node.js Server runtime
- Express.js REST API framework
- Socket.io Real-time events
Data & storage 1 technologies
- MongoDB Document database
Cloud & infrastructure 3 technologies
- AWS S3 File & media storage
- AWS SES Transactional email
- Firebase Push messaging & OTP
System Architecture & Engineered Modules
Live TV Token Broadcasting & Queue Engine
System Interfaces & Digital Views
Business Impact & Key Outcomes
Zero Duplicate Tokens: Atomic date-wise sequence aggregation logic (getTokenNoForDate) eliminates human errors and token collisions across simultaneous bookings
Real-Time TV Queue Broadcast: Socket.io room broadcasting updates wall-mounted waiting room display screens instantly upon calling next patient
Reduced Waiting Room Chaos: Clear digital queue visualization minimizes front-desk inquiry bottlenecks and eliminates noisy manual calling
Bilingual Regional Usability: Built-in English & Gujarati UI switching persisted across staff sessions via browser cookies
Ready to engineer your next digital system?
Partner with JiyanTech to architect custom web applications, enterprise software, and mobile platforms.