# roshan2828/hospital-management-system architecture

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

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

## Overview

This is a terminal-based hospital management system. The user opens the menu and selects a dashboard or a patient, doctor, appointment, medical-record, or demo-data workflow; the application validates input, executes SQLite operations, and displays results in the terminal. The dashboard combines counts, appointment status, today’s schedule, doctor workload, and recent registrations. The excerpts show the application and database setup, but omit portions of the CRUD and demo-data implementations, so those feature relationships are documented by the README rather than inferred from unseen calls.

Main entry points: [`src/main.c`](https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c) (Terminal application), [`sql/schema.sql`](https://github.com/roshan2828/hospital-management-system/blob/main/sql/schema.sql) (Hospital database), [`sql/sample_data.sql`](https://github.com/roshan2828/hospital-management-system/blob/main/sql/sample_data.sql) (Demo dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Hospital application"]
  node_app["Terminal application<br/>[main.c]"]
  node_input["Input validation<br/>[main.c]"]
  node_dashboard["Dashboard<br/>[main.c]"]
  node_patients["Patient management<br/>[main.c]"]
  node_doctors["Doctor management<br/>[main.c]"]
  node_appointments["Appointment scheduling<br/>[main.c]"]
  node_records["Medical records<br/>[main.c]"]
  node_demo["Demo data loader<br/>[main.c]"]
end

subgraph group_data["SQLite data"]
  node_db[("Hospital database<br/>[schema.sql]")]
  node_sample["Demo dataset<br/>[sample_data.sql]"]
end

node_user(("Hospital staff"))

node_user -->|"selects workflow"| node_app
node_app -->|"validates input"| node_input
node_app -->|"dispatches"| node_dashboard
node_app -->|"dispatches"| node_patients
node_app -->|"dispatches"| node_doctors
node_app -->|"dispatches"| node_appointments
node_app -->|"dispatches"| node_records
node_app -->|"dispatches"| node_demo
node_app -->|"opens and initializes"| node_db
node_dashboard -->|"queries"| node_db
node_patients -.->|"reads and writes"| node_db
node_doctors -.->|"reads and writes"| node_db
node_appointments -.->|"reads and writes"| node_db
node_records -.->|"reads and writes"| node_db
node_demo -.->|"loads"| node_sample
node_demo -.->|"imports data"| node_db

click node_app "https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c"
click node_input "https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c"
click node_dashboard "https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c"
click node_patients "https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c"
click node_doctors "https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c"
click node_appointments "https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c"
click node_records "https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c"
click node_demo "https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c"
click node_db "https://github.com/roshan2828/hospital-management-system/blob/main/sql/schema.sql"
click node_sample "https://github.com/roshan2828/hospital-management-system/blob/main/sql/sample_data.sql"

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,node_input,node_dashboard,node_patients,node_doctors,node_appointments,node_records,node_demo toneBlue
class node_db,node_sample toneAmber
class node_user toneIndigo
```

## Components

### Hospital application

- [Terminal application](https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c): `src/main.c`
- [Input validation](https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c): `src/main.c`
- [Dashboard](https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c): `src/main.c`
- [Patient management](https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c): `src/main.c`
- [Doctor management](https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c): `src/main.c`
- [Appointment scheduling](https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c): `src/main.c`
- [Medical records](https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c): `src/main.c`
- [Demo data loader](https://github.com/roshan2828/hospital-management-system/blob/main/src/main.c): `src/main.c`

### SQLite data

- [Hospital database](https://github.com/roshan2828/hospital-management-system/blob/main/sql/schema.sql): `sql/schema.sql`
- [Demo dataset](https://github.com/roshan2828/hospital-management-system/blob/main/sql/sample_data.sql): `sql/sample_data.sql`

### Other components

- **Hospital staff**

## Connections

- Hospital staff → Terminal application: selects workflow (evidence: `src/main.c`)
- Terminal application → Input validation: validates input (evidence: `src/main.c`)
- Terminal application → Dashboard: dispatches (evidence: `src/main.c`)
- Terminal application → Patient management: dispatches (evidence: `src/main.c`)
- Terminal application → Doctor management: dispatches (evidence: `src/main.c`)
- Terminal application → Appointment scheduling: dispatches (evidence: `src/main.c`)
- Terminal application → Medical records: dispatches (evidence: `src/main.c`)
- Terminal application → Demo data loader: dispatches (evidence: `src/main.c`)
- Terminal application → Hospital database: opens and initializes (evidence: `src/main.c`)
- Dashboard → Hospital database: queries (evidence: `src/main.c`)
- Patient management → Hospital database: reads and writes (evidence: `README.md`)
- Doctor management → Hospital database: reads and writes (evidence: `README.md`)
- Appointment scheduling → Hospital database: reads and writes (evidence: `README.md`)
- Medical records → Hospital database: reads and writes (evidence: `README.md`)
- Demo data loader → Demo dataset: loads (evidence: `README.md`)
- Demo data loader → Hospital database: imports data (evidence: `README.md`)
