# nallurinithin/queueless architecture

> Architecture diagram of the GitHub repository nallurinithin/queueless, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nallurinithin/queueless
- Repository: https://github.com/nallurinithin/queueless

## Overview

QueueLess coordinates patient appointments and clinic queues through patient-facing booking/check-in, staff role consoles, and a live waiting-room display. The documented booking flow reserves a slot for five minutes before deposit payment; staff manage allocation and queue operations, while doctors enforce consultation safety. The sampled code confirms client routing, staff session handling, queue persistence and socket broadcasts. Other major capabilities—payments, clinic administration, OTP, and notifications—are included from README and the repository tree; unsampled links are omitted or marked unverified.

Main entry points: [`queueless-app/server/src/services/queueService.js`](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/queueService.js) (Queue Services), [`queueless-app/server/src/services/appointmentService.js`](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/appointmentService.js) (Appointment Services), [`queueless-app/server/src/models/Appointment.js`](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/models/Appointment.js) (Domain Models), [`queueless-app/server/src/routes/index.js`](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/routes/index.js) (API Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient Experience"]
  node_booking["Appointment Booking<br/>[PatientBooking.jsx]"]
  node_checkin["Patient Check-In<br/>[PatientCheckIn.jsx]"]
  node_patientqueue["Patient Queue Tracker<br/>[PatientQueue.jsx]"]
end

subgraph group_staff["Clinic Operations"]
  node_staffauth["Staff Authentication<br/>[AuthContext.jsx]"]
  node_owner["Owner Console<br/>[OwnerDashboard.jsx]"]
  node_reception["Reception Console"]
  node_doctor["Doctor Console"]
  node_staffqueue["Staff Live Queue<br/>[StaffLiveQueue.jsx]"]
end

subgraph group_queue["Queue and Display"]
  node_display["Waiting Room Display"]
end

subgraph group_backend["Application Services"]
  node_router["API Routes<br/>[index.js]"]
  node_appointment["Appointment Services"]
  node_queueops["Queue Services<br/>[queueService.js]"]
  node_patientauth["Patient OTP and Sessions"]
  node_staffservice["Staff and Invitations"]
  node_payments["Payment Processing<br/>[paymentService.js]"]
  node_notifications["Notifications"]
  node_socket["Realtime Socket<br/>[socket.js]"]
end

subgraph group_data["Persistent Data"]
  node_mongo[("Clinic Database<br/>[database.js]")]
  node_models[("Domain Models<br/>[Appointment.js]")]
end

node_patient(("Patient"))
node_staffuser(("Clinic Staff"))
node_razorpay{{"Razorpay"}}
node_sms{{"SMS Provider"}}
node_email{{"Email Provider"}}

node_patient -->|"requests booking"| node_booking
node_booking -.->|"verifies OTP"| node_patientauth
node_booking -.->|"submits request"| node_appointment
node_appointment -.->|"holds and confirms"| node_payments
node_payments -.->|"charges deposit"| node_razorpay
node_staffuser -->|"signs in"| node_staffauth
node_staffauth -.->|"authenticates"| node_staffservice
node_staffservice -->|"sends invitations"| node_email
node_staffuser -->|"administers clinic"| node_owner
node_staffuser -->|"manages appointments"| node_reception
node_staffuser -->|"runs consultations"| node_doctor
node_staffuser -->|"operates queue"| node_staffqueue
node_reception -.->|"allocates appointments"| node_appointment
node_reception -.->|"registers arrivals"| node_queueops
node_doctor -.->|"advances consultation"| node_queueops
node_patient -->|"checks in"| node_checkin
node_checkin -.->|"activates queue entry"| node_queueops
node_patient -->|"tracks progress"| node_patientqueue
node_staffqueue -.->|"operates live queue"| node_queueops
node_queueops -->|"broadcasts updates"| node_socket
node_socket -.->|"updates display"| node_display
node_queueops -.->|"serves queue status"| node_patientqueue
node_staffuser -->|"views lobby display"| node_display
node_router -.->|"routes requests"| node_appointment
node_router -->|"routes queue actions"| node_queueops
node_router -.->|"routes staff actions"| node_staffservice
node_appointment -->|"reads and writes"| node_models
node_queueops -->|"reads and writes"| node_models
node_patientauth -.->|"stores sessions"| node_models
node_models -.->|"persists records"| node_mongo
node_patientauth -.->|"sends OTP"| node_sms
node_appointment -.->|"queues notices"| node_notifications

click node_booking "https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/PatientBooking.jsx"
click node_checkin "https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/PatientCheckIn.jsx"
click node_patientqueue "https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/PatientQueue.jsx"
click node_staffauth "https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/context/AuthContext.jsx"
click node_owner "https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/dashboards/OwnerDashboard.jsx"
click node_reception "https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/dashboards/ReceptionistDashboard.jsx"
click node_doctor "https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/dashboards/DoctorDashboard.jsx"
click node_staffqueue "https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/StaffLiveQueue.jsx"
click node_display "https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/WaitingRoomDisplay.jsx"
click node_router "https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/routes/index.js"
click node_appointment "https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/appointmentService.js"
click node_queueops "https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/queueService.js"
click node_patientauth "https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/patientAuthService.js"
click node_staffservice "https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/staffAuthService.js"
click node_payments "https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/paymentService.js"
click node_notifications "https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/notificationOutboxService.js"
click node_socket "https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/config/socket.js"
click node_mongo "https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/config/database.js"
click node_models "https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/models/Appointment.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_booking,node_checkin,node_patientqueue toneBlue
class node_staffauth,node_owner,node_reception,node_doctor,node_staffqueue toneAmber
class node_display toneMint
class node_router,node_appointment,node_queueops,node_patientauth,node_staffservice,node_payments,node_notifications,node_socket toneRose
class node_mongo,node_models,node_patient,node_staffuser,node_razorpay,node_sms,node_email toneIndigo
```

## Components

### Patient Experience

- [Appointment Booking](https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/PatientBooking.jsx): `queueless-app/client/src/pages/PatientBooking.jsx`
- [Patient Check-In](https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/PatientCheckIn.jsx): `queueless-app/client/src/pages/PatientCheckIn.jsx`
- [Patient Queue Tracker](https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/PatientQueue.jsx): `queueless-app/client/src/pages/PatientQueue.jsx`

### Clinic Operations

- [Staff Authentication](https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/context/AuthContext.jsx): `queueless-app/client/src/context/AuthContext.jsx`
- [Owner Console](https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/dashboards/OwnerDashboard.jsx): `queueless-app/client/src/pages/dashboards/OwnerDashboard.jsx`
- [Reception Console](https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/dashboards/ReceptionistDashboard.jsx): `queueless-app/client/src/pages/dashboards/ReceptionistDashboard.jsx`
- [Doctor Console](https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/dashboards/DoctorDashboard.jsx): `queueless-app/client/src/pages/dashboards/DoctorDashboard.jsx`
- [Staff Live Queue](https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/StaffLiveQueue.jsx): `queueless-app/client/src/pages/StaffLiveQueue.jsx`

### Queue and Display

- [Waiting Room Display](https://github.com/nallurinithin/queueless/blob/main/queueless-app/client/src/pages/WaitingRoomDisplay.jsx): `queueless-app/client/src/pages/WaitingRoomDisplay.jsx`

### Application Services

- [API Routes](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/routes/index.js): `queueless-app/server/src/routes/index.js`
- [Appointment Services](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/appointmentService.js): `queueless-app/server/src/services/appointmentService.js`
- [Queue Services](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/queueService.js): `queueless-app/server/src/services/queueService.js`
- [Patient OTP and Sessions](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/patientAuthService.js): `queueless-app/server/src/services/patientAuthService.js`
- [Staff and Invitations](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/staffAuthService.js): `queueless-app/server/src/services/staffAuthService.js`
- [Payment Processing](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/paymentService.js): `queueless-app/server/src/services/paymentService.js`
- [Notifications](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/services/notificationOutboxService.js): `queueless-app/server/src/services/notificationOutboxService.js`
- [Realtime Socket](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/config/socket.js): `queueless-app/server/src/config/socket.js`

### Persistent Data

- [Clinic Database](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/config/database.js): `queueless-app/server/src/config/database.js`
- [Domain Models](https://github.com/nallurinithin/queueless/blob/main/queueless-app/server/src/models/Appointment.js): `queueless-app/server/src/models/Appointment.js`

### Other components

- **Patient**
- **Clinic Staff**
- **Razorpay**
- **SMS Provider**
- **Email Provider**

## Connections

- Patient → Appointment Booking: requests booking
- Appointment Booking → Patient OTP and Sessions: verifies OTP
- Appointment Booking → Appointment Services: submits request
- Appointment Services → Payment Processing: holds and confirms
- Payment Processing → Razorpay: charges deposit
- Clinic Staff → Staff Authentication: signs in (evidence: `queueless-app/client/src/context/AuthContext.jsx`)
- Staff Authentication → Staff and Invitations: authenticates
- Staff and Invitations → Email Provider: sends invitations (evidence: `queueless-app/server/src/services/staffAuthService.js`)
- Clinic Staff → Owner Console: administers clinic
- Clinic Staff → Reception Console: manages appointments
- Clinic Staff → Doctor Console: runs consultations
- Clinic Staff → Staff Live Queue: operates queue
- Reception Console → Appointment Services: allocates appointments
- Reception Console → Queue Services: registers arrivals
- Doctor Console → Queue Services: advances consultation
- Patient → Patient Check-In: checks in
- Patient Check-In → Queue Services: activates queue entry
- Patient → Patient Queue Tracker: tracks progress
- Staff Live Queue → Queue Services: operates live queue
- Queue Services → Realtime Socket: broadcasts updates (evidence: `queueless-app/server/src/services/queueService.js`)
- Realtime Socket → Waiting Room Display: updates display
- Queue Services → Patient Queue Tracker: serves queue status
- Clinic Staff → Waiting Room Display: views lobby display
- API Routes → Appointment Services: routes requests
- API Routes → Queue Services: routes queue actions
- API Routes → Staff and Invitations: routes staff actions
- Appointment Services → Domain Models: reads and writes (evidence: `queueless-app/server/src/services/appointmentService.js`)
- Queue Services → Domain Models: reads and writes (evidence: `queueless-app/server/src/services/queueService.js`)
- Patient OTP and Sessions → Domain Models: stores sessions
- Domain Models → Clinic Database: persists records
- Patient OTP and Sessions → SMS Provider: sends OTP
- Appointment Services → Notifications: queues notices
