# 1at24cs054-rgb/smarthealth_360 architecture

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

- Interactive diagram: https://gitdiagram.com/1at24cs054-rgb/smarthealth_360
- Repository: https://github.com/1at24cs054-rgb/smarthealth_360

## Overview

SmartHealth 360 is a React healthcare-management simulation. Users enter a shared health dashboard, navigate reports, prescriptions, doctors, wellness, and history, and can ask the AI Companion for health guidance that may change the active section. The shared context holds the user’s health state and implements simulated report analysis and chat behavior; sample records supply initial and reference data. README-described OCR, medication safety, emergency, and refill capabilities are represented as product features, not verified external services. Source excerpts are partial, so uncertain internal connections are omitted.

Main entry points: [`src/App.jsx`](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/App.jsx) (App router), [`src/context/HealthContext.jsx`](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/context/HealthContext.jsx) (Health context), [`src/main.jsx`](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/main.jsx) (React entry), [`src/pages/Doctors.jsx`](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/Doctors.jsx) (Doctor network)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_entry["React entry<br/>[main.jsx]"]
  node_shell["App router<br/>[App.jsx]"]
  node_navigation["Sidebar navigation<br/>[Sidebar.jsx]"]
  node_companion["AI Companion<br/>[AICompanion.jsx]"]
end

subgraph group_health["Health state"]
  node_state["Health context<br/>[HealthContext.jsx]"]
end

subgraph group_care["Care workflows"]
  node_dashboard["Health dashboard<br/>[Dashboard.jsx]"]
  node_reports["Report synthesis<br/>[Reports.jsx]"]
  node_prescriptions["Prescription records<br/>[Prescriptions.jsx]"]
  node_doctors["Doctor network<br/>[Doctors.jsx]"]
  node_wellness["Wellness plans<br/>[Wellness.jsx]"]
  node_history["Health history<br/>[History.jsx]"]
end

subgraph group_reference["Reference data"]
  node_data["Mock health data<br/>[mockData.js]"]
end

node_user(("User"))

node_user -->|"opens app"| node_entry
node_entry -->|"provides state"| node_state
node_entry -->|"renders"| node_shell
node_shell -->|"renders"| node_navigation
node_shell -->|"renders"| node_companion
node_shell -->|"routes to"| node_dashboard
node_shell -->|"routes to"| node_reports
node_shell -->|"routes to"| node_prescriptions
node_shell -->|"routes to"| node_doctors
node_shell -->|"routes to"| node_wellness
node_shell -->|"routes to"| node_history
node_navigation -->|"updates page"| node_state
node_companion -->|"sends messages"| node_state
node_state -->|"initializes from"| node_data
node_dashboard -->|"reads health state"| node_state
node_reports -->|"uses report state"| node_state
node_prescriptions -->|"manages prescriptions"| node_state
node_doctors -->|"books appointments"| node_state
node_doctors -->|"reads listings"| node_data
node_wellness -->|"reads wellness state"| node_state
node_wellness -->|"reads remedies"| node_data
node_history -->|"reads history"| node_state

click node_entry "https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/main.jsx"
click node_shell "https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/App.jsx"
click node_navigation "https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/components/Sidebar.jsx"
click node_companion "https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/components/AICompanion.jsx"
click node_state "https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/context/HealthContext.jsx"
click node_data "https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/data/mockData.js"
click node_dashboard "https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/Dashboard.jsx"
click node_reports "https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/Reports.jsx"
click node_prescriptions "https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/Prescriptions.jsx"
click node_doctors "https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/Doctors.jsx"
click node_wellness "https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/Wellness.jsx"
click node_history "https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/History.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_entry,node_shell,node_navigation,node_companion,node_user toneBlue
class node_state toneAmber
class node_dashboard,node_reports,node_prescriptions,node_doctors,node_wellness,node_history toneMint
class node_data toneRose
```

## Components

### Application shell

- [React entry](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/main.jsx): `src/main.jsx`
- [App router](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/App.jsx): `src/App.jsx`
- [Sidebar navigation](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/components/Sidebar.jsx): `src/components/Sidebar.jsx`
- [AI Companion](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/components/AICompanion.jsx): `src/components/AICompanion.jsx`

### Health state

- [Health context](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/context/HealthContext.jsx): `src/context/HealthContext.jsx`

### Care workflows

- [Health dashboard](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Report synthesis](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/Reports.jsx): `src/pages/Reports.jsx`
- [Prescription records](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/Prescriptions.jsx): `src/pages/Prescriptions.jsx`
- [Doctor network](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/Doctors.jsx): `src/pages/Doctors.jsx`
- [Wellness plans](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/Wellness.jsx): `src/pages/Wellness.jsx`
- [Health history](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/pages/History.jsx): `src/pages/History.jsx`

### Reference data

- [Mock health data](https://github.com/1at24cs054-rgb/smarthealth_360/blob/main/src/data/mockData.js): `src/data/mockData.js`

### Other components

- **User**

## Connections

- User → React entry: opens app (evidence: `README.md`)
- React entry → Health context: provides state (evidence: `src/main.jsx`)
- React entry → App router: renders (evidence: `src/main.jsx`)
- App router → Sidebar navigation: renders (evidence: `src/App.jsx`)
- App router → AI Companion: renders (evidence: `src/App.jsx`)
- App router → Health dashboard: routes to (evidence: `src/App.jsx`)
- App router → Report synthesis: routes to (evidence: `src/App.jsx`)
- App router → Prescription records: routes to (evidence: `src/App.jsx`)
- App router → Doctor network: routes to (evidence: `src/App.jsx`)
- App router → Wellness plans: routes to (evidence: `src/App.jsx`)
- App router → Health history: routes to (evidence: `src/App.jsx`)
- Sidebar navigation → Health context: updates page (evidence: `src/components/Sidebar.jsx`)
- AI Companion → Health context: sends messages (evidence: `src/components/AICompanion.jsx`)
- Health context → Mock health data: initializes from (evidence: `src/context/HealthContext.jsx`)
- Health dashboard → Health context: reads health state (evidence: `src/pages/Dashboard.jsx`)
- Report synthesis → Health context: uses report state (evidence: `src/pages/Reports.jsx`)
- Prescription records → Health context: manages prescriptions (evidence: `src/pages/Prescriptions.jsx`)
- Doctor network → Health context: books appointments (evidence: `src/pages/Doctors.jsx`)
- Doctor network → Mock health data: reads listings (evidence: `src/pages/Doctors.jsx`)
- Wellness plans → Health context: reads wellness state (evidence: `src/pages/Wellness.jsx`)
- Wellness plans → Mock health data: reads remedies (evidence: `src/pages/Wellness.jsx`)
- Health history → Health context: reads history (evidence: `src/pages/History.jsx`)
