# ariyoola45/hospital-management architecture

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

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

## Overview

CareCross is a browser-based hospital management system for staff. Staff sign in, manage patient and bed records, book admissions, move patients through admission and discharge, capture payments, and return beds to service through housekeeping. The React app routes users by role; feature pages call Firebase data-access modules, which use Firebase Authentication and Cloud Firestore. Reports and staff administration are additional capabilities. The README and source index support the broad feature map; unsampled page internals are not inferred beyond their documented or indexed dependencies.

Main entry points: [`app/src/App.jsx`](https://github.com/ariyoola45/hospital-management/blob/main/app/src/App.jsx) (App routing), [`app/src/firebase/wards.js`](https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/wards.js) (Ward data access), [`app/src/firebase/admissions.js`](https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/admissions.js) (Admission data access), [`app/src/context/AuthContext.jsx`](https://github.com/ariyoola45/hospital-management/blob/main/app/src/context/AuthContext.jsx) (Role authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and access"]
  node_app_routes["App routing<br/>[App.jsx]"]
  node_auth_context["Role authentication<br/>[AuthContext.jsx]"]
  node_dashboard["Dashboard shell"]
end

subgraph group_care["Hospital operations"]
  node_patient_records["Patient records<br/>[Patients.jsx]"]
  node_ward_inventory["Ward and beds<br/>[Wards.jsx]"]
  node_admissions["Admission booking<br/>[Admissions.jsx]"]
  node_admit_discharge["Admit and discharge"]
  node_payments["Billing and payments<br/>[Payments.jsx]"]
  node_housekeeping["Housekeeping tasks<br/>[Housekeeping.jsx]"]
  node_reports["Operational reports<br/>[Reports.jsx]"]
  node_staff_admin["Staff administration<br/>[Staff.jsx]"]
end

subgraph group_data["Firebase data access"]
  node_firebase_config["Firebase client config<br/>[config.js]"]
  node_patients_api["Patient data access<br/>[patients.js]"]
  node_wards_api["Ward data access<br/>[wards.js]"]
  node_admissions_api["Admission data access<br/>[admissions.js]"]
  node_payments_api["Payment data access<br/>[payments.js]"]
  node_housekeeping_api["Cleaning data access<br/>[housekeeping.js]"]
end

subgraph group_services["External services"]
  node_auth_service(("Firebase Authentication"))
  node_firestore[("Cloud Firestore")]
end

node_staff_user(("Hospital staff"))

node_staff_user -->|"uses"| node_app_routes
node_app_routes -->|"provides auth"| node_auth_context
node_app_routes -->|"routes through"| node_dashboard
node_app_routes -->|"routes to"| node_patient_records
node_app_routes -->|"routes to"| node_ward_inventory
node_app_routes -->|"routes to"| node_admissions
node_app_routes -->|"routes to"| node_admit_discharge
node_app_routes -->|"routes to"| node_payments
node_app_routes -->|"routes to"| node_housekeeping
node_app_routes -->|"routes to"| node_reports
node_app_routes -->|"routes to"| node_staff_admin
node_auth_context -->|"uses clients"| node_firebase_config
node_firebase_config -->|"initializes"| node_auth_service
node_firebase_config -->|"initializes"| node_firestore
node_auth_context -->|"authenticates"| node_auth_service
node_auth_context -->|"reads staff profile"| node_firestore
node_patient_records -->|"manages records"| node_patients_api
node_ward_inventory -->|"manages beds"| node_wards_api
node_admissions -->|"loads patients"| node_patients_api
node_admissions -->|"loads available beds"| node_wards_api
node_admissions -->|"books stays"| node_admissions_api
node_admit_discharge -->|"updates stay"| node_admissions_api
node_admit_discharge -->|"records payment"| node_payments_api
node_payments -->|"loads payments"| node_payments_api
node_housekeeping -->|"tracks cleaning"| node_housekeeping_api
node_housekeeping -->|"updates bed status"| node_wards_api
node_reports -->|"reads occupancy"| node_wards_api
node_reports -->|"reads admissions"| node_admissions_api
node_reports -->|"reads revenue"| node_payments_api
node_staff_admin -->|"manages staff roles"| node_firestore
node_patients_api -->|"reads and writes"| node_firestore
node_wards_api -->|"reads and writes"| node_firestore
node_admissions_api -->|"sets bed status"| node_wards_api
node_admissions_api -->|"reads and writes"| node_firestore
node_payments_api -->|"reads and writes"| node_firestore
node_housekeeping_api -->|"reads and writes"| node_firestore

click node_app_routes "https://github.com/ariyoola45/hospital-management/blob/main/app/src/App.jsx"
click node_auth_context "https://github.com/ariyoola45/hospital-management/blob/main/app/src/context/AuthContext.jsx"
click node_dashboard "https://github.com/ariyoola45/hospital-management/blob/main/app/src/layouts/DashboardLayout.jsx"
click node_patient_records "https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Patients.jsx"
click node_ward_inventory "https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Wards.jsx"
click node_admissions "https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Admissions.jsx"
click node_admit_discharge "https://github.com/ariyoola45/hospital-management/tree/main/app/src/pages"
click node_payments "https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Payments.jsx"
click node_housekeeping "https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Housekeeping.jsx"
click node_reports "https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Reports.jsx"
click node_staff_admin "https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Staff.jsx"
click node_firebase_config "https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/config.js"
click node_patients_api "https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/patients.js"
click node_wards_api "https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/wards.js"
click node_admissions_api "https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/admissions.js"
click node_payments_api "https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/payments.js"
click node_housekeeping_api "https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/housekeeping.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_app_routes,node_auth_context,node_dashboard toneBlue
class node_patient_records,node_ward_inventory,node_admissions,node_admit_discharge,node_payments,node_housekeeping,node_reports,node_staff_admin toneAmber
class node_firebase_config,node_patients_api,node_wards_api,node_admissions_api,node_payments_api,node_housekeeping_api toneMint
class node_auth_service,node_firestore toneRose
class node_staff_user toneIndigo
```

## Components

### Application and access

- [App routing](https://github.com/ariyoola45/hospital-management/blob/main/app/src/App.jsx): `app/src/App.jsx`
- [Role authentication](https://github.com/ariyoola45/hospital-management/blob/main/app/src/context/AuthContext.jsx): `app/src/context/AuthContext.jsx`
- [Dashboard shell](https://github.com/ariyoola45/hospital-management/blob/main/app/src/layouts/DashboardLayout.jsx): `app/src/layouts/DashboardLayout.jsx`

### Hospital operations

- [Patient records](https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Patients.jsx): `app/src/pages/Patients.jsx`
- [Ward and beds](https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Wards.jsx): `app/src/pages/Wards.jsx`
- [Admission booking](https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Admissions.jsx): `app/src/pages/Admissions.jsx`
- [Admit and discharge](https://github.com/ariyoola45/hospital-management/tree/main/app/src/pages): `app/src/pages`
- [Billing and payments](https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Payments.jsx): `app/src/pages/Payments.jsx`
- [Housekeeping tasks](https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Housekeeping.jsx): `app/src/pages/Housekeeping.jsx`
- [Operational reports](https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Reports.jsx): `app/src/pages/Reports.jsx`
- [Staff administration](https://github.com/ariyoola45/hospital-management/blob/main/app/src/pages/Staff.jsx): `app/src/pages/Staff.jsx`

### Firebase data access

- [Firebase client config](https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/config.js): `app/src/firebase/config.js`
- [Patient data access](https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/patients.js): `app/src/firebase/patients.js`
- [Ward data access](https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/wards.js): `app/src/firebase/wards.js`
- [Admission data access](https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/admissions.js): `app/src/firebase/admissions.js`
- [Payment data access](https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/payments.js): `app/src/firebase/payments.js`
- [Cleaning data access](https://github.com/ariyoola45/hospital-management/blob/main/app/src/firebase/housekeeping.js): `app/src/firebase/housekeeping.js`

### External services

- **Firebase Authentication**
- **Cloud Firestore**

### Other components

- **Hospital staff**

## Connections

- Hospital staff → App routing: uses (evidence: `README.md`)
- App routing → Role authentication: provides auth (evidence: `app/src/App.jsx`)
- App routing → Dashboard shell: routes through (evidence: `app/src/App.jsx`)
- App routing → Patient records: routes to (evidence: `app/src/App.jsx`)
- App routing → Ward and beds: routes to (evidence: `app/src/App.jsx`)
- App routing → Admission booking: routes to (evidence: `app/src/App.jsx`)
- App routing → Admit and discharge: routes to (evidence: `app/src/App.jsx`)
- App routing → Billing and payments: routes to (evidence: `app/src/App.jsx`)
- App routing → Housekeeping tasks: routes to (evidence: `app/src/App.jsx`)
- App routing → Operational reports: routes to (evidence: `app/src/App.jsx`)
- App routing → Staff administration: routes to (evidence: `app/src/App.jsx`)
- Role authentication → Firebase client config: uses clients (evidence: `app/src/context/AuthContext.jsx`)
- Firebase client config → Firebase Authentication: initializes (evidence: `app/src/firebase/config.js`)
- Firebase client config → Cloud Firestore: initializes (evidence: `app/src/firebase/config.js`)
- Role authentication → Firebase Authentication: authenticates (evidence: `app/src/context/AuthContext.jsx`)
- Role authentication → Cloud Firestore: reads staff profile (evidence: `app/src/context/AuthContext.jsx`)
- Patient records → Patient data access: manages records (evidence: `app/src/pages/Patients.jsx`)
- Ward and beds → Ward data access: manages beds (evidence: `app/src/pages/Wards.jsx`)
- Admission booking → Patient data access: loads patients (evidence: `app/src/pages/Admissions.jsx`)
- Admission booking → Ward data access: loads available beds (evidence: `app/src/pages/Admissions.jsx`)
- Admission booking → Admission data access: books stays (evidence: `app/src/pages/Admissions.jsx`)
- Admit and discharge → Admission data access: updates stay (evidence: `app/src/pages/Admit.jsx`)
- Admit and discharge → Payment data access: records payment (evidence: `app/src/pages/Discharge.jsx`)
- Billing and payments → Payment data access: loads payments (evidence: `app/src/pages/Payments.jsx`)
- Housekeeping tasks → Cleaning data access: tracks cleaning (evidence: `app/src/pages/Housekeeping.jsx`)
- Housekeeping tasks → Ward data access: updates bed status (evidence: `app/src/pages/Housekeeping.jsx`)
- Operational reports → Ward data access: reads occupancy (evidence: `app/src/pages/Reports.jsx`)
- Operational reports → Admission data access: reads admissions (evidence: `app/src/pages/Reports.jsx`)
- Operational reports → Payment data access: reads revenue (evidence: `app/src/pages/Reports.jsx`)
- Staff administration → Cloud Firestore: manages staff roles (evidence: `README.md`)
- Patient data access → Cloud Firestore: reads and writes (evidence: `README.md`)
- Ward data access → Cloud Firestore: reads and writes (evidence: `README.md`)
- Admission data access → Ward data access: sets bed status (evidence: `app/src/firebase/admissions.js`)
- Admission data access → Cloud Firestore: reads and writes (evidence: `README.md`)
- Payment data access → Cloud Firestore: reads and writes (evidence: `README.md`)
- Cleaning data access → Cloud Firestore: reads and writes (evidence: `README.md`)
