Skip to main content
HealthTech Healthcare & MedTech / Web Application

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.

Project Type
Real-Time Clinic Queue & Token Platform
Industry
Healthcare & MedTech / Web Application
Technology Stack
Next.js Node.js MongoDB AWS S3 +7 more

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.

01

Business Challenge & Strategic Solution

The Challenge

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.

Core Operational Obstacles
Real-Time WebSocket Waiting Room Broadcast

Connected TV display monitors to Socket.io WebSocket rooms (hospital_management), allowing instantaneous token screen updates when doctors call next patient.

Atomic Date-Wise Token Sequence Counter

Implemented MongoDB aggregation queries filtering YYYY-MM-DD boundaries (getTokenNoForDate) to ensure daily sequential token numbering starting at 1 each morning without race conditions.

Differential Case Fee & Billing Rules

Engineered dynamic tariff rules distinguishing new consultation fees from follow-up old case tariffs based on configurable effective date ranges and treatment charges.

Bilingual Interface for Regional Staff

Created a lightweight i18n localization engine supporting seamless Gujarati and English UI switching for regional receptionist and nursing staff.

Our Solution & Approach

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.

SYSTEM ARCHITECTURE FLOW Layer Pipeline
L1
Frontend & Real-Time UI
Next.js 13.4 (React 18) / Redux / Socket.io Client
L2
Backend Core API & Server
Node.js / Express.js / Socket.io Server
L3
Database
MongoDB
L4
Cloud & Storage Services
AWS S3 / AWS SES / Firebase Admin
02

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
03

System Architecture & Engineered Modules

Engineered Solution Overview Token Doctor is a multi-tenant medical clinic queue and OPD management application engineered to modernize patient flow and clinic administration. Built on Node.js, Express, MongoDB, and Next.js, the platform features real-time WebSocket token broadcasting to TV waiting room displays, automated sequential daily token generation, dynamic case fee billing, bilingual support (English/Gujarati), and granular Role-Based Access Control (RBAC) for doctors, receptionists, compounders, and patients.
📺

Live TV Token Broadcasting & Queue Engine

Wall-Mounted TV Display (/token): High-visibility token board updating via WebSocket events (sendToken, recieveToken) without browser reloads.
Sequential Token Allocation: Automated daily reset counter (getTokenNoForDate) and unique 8-digit appointment tracking (generateAppointmentNo).
One-Click Doctor Consultation Call: Single-click action for practitioners to advance the active token and broadcast changes across clinic displays.
⚡

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

NEXT CASE STUDY Explore Project
HealthTech • Telehealth / HealthTech / Web Application

Everlong — Telehealth & Registered Dietitian Patient Onboarding Platform

Seamless HIPAA-aware patient intake, real-time insurance eligibility verification, and state-matched dietitian scheduling platform.

View Case Study

Ready to engineer your next digital system?

Partner with JiyanTech to architect custom web applications, enterprise software, and mobile platforms.

JiyanTech

Replies Mon – Sat, 10 AM – 7 PM IST

Hi there 👋

How can we help with your project? Send us a message and we'll reply on WhatsApp.