# bhargavbhat18/vital-java architecture

> Architecture diagram of the GitHub repository bhargavbhat18/vital-java, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhargavbhat18/vital-java
- Repository: https://github.com/bhargavbhat18/vital-java

## Overview

VitalGuard is a real-time health-monitoring and emergency-response platform, with patient/family and healthcare-facing clients backed by a Spring Boot service. The documented core workflow ingests patient vitals and coordinates, assesses risk, and, for critical cases, routes to hospital resources, dispatches an ambulance, and broadcasts tracking and family updates. The graph includes the documented web clients and backend capabilities; the README supplies most cross-system evidence, while sampled source confirms selected authentication, notification, and ambulance behavior. Several client and backend subsystems are represented by their exact enclosing directories because their implementation files were not sampled.

Main entry points: [`backend-java/src/main/java/com/vitaguard/backend_java/config/WebSocketConfig.java`](https://github.com/bhargavbhat18/vital-java/blob/main/backend-java/src/main/java/com/vitaguard/backend_java/config/WebSocketConfig.java) (WebSocket broker), [`backend-java/src/main/java/com/vitaguard/backend_java/emergency/EmergencyService.java`](https://github.com/bhargavbhat18/vital-java/blob/main/backend-java/src/main/java/com/vitaguard/backend_java/emergency/EmergencyService.java) (Emergency workflow), [`frontend/src/App.jsx`](https://github.com/bhargavbhat18/vital-java/blob/main/frontend/src/App.jsx) (Web application), [`backend-java/src/main/java/com/vitaguard/backend_java/medical`](https://github.com/bhargavbhat18/vital-java/tree/main/backend-java/src/main/java/com/vitaguard/backend_java/medical) (Risk assessment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Patient and operations clients"]
  node_web_app["Web application<br/>[App.jsx]"]
  node_user_dashboard["Patient dashboard<br/>[UserDashboard.jsx]"]
  node_care_dashboard["Healthcare dashboard"]
  node_patient_android["Patient Android app"]
  node_care_android["Healthcare Android app"]
  node_map["Live map<br/>[MapComponent.jsx]"]
end

subgraph group_identity["Identity and health assessment"]
  node_auth["Authentication<br/>[AuthService.java]"]
  node_risk["Risk assessment"]
  node_telemetry["Vitals ingestion"]
end

subgraph group_response["Emergency response"]
  node_emergency["Emergency workflow"]
  node_hospital["Hospital routing"]
  node_ambulance["Ambulance dispatch"]
  node_family_notify["Family notifications"]
end

subgraph group_platform["Realtime and persistence"]
  node_websocket["WebSocket broker"]
  node_database[("MySQL database")]
end

node_patient(("Patient / family"))
node_care_staff(("Care staff"))

node_patient -->|"uses"| node_user_dashboard
node_care_staff -->|"uses"| node_care_dashboard
node_web_app -->|"routes to"| node_user_dashboard
node_web_app -->|"routes to"| node_care_dashboard
node_patient -->|"sends vitals"| node_telemetry
node_telemetry -->|"assesses"| node_risk
node_risk -->|"stores critical events"| node_database
node_risk -->|"triggers critical response"| node_emergency
node_emergency -->|"routes to capability"| node_hospital
node_emergency -->|"dispatches"| node_ambulance
node_emergency -.->|"initiates alerts"| node_family_notify
node_family_notify -->|"broadcasts"| node_websocket
node_ambulance -->|"streams updates"| node_websocket
node_websocket -->|"sends tracking"| node_patient
node_websocket -->|"sends case updates"| node_care_staff
node_websocket -->|"updates coordinates"| node_map
node_patient_android -.->|"authenticates"| node_auth
node_care_android -.->|"authenticates"| node_auth
node_web_app -.->|"authenticates"| node_auth

click node_web_app "https://github.com/bhargavbhat18/vital-java/blob/main/frontend/src/App.jsx"
click node_user_dashboard "https://github.com/bhargavbhat18/vital-java/blob/main/frontend/src/pages/UserDashboard.jsx"
click node_care_dashboard "https://github.com/bhargavbhat18/vital-java/blob/main/frontend/src/pages/HealthcareDashboard.jsx"
click node_patient_android "https://github.com/bhargavbhat18/vital-java/tree/main/android_apps/patient_app/app/src/main/java/com/vitaguard/patient_app"
click node_care_android "https://github.com/bhargavbhat18/vital-java/tree/main/android_apps/healthcare_app/app/src/main/java/com/vitaguard/healthcare_app"
click node_auth "https://github.com/bhargavbhat18/vital-java/blob/main/backend-java/src/main/java/com/vitaguard/backend_java/auth/AuthService.java"
click node_risk "https://github.com/bhargavbhat18/vital-java/tree/main/backend-java/src/main/java/com/vitaguard/backend_java/medical"
click node_telemetry "https://github.com/bhargavbhat18/vital-java/tree/main/backend-java/src/main/java/com/vitaguard/backend_java/user"
click node_emergency "https://github.com/bhargavbhat18/vital-java/blob/main/backend-java/src/main/java/com/vitaguard/backend_java/emergency/EmergencyService.java"
click node_hospital "https://github.com/bhargavbhat18/vital-java/tree/main/backend-java/src/main/java/com/vitaguard/backend_java/hospital"
click node_ambulance "https://github.com/bhargavbhat18/vital-java/blob/main/backend-java/src/main/java/com/vitaguard/backend_java/ambulance/AmbulanceService.java"
click node_family_notify "https://github.com/bhargavbhat18/vital-java/blob/main/backend-java/src/main/java/com/vitaguard/backend_java/user/FamilyNotificationService.java"
click node_websocket "https://github.com/bhargavbhat18/vital-java/blob/main/backend-java/src/main/java/com/vitaguard/backend_java/config/WebSocketConfig.java"
click node_map "https://github.com/bhargavbhat18/vital-java/blob/main/frontend/src/components/MapComponent.jsx"

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_web_app,node_user_dashboard,node_care_dashboard,node_patient_android,node_care_android,node_map toneBlue
class node_auth,node_risk,node_telemetry toneAmber
class node_emergency,node_hospital,node_ambulance,node_family_notify toneMint
class node_websocket,node_database toneRose
class node_patient,node_care_staff toneIndigo
```

## Components

### Patient and operations clients

- [Web application](https://github.com/bhargavbhat18/vital-java/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Patient dashboard](https://github.com/bhargavbhat18/vital-java/blob/main/frontend/src/pages/UserDashboard.jsx): `frontend/src/pages/UserDashboard.jsx`
- [Healthcare dashboard](https://github.com/bhargavbhat18/vital-java/blob/main/frontend/src/pages/HealthcareDashboard.jsx): `frontend/src/pages/HealthcareDashboard.jsx`
- [Patient Android app](https://github.com/bhargavbhat18/vital-java/tree/main/android_apps/patient_app/app/src/main/java/com/vitaguard/patient_app): `android_apps/patient_app/app/src/main/java/com/vitaguard/patient_app`
- [Healthcare Android app](https://github.com/bhargavbhat18/vital-java/tree/main/android_apps/healthcare_app/app/src/main/java/com/vitaguard/healthcare_app): `android_apps/healthcare_app/app/src/main/java/com/vitaguard/healthcare_app`
- [Live map](https://github.com/bhargavbhat18/vital-java/blob/main/frontend/src/components/MapComponent.jsx): `frontend/src/components/MapComponent.jsx`

### Identity and health assessment

- [Authentication](https://github.com/bhargavbhat18/vital-java/blob/main/backend-java/src/main/java/com/vitaguard/backend_java/auth/AuthService.java): `backend-java/src/main/java/com/vitaguard/backend_java/auth/AuthService.java`
- [Risk assessment](https://github.com/bhargavbhat18/vital-java/tree/main/backend-java/src/main/java/com/vitaguard/backend_java/medical): `backend-java/src/main/java/com/vitaguard/backend_java/medical`
- [Vitals ingestion](https://github.com/bhargavbhat18/vital-java/tree/main/backend-java/src/main/java/com/vitaguard/backend_java/user): `backend-java/src/main/java/com/vitaguard/backend_java/user`

### Emergency response

- [Emergency workflow](https://github.com/bhargavbhat18/vital-java/blob/main/backend-java/src/main/java/com/vitaguard/backend_java/emergency/EmergencyService.java): `backend-java/src/main/java/com/vitaguard/backend_java/emergency/EmergencyService.java`
- [Hospital routing](https://github.com/bhargavbhat18/vital-java/tree/main/backend-java/src/main/java/com/vitaguard/backend_java/hospital): `backend-java/src/main/java/com/vitaguard/backend_java/hospital`
- [Ambulance dispatch](https://github.com/bhargavbhat18/vital-java/blob/main/backend-java/src/main/java/com/vitaguard/backend_java/ambulance/AmbulanceService.java): `backend-java/src/main/java/com/vitaguard/backend_java/ambulance/AmbulanceService.java`
- [Family notifications](https://github.com/bhargavbhat18/vital-java/blob/main/backend-java/src/main/java/com/vitaguard/backend_java/user/FamilyNotificationService.java): `backend-java/src/main/java/com/vitaguard/backend_java/user/FamilyNotificationService.java`

### Realtime and persistence

- [WebSocket broker](https://github.com/bhargavbhat18/vital-java/blob/main/backend-java/src/main/java/com/vitaguard/backend_java/config/WebSocketConfig.java): `backend-java/src/main/java/com/vitaguard/backend_java/config/WebSocketConfig.java`
- **MySQL database**

### Other components

- **Patient / family**
- **Care staff**

## Connections

- Patient / family → Patient dashboard: uses (evidence: `README.md`)
- Care staff → Healthcare dashboard: uses (evidence: `README.md`)
- Web application → Patient dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Web application → Healthcare dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Patient / family → Vitals ingestion: sends vitals (evidence: `README.md`)
- Vitals ingestion → Risk assessment: assesses (evidence: `README.md`)
- Risk assessment → MySQL database: stores critical events (evidence: `README.md`)
- Risk assessment → Emergency workflow: triggers critical response (evidence: `README.md`)
- Emergency workflow → Hospital routing: routes to capability (evidence: `README.md`)
- Emergency workflow → Ambulance dispatch: dispatches (evidence: `README.md`)
- Emergency workflow → Family notifications: initiates alerts
- Family notifications → WebSocket broker: broadcasts (evidence: `backend-java/src/main/java/com/vitaguard/backend_java/user/FamilyNotificationService.java`)
- Ambulance dispatch → WebSocket broker: streams updates (evidence: `README.md`)
- WebSocket broker → Patient / family: sends tracking (evidence: `README.md`)
- WebSocket broker → Care staff: sends case updates (evidence: `README.md`)
- WebSocket broker → Live map: updates coordinates (evidence: `README.md`)
- Patient Android app → Authentication: authenticates
- Healthcare Android app → Authentication: authenticates
- Web application → Authentication: authenticates
