# saurabh-bhatia-official/26_11_3_hms architecture

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

- Interactive diagram: https://gitdiagram.com/saurabh-bhatia-official/26_11_3_hms
- Repository: https://github.com/saurabh-bhatia-official/26_11_3_hms

## Overview

CareSync is an offline-capable hospital-management system: staff use a cross-platform Flutter application for hospital workflows, with local SQLite storage; a separate Spring Boot backend is also included. The README documents patient, appointment, OPD/IPD, pharmacy, billing, beds, security, audit, and multi-hospital capabilities. Source excerpts chiefly cover native desktop launchers, so feature-level wiring and frontend-to-backend calls are not established; those connections are omitted. Backend implementation beyond its application entry point is not shown.

Main entry points: [`frontend/lib/data/database/app_database.dart`](https://github.com/saurabh-bhatia-official/26_11_3_hms/blob/main/frontend/lib/data/database/app_database.dart) (SQLite database), [`frontend/lib/app.dart`](https://github.com/saurabh-bhatia-official/26_11_3_hms/blob/main/frontend/lib/app.dart) (CareSync app), [`frontend/windows/runner`](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/windows/runner) (Desktop hosts), [`frontend/lib/features/patients`](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/patients) (Patient care)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Flutter application"]
  node_flutter["CareSync app<br/>[app.dart]"]
  node_entry["App entry<br/>[main.dart]"]
  node_desktop["Desktop hosts"]
end

subgraph group_care["Care workflows"]
  node_patients["Patient care"]
  node_visits["OPD and IPD"]
  node_appointments["Appointments"]
  node_beds["Beds and wards"]
  node_pharmacy["Pharmacy"]
  node_billing["Billing"]
  node_labs["Laboratory"]
  node_reports["Reports"]
  node_hospitals["Hospital management"]
  node_staffmgmt["Staff management"]
  node_auth["Access and security"]
  node_audit["Audit logs"]
end

subgraph group_data["Local data"]
  node_database[("SQLite database<br/>[app_database.dart]")]
end

subgraph group_server["Backend service"]
  node_backend["Spring Boot service"]
end

node_staff(("Hospital staff"))

node_staff -->|"uses"| node_flutter
node_flutter -->|"uses offline storage"| node_database
node_desktop -->|"hosts Flutter"| node_flutter
node_patients -.->|"stores locally"| node_database
node_visits -.->|"stores locally"| node_database
node_appointments -.->|"stores locally"| node_database
node_beds -.->|"stores locally"| node_database
node_pharmacy -.->|"stores locally"| node_database
node_billing -.->|"stores locally"| node_database

click node_flutter "https://github.com/saurabh-bhatia-official/26_11_3_hms/blob/main/frontend/lib/app.dart"
click node_entry "https://github.com/saurabh-bhatia-official/26_11_3_hms/blob/main/frontend/lib/main.dart"
click node_desktop "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/windows/runner"
click node_patients "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/patients"
click node_visits "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/opd"
click node_appointments "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/appointments"
click node_beds "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/beds"
click node_pharmacy "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/pharmacy"
click node_billing "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/billing"
click node_labs "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/lab"
click node_reports "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/reports"
click node_hospitals "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/hospitals"
click node_staffmgmt "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/staff"
click node_auth "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/auth"
click node_audit "https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/audit"
click node_database "https://github.com/saurabh-bhatia-official/26_11_3_hms/blob/main/frontend/lib/data/database/app_database.dart"
click node_backend "https://github.com/saurabh-bhatia-official/26_11_3_hms/blob/main/backend/src/main/java/com/caresync/backend/CaresyncBackendApplication.java"

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_flutter,node_entry,node_desktop toneBlue
class node_patients,node_visits,node_appointments,node_beds,node_pharmacy,node_billing,node_labs,node_reports,node_hospitals,node_staffmgmt,node_auth,node_audit toneAmber
class node_database toneMint
class node_backend toneRose
class node_staff toneIndigo
```

## Components

### Flutter application

- [CareSync app](https://github.com/saurabh-bhatia-official/26_11_3_hms/blob/main/frontend/lib/app.dart): `frontend/lib/app.dart`
- [App entry](https://github.com/saurabh-bhatia-official/26_11_3_hms/blob/main/frontend/lib/main.dart): `frontend/lib/main.dart`
- [Desktop hosts](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/windows/runner): `frontend/windows/runner`

### Care workflows

- [Patient care](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/patients): `frontend/lib/features/patients`
- [OPD and IPD](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/opd): `frontend/lib/features/opd`
- [Appointments](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/appointments): `frontend/lib/features/appointments`
- [Beds and wards](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/beds): `frontend/lib/features/beds`
- [Pharmacy](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/pharmacy): `frontend/lib/features/pharmacy`
- [Billing](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/billing): `frontend/lib/features/billing`
- [Laboratory](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/lab): `frontend/lib/features/lab`
- [Reports](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/reports): `frontend/lib/features/reports`
- [Hospital management](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/hospitals): `frontend/lib/features/hospitals`
- [Staff management](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/staff): `frontend/lib/features/staff`
- [Access and security](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/auth): `frontend/lib/features/auth`
- [Audit logs](https://github.com/saurabh-bhatia-official/26_11_3_hms/tree/main/frontend/lib/features/audit): `frontend/lib/features/audit`

### Local data

- [SQLite database](https://github.com/saurabh-bhatia-official/26_11_3_hms/blob/main/frontend/lib/data/database/app_database.dart): `frontend/lib/data/database/app_database.dart`

### Backend service

- [Spring Boot service](https://github.com/saurabh-bhatia-official/26_11_3_hms/blob/main/backend/src/main/java/com/caresync/backend/CaresyncBackendApplication.java): `backend/src/main/java/com/caresync/backend/CaresyncBackendApplication.java`

### Other components

- **Hospital staff**

## Connections

- Hospital staff → CareSync app: uses (evidence: `README.md`)
- CareSync app → SQLite database: uses offline storage (evidence: `README.md`)
- Desktop hosts → CareSync app: hosts Flutter (evidence: `frontend/windows/runner/flutter_window.h`)
- Patient care → SQLite database: stores locally
- OPD and IPD → SQLite database: stores locally
- Appointments → SQLite database: stores locally
- Beds and wards → SQLite database: stores locally
- Pharmacy → SQLite database: stores locally
- Billing → SQLite database: stores locally
