# zennxzy/rhu-q-queueing-and-patient-management-system architecture

> Architecture diagram of the GitHub repository zennxzy/rhu-q-queueing-and-patient-management-system, 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/zennxzy/rhu-q-queueing-and-patient-management-system
- Repository: https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system

## Overview

RHU-Q is a web-based queuing and patient-management system. Staff and administrators manage patient records, queues, services, appointments, reports, and operational settings; patients can register and use patient-facing queue and appointment features. The tree shows PHP pages and endpoints alongside browser JavaScript, with MySQL access through a shared connection module. Sampled evidence confirms several page-to-authentication and database relationships, but the README is empty and many feature implementations were not sampled, so those components are shown without guessed call paths.

Main entry points: [`php/connection.php`](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/connection.php) (Database Connection), [`api/check-private.php`](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/api/check-private.php) (Private Access Check), [`pages/login_page.php`](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/login_page.php) (Login), [`pages/patient_records.php`](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/patient_records.php) (Patient Records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Accounts"]
  node_login["Login<br/>[login_page.php]"]
  node_register["Account Registration<br/>[register_page.php]"]
  node_auth["Private Access Check<br/>[check-private.php]"]
  node_session_owner["Session Ownership<br/>[session-owner.php]"]
end

subgraph group_care["Patient and Appointments"]
  node_patient_form["Patient Registration"]
  node_patient_register["Registration Handler"]
  node_records["Patient Records"]
  node_patient_api["Patient Data API<br/>[get_patients.php]"]
  node_appointments["Appointment Management"]
end

subgraph group_queue["Queue Operations"]
  node_queue_manager["Queue Manager"]
  node_queue_data["Queue Data API"]
  node_queue_display["Public Queue Display"]
  node_queue_actions["Queue Actions<br/>[complete-queue.php]"]
end

subgraph group_admin["Administration and Insights"]
  node_dashboard["Dashboard<br/>[dashboard_page.php]"]
  node_reports["Reports<br/>[reports_page.php]"]
  node_report_data["Report Data<br/>[get_reports.php]"]
  node_services_ui["Service Settings"]
  node_services_handler["Service Management"]
  node_backup["Backup and Restore<br/>[backup.php]"]
  node_logs["Activity Logs"]
end

subgraph group_infra["Shared Runtime"]
  node_connection[("Database Connection<br/>[connection.php]")]
end

node_staff(("Staff / Admin"))
node_patient(("Patient"))

node_staff -->|"opens"| node_login
node_patient -->|"registers"| node_patient_form
node_staff -->|"manages"| node_records
node_staff -->|"manages queues"| node_queue_manager
node_staff -->|"views"| node_reports
node_login -->|"uses"| node_connection
node_login -->|"checks ownership"| node_session_owner
node_register -->|"uses"| node_connection
node_patient_form -->|"uses"| node_connection
node_patient_register -->|"uses"| node_connection
node_records -->|"authorizes"| node_auth
node_records -->|"queries"| node_connection
node_patient_api -->|"checks access"| node_auth
node_patient_api -->|"queries"| node_connection
node_queue_manager -->|"authorizes"| node_auth
node_queue_manager -->|"queries"| node_connection
node_queue_data -->|"authorizes"| node_auth
node_queue_data -->|"queries"| node_connection
node_reports -->|"authorizes"| node_auth
node_report_data -->|"checks access"| node_auth
node_report_data -->|"queries"| node_connection
node_services_ui -->|"authorizes"| node_auth
node_services_handler -->|"updates"| node_connection
node_backup -->|"checks access"| node_auth
node_backup -->|"uses"| node_connection
node_auth -->|"verifies accounts"| node_connection
node_auth -->|"checks ownership"| node_session_owner

click node_login "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/login_page.php"
click node_register "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/register_page.php"
click node_auth "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/api/check-private.php"
click node_session_owner "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/session-owner.php"
click node_patient_form "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/patient_reg_form.php"
click node_patient_register "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/patient_register.php"
click node_records "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/patient_records.php"
click node_patient_api "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/api/get_patients.php"
click node_appointments "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/appointment_page.php"
click node_queue_manager "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/queue_manager_page.php"
click node_queue_data "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/api/get_queue_manager_data.php"
click node_queue_display "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/queue_display_page.php"
click node_queue_actions "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/complete-queue.php"
click node_dashboard "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/dashboard_page.php"
click node_reports "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/reports_page.php"
click node_report_data "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/api/get_reports.php"
click node_services_ui "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/account_settings_page.php"
click node_services_handler "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/manage_services.php"
click node_backup "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/backup.php"
click node_logs "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/api/get_activity_logs.php"
click node_connection "https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/connection.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_login,node_register,node_auth,node_session_owner toneBlue
class node_patient_form,node_patient_register,node_records,node_patient_api,node_appointments toneAmber
class node_queue_manager,node_queue_data,node_queue_display,node_queue_actions toneMint
class node_dashboard,node_reports,node_report_data,node_services_ui,node_services_handler,node_backup,node_logs toneRose
class node_connection,node_staff,node_patient toneIndigo
```

## Components

### Access and Accounts

- [Login](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/login_page.php): `pages/login_page.php`
- [Account Registration](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/register_page.php): `pages/register_page.php`
- [Private Access Check](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/api/check-private.php): `api/check-private.php`
- [Session Ownership](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/session-owner.php): `php/session-owner.php`

### Patient and Appointments

- [Patient Registration](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/patient_reg_form.php): `pages/patient_reg_form.php`
- [Registration Handler](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/patient_register.php): `php/patient_register.php`
- [Patient Records](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/patient_records.php): `pages/patient_records.php`
- [Patient Data API](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/api/get_patients.php): `api/get_patients.php`
- [Appointment Management](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/appointment_page.php): `pages/appointment_page.php`

### Queue Operations

- [Queue Manager](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/queue_manager_page.php): `pages/queue_manager_page.php`
- [Queue Data API](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/api/get_queue_manager_data.php): `api/get_queue_manager_data.php`
- [Public Queue Display](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/queue_display_page.php): `pages/queue_display_page.php`
- [Queue Actions](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/complete-queue.php): `php/complete-queue.php`

### Administration and Insights

- [Dashboard](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/dashboard_page.php): `pages/dashboard_page.php`
- [Reports](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/reports_page.php): `pages/reports_page.php`
- [Report Data](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/api/get_reports.php): `api/get_reports.php`
- [Service Settings](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/pages/account_settings_page.php): `pages/account_settings_page.php`
- [Service Management](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/manage_services.php): `php/manage_services.php`
- [Backup and Restore](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/backup.php): `php/backup.php`
- [Activity Logs](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/api/get_activity_logs.php): `api/get_activity_logs.php`

### Shared Runtime

- [Database Connection](https://github.com/zennxzy/rhu-q-queueing-and-patient-management-system/blob/main/php/connection.php): `php/connection.php`

### Other components

- **Staff / Admin**
- **Patient**

## Connections

- Staff / Admin → Login: opens (evidence: `pages/login_page.php`)
- Patient → Patient Registration: registers (evidence: `pages/patient_reg_form.php`)
- Staff / Admin → Patient Records: manages (evidence: `pages/patient_records.php`)
- Staff / Admin → Queue Manager: manages queues (evidence: `pages/queue_manager_page.php`)
- Staff / Admin → Reports: views (evidence: `pages/reports_page.php`)
- Login → Database Connection: uses
- Login → Session Ownership: checks ownership
- Account Registration → Database Connection: uses (evidence: `pages/register_page.php`)
- Patient Registration → Database Connection: uses (evidence: `pages/patient_reg_form.php`)
- Registration Handler → Database Connection: uses (evidence: `php/patient_register.php`)
- Patient Records → Private Access Check: authorizes (evidence: `pages/patient_records.php`)
- Patient Records → Database Connection: queries (evidence: `pages/patient_records.php`)
- Patient Data API → Private Access Check: checks access (evidence: `api/get_patients.php`)
- Patient Data API → Database Connection: queries (evidence: `api/get_patients.php`)
- Queue Manager → Private Access Check: authorizes (evidence: `pages/queue_manager_page.php`)
- Queue Manager → Database Connection: queries (evidence: `pages/queue_manager_page.php`)
- Queue Data API → Private Access Check: authorizes (evidence: `api/get_queue_manager_data.php`)
- Queue Data API → Database Connection: queries (evidence: `api/get_queue_manager_data.php`)
- Reports → Private Access Check: authorizes (evidence: `pages/reports_page.php`)
- Report Data → Private Access Check: checks access (evidence: `api/get_reports.php`)
- Report Data → Database Connection: queries (evidence: `api/get_reports.php`)
- Service Settings → Private Access Check: authorizes (evidence: `pages/account_settings_page.php`)
- Service Management → Database Connection: updates (evidence: `php/manage_services.php`)
- Backup and Restore → Private Access Check: checks access (evidence: `php/backup.php`)
- Backup and Restore → Database Connection: uses (evidence: `php/backup.php`)
- Private Access Check → Database Connection: verifies accounts (evidence: `api/check-private.php`)
- Private Access Check → Session Ownership: checks ownership (evidence: `api/check-private.php`)
