# cyber-prince-k/queue-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/cyber-prince-k/queue-management-system
- Repository: https://github.com/cyber-prince-k/queue-management-system

## Overview

QECH Queue Management System is a PHP/MySQL hospital queue application with browser-based portals. Patients register or book appointments and receive queue tokens; staff call and update patients, while administrators oversee queues and reporting. The graph includes the documented patient, staff, admin, multilingual, notification, and appointment capabilities. Several UI and backend connections are based on README documentation; unsampled modules are represented by their supported paths without inferred call relationships.

Main entry points: [`php/api/queue.php`](https://github.com/cyber-prince-k/queue-management-system/blob/main/php/api/queue.php) (Queue API), [`js/queue.js`](https://github.com/cyber-prince-k/queue-management-system/blob/main/js/queue.js) (Queue interactions), [`database/schema.sql`](https://github.com/cyber-prince-k/queue-management-system/blob/main/database/schema.sql) (Queue database), [`php/api/admin.php`](https://github.com/cyber-prince-k/queue-management-system/blob/main/php/api/admin.php) (Administration and reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["Web portals"]
  node_patients["Patient portal<br/>[patient.html]"]
  node_staff["Staff portal<br/>[staff.html]"]
  node_adminui["Admin portal<br/>[admin.html]"]
  node_publicdisplay["Queue displays<br/>[display.html]"]
  node_authui["Login and registration<br/>[auth.js]"]
  node_ui["Navigation and language<br/>[style.js]"]
  node_queueui["Queue interactions<br/>[queue.js]"]
end

subgraph group_api["Application APIs"]
  node_authapi["Authentication API<br/>[auth.php]"]
  node_queueapi["Queue API<br/>[queue.php]"]
  node_appointments["Appointments API<br/>[appointments.php]"]
  node_adminapi["Administration and reports<br/>[admin.php]"]
end

subgraph group_data["Queue data"]
  node_database[("Queue database<br/>[schema.sql]")]
end

subgraph group_support["Shared services"]
  node_config["Database and session config<br/>[config.php]"]
  node_notifications["Notifications<br/>[notify_util.php]"]
  node_pdf["PDF generation library<br/>[fpdf.php]"]
end

node_patientactor(("Patient"))
node_staffactor(("Staff member"))
node_adminactor(("Administrator"))
node_sms(("SMS provider"))
node_email(("Email service"))

node_patientactor -->|"registers"| node_patients
node_patients -->|"joins queue"| node_queueui
node_queueui -->|"creates token"| node_queueapi
node_queueapi -->|"writes token"| node_database
node_staffactor -->|"manages queue"| node_staff
node_staff -->|"uses queue controls"| node_queueui
node_queueui -->|"calls next"| node_queueapi
node_queueapi -->|"updates queue"| node_database
node_adminactor -->|"administers"| node_adminui
node_adminui -.->|"requests reports"| node_adminapi
node_adminapi -->|"queries statistics"| node_database
node_adminapi -->|"generates PDF"| node_pdf
node_authui -->|"authenticates"| node_authapi
node_authapi -->|"reads users"| node_database
node_authapi -->|"loads session config"| node_config
node_queueapi -->|"loads API config"| node_config
node_appointments -->|"loads API config"| node_config
node_adminapi -->|"loads API config"| node_config
node_appointments -->|"manages appointments"| node_database
node_queueapi -->|"sends notifications"| node_notifications
node_appointments -->|"emails token details"| node_notifications
node_notifications -.->|"sends SMS"| node_sms
node_notifications -.->|"sends email"| node_email
node_publicdisplay -.->|"shows queue status"| node_queueui
node_ui -.->|"translates interface"| node_patients

click node_patients "https://github.com/cyber-prince-k/queue-management-system/blob/main/html/patient.html"
click node_staff "https://github.com/cyber-prince-k/queue-management-system/blob/main/html/staff.html"
click node_adminui "https://github.com/cyber-prince-k/queue-management-system/blob/main/html/admin.html"
click node_publicdisplay "https://github.com/cyber-prince-k/queue-management-system/blob/main/html/display.html"
click node_authui "https://github.com/cyber-prince-k/queue-management-system/blob/main/js/auth.js"
click node_ui "https://github.com/cyber-prince-k/queue-management-system/blob/main/js/style.js"
click node_queueui "https://github.com/cyber-prince-k/queue-management-system/blob/main/js/queue.js"
click node_authapi "https://github.com/cyber-prince-k/queue-management-system/blob/main/php/api/auth.php"
click node_queueapi "https://github.com/cyber-prince-k/queue-management-system/blob/main/php/api/queue.php"
click node_appointments "https://github.com/cyber-prince-k/queue-management-system/blob/main/php/api/appointments.php"
click node_adminapi "https://github.com/cyber-prince-k/queue-management-system/blob/main/php/api/admin.php"
click node_database "https://github.com/cyber-prince-k/queue-management-system/blob/main/database/schema.sql"
click node_config "https://github.com/cyber-prince-k/queue-management-system/blob/main/php/config.php"
click node_notifications "https://github.com/cyber-prince-k/queue-management-system/blob/main/php/api/notify_util.php"
click node_pdf "https://github.com/cyber-prince-k/queue-management-system/blob/main/php/lib/fpdf.php"

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_patients,node_staff,node_adminui,node_publicdisplay,node_authui,node_ui,node_queueui toneBlue
class node_authapi,node_queueapi,node_appointments,node_adminapi toneAmber
class node_database toneMint
class node_config,node_notifications,node_pdf toneRose
class node_patientactor,node_staffactor,node_adminactor,node_sms,node_email toneIndigo
```

## Components

### Web portals

- [Patient portal](https://github.com/cyber-prince-k/queue-management-system/blob/main/html/patient.html): `html/patient.html`
- [Staff portal](https://github.com/cyber-prince-k/queue-management-system/blob/main/html/staff.html): `html/staff.html`
- [Admin portal](https://github.com/cyber-prince-k/queue-management-system/blob/main/html/admin.html): `html/admin.html`
- [Queue displays](https://github.com/cyber-prince-k/queue-management-system/blob/main/html/display.html): `html/display.html`
- [Login and registration](https://github.com/cyber-prince-k/queue-management-system/blob/main/js/auth.js): `js/auth.js`
- [Navigation and language](https://github.com/cyber-prince-k/queue-management-system/blob/main/js/style.js): `js/style.js`
- [Queue interactions](https://github.com/cyber-prince-k/queue-management-system/blob/main/js/queue.js): `js/queue.js`

### Application APIs

- [Authentication API](https://github.com/cyber-prince-k/queue-management-system/blob/main/php/api/auth.php): `php/api/auth.php`
- [Queue API](https://github.com/cyber-prince-k/queue-management-system/blob/main/php/api/queue.php): `php/api/queue.php`
- [Appointments API](https://github.com/cyber-prince-k/queue-management-system/blob/main/php/api/appointments.php): `php/api/appointments.php`
- [Administration and reports](https://github.com/cyber-prince-k/queue-management-system/blob/main/php/api/admin.php): `php/api/admin.php`

### Queue data

- [Queue database](https://github.com/cyber-prince-k/queue-management-system/blob/main/database/schema.sql): `database/schema.sql`

### Shared services

- [Database and session config](https://github.com/cyber-prince-k/queue-management-system/blob/main/php/config.php): `php/config.php`
- [Notifications](https://github.com/cyber-prince-k/queue-management-system/blob/main/php/api/notify_util.php): `php/api/notify_util.php`
- [PDF generation library](https://github.com/cyber-prince-k/queue-management-system/blob/main/php/lib/fpdf.php): `php/lib/fpdf.php`

### Other components

- **Patient**
- **Staff member**
- **Administrator**
- **SMS provider**
- **Email service**

## Connections

- Patient → Patient portal: registers (evidence: `README.md`)
- Patient portal → Queue interactions: joins queue (evidence: `README.md`)
- Queue interactions → Queue API: creates token (evidence: `js/queue.js`)
- Queue API → Queue database: writes token (evidence: `php/api/queue.php`)
- Staff member → Staff portal: manages queue (evidence: `README.md`)
- Staff portal → Queue interactions: uses queue controls (evidence: `README.md`)
- Queue interactions → Queue API: calls next (evidence: `js/queue.js`)
- Queue API → Queue database: updates queue (evidence: `php/api/queue.php`)
- Administrator → Admin portal: administers (evidence: `README.md`)
- Admin portal → Administration and reports: requests reports
- Administration and reports → Queue database: queries statistics (evidence: `php/api/admin.php`)
- Administration and reports → PDF generation library: generates PDF (evidence: `php/api/admin.php`)
- Login and registration → Authentication API: authenticates (evidence: `js/auth.js`)
- Authentication API → Queue database: reads users (evidence: `php/api/auth.php`)
- Authentication API → Database and session config: loads session config (evidence: `php/api/auth.php`)
- Queue API → Database and session config: loads API config (evidence: `php/api/queue.php`)
- Appointments API → Database and session config: loads API config (evidence: `php/api/appointments.php`)
- Administration and reports → Database and session config: loads API config (evidence: `php/api/admin.php`)
- Appointments API → Queue database: manages appointments (evidence: `php/api/appointments.php`)
- Queue API → Notifications: sends notifications (evidence: `php/api/queue.php`)
- Appointments API → Notifications: emails token details (evidence: `php/api/appointments.php`)
- Notifications → SMS provider: sends SMS
- Notifications → Email service: sends email
- Queue displays → Queue interactions: shows queue status
- Navigation and language → Patient portal: translates interface
