# uzaam07/hospital-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/uzaam07/hospital-management-system
- Repository: https://github.com/uzaam07/hospital-management-system

## Overview

This PHP/MySQL hospital system serves patients, doctors, and administrators. The visible workflow starts at the role-selection/registration page, routes form submissions to authentication or registration handlers, then presents role-specific dashboards for appointments, patient records, and prescriptions. Patient booking and doctor prescription entry are distinct clinical stages backed by MySQL. The README also describes bill downloads and payment, but no implementing source appears in the tree; that capability is shown as unverified. Connections reflect the excerpts and README, not an inspection of unsampled files.

Main entry points: [`config/database.php`](https://github.com/uzaam07/hospital-management-system/blob/main/config/database.php) (Database connection), [`patient/dashboard.php`](https://github.com/uzaam07/hospital-management-system/blob/main/patient/dashboard.php) (Patient dashboard), [`index.php`](https://github.com/uzaam07/hospital-management-system/blob/main/index.php) (Role entry), [`doctor/dashboard.php`](https://github.com/uzaam07/hospital-management-system/blob/main/doctor/dashboard.php) (Doctor dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Entry and Identity"]
  node_entry["Role entry<br/>[index.php]"]
  node_patient_registration["Patient registration<br/>[func2.php]"]
  node_patient_login["Patient login<br/>[func.php]"]
  node_doctor_login["Doctor login<br/>[func1.php]"]
  node_admin_login["Admin login<br/>[func3.php]"]
end

subgraph group_patient_care["Patient Care"]
  node_patient_dashboard["Patient dashboard<br/>[dashboard.php]"]
  node_appointment_booking["Appointment booking and history<br/>[dashboard.php]"]
  node_prescription_history["Prescription history<br/>[dashboard.php]"]
  node_patient_billing["Bills and payment"]
end

subgraph group_clinical["Clinical Work"]
  node_doctor_dashboard["Doctor dashboard<br/>[dashboard.php]"]
  node_prescription_authoring["Prescription authoring<br/>[prescribe.php]"]
end

subgraph group_administration["Administration"]
  node_admin_dashboard["Admin dashboard<br/>[dashboard.php]"]
end

subgraph group_persistence["Persistence"]
  node_doctor_catalog["Doctor and specialty lookup<br/>[newfunc.php]"]
  node_database_connector["Database connection<br/>[database.php]"]
end

node_visitor(("Hospital user"))
node_mysql[("MySQL database")]

node_visitor -->|"opens"| node_entry
node_entry -->|"submits registration"| node_patient_registration
node_entry -->|"submits login"| node_doctor_login
node_entry -->|"submits login"| node_admin_login
node_entry -.->|"login documented"| node_patient_login
node_patient_registration -->|"uses connection"| node_database_connector
node_patient_login -->|"uses connection"| node_database_connector
node_doctor_login -->|"uses connection"| node_database_connector
node_admin_login -->|"uses connection"| node_database_connector
node_patient_login -->|"redirects to"| node_patient_dashboard
node_doctor_login -->|"redirects to"| node_doctor_dashboard
node_admin_login -->|"redirects to"| node_admin_dashboard
node_patient_dashboard -->|"provides"| node_appointment_booking
node_patient_dashboard -->|"provides"| node_prescription_history
node_patient_dashboard -->|"uses connection"| node_database_connector
node_patient_dashboard -->|"calls lookup helpers"| node_doctor_catalog
node_appointment_booking -->|"writes and reads"| node_mysql
node_prescription_history -->|"reads"| node_mysql
node_doctor_dashboard -->|"uses connection"| node_database_connector
node_doctor_dashboard -->|"links to"| node_prescription_authoring
node_doctor_dashboard -->|"reads"| node_mysql
node_prescription_authoring -->|"uses connection"| node_database_connector
node_prescription_authoring -->|"reads and writes"| node_mysql
node_admin_dashboard -->|"uses connection"| node_database_connector
node_admin_dashboard -->|"calls count helpers"| node_doctor_catalog
node_admin_dashboard -->|"reads and deletes"| node_mysql
node_doctor_catalog -->|"uses connection"| node_database_connector
node_doctor_catalog -->|"queries"| node_mysql
node_database_connector -->|"connects to"| node_mysql
node_patient_dashboard -.->|"bill access documented"| node_patient_billing

click node_entry "https://github.com/uzaam07/hospital-management-system/blob/main/index.php"
click node_patient_registration "https://github.com/uzaam07/hospital-management-system/blob/main/includes/func2.php"
click node_patient_login "https://github.com/uzaam07/hospital-management-system/blob/main/includes/func.php"
click node_doctor_login "https://github.com/uzaam07/hospital-management-system/blob/main/includes/func1.php"
click node_admin_login "https://github.com/uzaam07/hospital-management-system/blob/main/includes/func3.php"
click node_patient_dashboard "https://github.com/uzaam07/hospital-management-system/blob/main/patient/dashboard.php"
click node_appointment_booking "https://github.com/uzaam07/hospital-management-system/blob/main/patient/dashboard.php"
click node_prescription_history "https://github.com/uzaam07/hospital-management-system/blob/main/patient/dashboard.php"
click node_patient_billing "https://github.com/uzaam07/hospital-management-system/tree/main/patient"
click node_doctor_dashboard "https://github.com/uzaam07/hospital-management-system/blob/main/doctor/dashboard.php"
click node_prescription_authoring "https://github.com/uzaam07/hospital-management-system/blob/main/doctor/prescribe.php"
click node_admin_dashboard "https://github.com/uzaam07/hospital-management-system/blob/main/admin/dashboard.php"
click node_doctor_catalog "https://github.com/uzaam07/hospital-management-system/blob/main/includes/newfunc.php"
click node_database_connector "https://github.com/uzaam07/hospital-management-system/blob/main/config/database.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_entry,node_patient_registration,node_patient_login,node_doctor_login,node_admin_login,node_visitor toneBlue
class node_patient_dashboard,node_appointment_booking,node_prescription_history,node_patient_billing,node_mysql toneAmber
class node_doctor_dashboard,node_prescription_authoring toneMint
class node_admin_dashboard toneRose
class node_doctor_catalog,node_database_connector toneIndigo
```

## Components

### Entry and Identity

- [Role entry](https://github.com/uzaam07/hospital-management-system/blob/main/index.php): `index.php`
- [Patient registration](https://github.com/uzaam07/hospital-management-system/blob/main/includes/func2.php): `includes/func2.php`
- [Patient login](https://github.com/uzaam07/hospital-management-system/blob/main/includes/func.php): `includes/func.php`
- [Doctor login](https://github.com/uzaam07/hospital-management-system/blob/main/includes/func1.php): `includes/func1.php`
- [Admin login](https://github.com/uzaam07/hospital-management-system/blob/main/includes/func3.php): `includes/func3.php`

### Patient Care

- [Patient dashboard](https://github.com/uzaam07/hospital-management-system/blob/main/patient/dashboard.php): `patient/dashboard.php`
- [Appointment booking and history](https://github.com/uzaam07/hospital-management-system/blob/main/patient/dashboard.php): `patient/dashboard.php`
- [Prescription history](https://github.com/uzaam07/hospital-management-system/blob/main/patient/dashboard.php): `patient/dashboard.php`
- [Bills and payment](https://github.com/uzaam07/hospital-management-system/tree/main/patient): `patient`

### Clinical Work

- [Doctor dashboard](https://github.com/uzaam07/hospital-management-system/blob/main/doctor/dashboard.php): `doctor/dashboard.php`
- [Prescription authoring](https://github.com/uzaam07/hospital-management-system/blob/main/doctor/prescribe.php): `doctor/prescribe.php`

### Administration

- [Admin dashboard](https://github.com/uzaam07/hospital-management-system/blob/main/admin/dashboard.php): `admin/dashboard.php`

### Persistence

- [Doctor and specialty lookup](https://github.com/uzaam07/hospital-management-system/blob/main/includes/newfunc.php): `includes/newfunc.php`
- [Database connection](https://github.com/uzaam07/hospital-management-system/blob/main/config/database.php): `config/database.php`

### Other components

- **Hospital user**
- **MySQL database**

## Connections

- Hospital user → Role entry: opens (evidence: `README.md`)
- Role entry → Patient registration: submits registration (evidence: `index.php`)
- Role entry → Doctor login: submits login (evidence: `index.php`)
- Role entry → Admin login: submits login (evidence: `index.php`)
- Role entry → Patient login: login documented (evidence: `README.md`)
- Patient registration → Database connection: uses connection (evidence: `includes/func2.php`)
- Patient login → Database connection: uses connection (evidence: `includes/func.php`)
- Doctor login → Database connection: uses connection (evidence: `includes/func1.php`)
- Admin login → Database connection: uses connection (evidence: `includes/func3.php`)
- Patient login → Patient dashboard: redirects to (evidence: `includes/func.php`)
- Doctor login → Doctor dashboard: redirects to (evidence: `includes/func1.php`)
- Admin login → Admin dashboard: redirects to (evidence: `includes/func3.php`)
- Patient dashboard → Appointment booking and history: provides (evidence: `patient/dashboard.php`)
- Patient dashboard → Prescription history: provides (evidence: `patient/dashboard.php`)
- Patient dashboard → Database connection: uses connection (evidence: `patient/dashboard.php`)
- Patient dashboard → Doctor and specialty lookup: calls lookup helpers (evidence: `patient/dashboard.php`)
- Appointment booking and history → MySQL database: writes and reads (evidence: `patient/dashboard.php`)
- Prescription history → MySQL database: reads (evidence: `patient/dashboard.php`)
- Doctor dashboard → Database connection: uses connection (evidence: `doctor/dashboard.php`)
- Doctor dashboard → Prescription authoring: links to (evidence: `doctor/dashboard.php`)
- Doctor dashboard → MySQL database: reads (evidence: `doctor/dashboard.php`)
- Prescription authoring → Database connection: uses connection (evidence: `doctor/prescribe.php`)
- Prescription authoring → MySQL database: reads and writes (evidence: `doctor/prescribe.php`)
- Admin dashboard → Database connection: uses connection (evidence: `admin/dashboard.php`)
- Admin dashboard → Doctor and specialty lookup: calls count helpers (evidence: `admin/dashboard.php`)
- Admin dashboard → MySQL database: reads and deletes (evidence: `admin/dashboard.php`)
- Doctor and specialty lookup → Database connection: uses connection (evidence: `includes/newfunc.php`)
- Doctor and specialty lookup → MySQL database: queries (evidence: `includes/newfunc.php`)
- Database connection → MySQL database: connects to (evidence: `config/database.php`)
- Patient dashboard → Bills and payment: bill access documented
