# talayansaksham/sehat_setu_app architecture

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

- Interactive diagram: https://gitdiagram.com/talayansaksham/sehat_setu_app
- Repository: https://github.com/talayansaksham/sehat_setu_app

## Overview

SehatSetu is a React doctor dashboard for monitoring a rural-care patient queue and managing individual patient visits. The main workflow refreshes the queue, highlights new and critical arrivals, and lets a doctor open a patient record to review clinical and language details, contact the patient, view prescription history, and issue a prescription. The README also describes Gemini-powered summaries and audio alerts; the sampled code shows alert behavior but not the summary-generation implementation. Backend services are external; links reflect documented endpoints and sampled API calls.

Main entry points: [`src/App.jsx`](https://github.com/talayansaksham/sehat_setu_app/blob/main/src/App.jsx) (Dashboard Orchestrator), [`src/api.js`](https://github.com/talayansaksham/sehat_setu_app/blob/main/src/api.js) (API Client), [`src/components/PatientDetail.jsx`](https://github.com/talayansaksham/sehat_setu_app/blob/main/src/components/PatientDetail.jsx) (Patient Detail), [`src/components/PatientCard.jsx`](https://github.com/talayansaksham/sehat_setu_app/blob/main/src/components/PatientCard.jsx) (Patient Queue Card)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Queue Dashboard"]
  node_app["Dashboard Orchestrator<br/>[App.jsx]"]
  node_card["Patient Queue Card<br/>[PatientCard.jsx]"]
  node_stats["Queue Statistics<br/>[StatsBar.jsx]"]
  node_status["API Status Check<br/>[StatusDot.jsx]"]
end

subgraph group_patient["Patient Review"]
  node_detail["Patient Detail<br/>[PatientDetail.jsx]"]
end

subgraph group_integration["API Integration"]
  node_api["API Client<br/>[api.js]"]
end

subgraph group_logic["Presentation Logic"]
  node_triage["Triage Display Helpers<br/>[triage.js]"]
end

node_doctor(("Doctor"))
node_backend["Healthcare Backend"]
node_audio["Browser Audio"]
node_dialer["Device Communication Apps"]

node_doctor -->|"uses"| node_app
node_app -->|"fetches queue"| node_api
node_api -->|"requests patient data"| node_backend
node_backend -->|"returns patient data"| node_api
node_app -->|"renders queue"| node_card
node_app -->|"passes patients"| node_stats
node_app -->|"opens selected patient"| node_detail
node_app -->|"renders status"| node_status
node_app -->|"plays critical alert"| node_audio
node_card -->|"formats priority and time"| node_triage
node_detail -->|"formats clinical details"| node_triage
node_detail -->|"loads prescription history"| node_api
node_detail -->|"submits prescription"| node_api
node_api -->|"reads or writes prescriptions"| node_backend
node_status -->|"checks connectivity"| node_api
node_detail -.->|"launches contact action"| node_dialer

click node_app "https://github.com/talayansaksham/sehat_setu_app/blob/main/src/App.jsx"
click node_card "https://github.com/talayansaksham/sehat_setu_app/blob/main/src/components/PatientCard.jsx"
click node_stats "https://github.com/talayansaksham/sehat_setu_app/blob/main/src/components/StatsBar.jsx"
click node_status "https://github.com/talayansaksham/sehat_setu_app/blob/main/src/components/StatusDot.jsx"
click node_detail "https://github.com/talayansaksham/sehat_setu_app/blob/main/src/components/PatientDetail.jsx"
click node_api "https://github.com/talayansaksham/sehat_setu_app/blob/main/src/api.js"
click node_triage "https://github.com/talayansaksham/sehat_setu_app/blob/main/src/utils/triage.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,node_card,node_stats,node_status,node_audio toneBlue
class node_detail toneAmber
class node_api toneMint
class node_triage toneRose
class node_doctor,node_backend,node_dialer toneIndigo
```

## Components

### Queue Dashboard

- [Dashboard Orchestrator](https://github.com/talayansaksham/sehat_setu_app/blob/main/src/App.jsx): `src/App.jsx`
- [Patient Queue Card](https://github.com/talayansaksham/sehat_setu_app/blob/main/src/components/PatientCard.jsx): `src/components/PatientCard.jsx`
- [Queue Statistics](https://github.com/talayansaksham/sehat_setu_app/blob/main/src/components/StatsBar.jsx): `src/components/StatsBar.jsx`
- [API Status Check](https://github.com/talayansaksham/sehat_setu_app/blob/main/src/components/StatusDot.jsx): `src/components/StatusDot.jsx`

### Patient Review

- [Patient Detail](https://github.com/talayansaksham/sehat_setu_app/blob/main/src/components/PatientDetail.jsx): `src/components/PatientDetail.jsx`

### API Integration

- [API Client](https://github.com/talayansaksham/sehat_setu_app/blob/main/src/api.js): `src/api.js`

### Presentation Logic

- [Triage Display Helpers](https://github.com/talayansaksham/sehat_setu_app/blob/main/src/utils/triage.js): `src/utils/triage.js`

### Other components

- **Doctor**
- **Healthcare Backend**
- **Browser Audio**
- **Device Communication Apps**

## Connections

- Doctor → Dashboard Orchestrator: uses
- Dashboard Orchestrator → API Client: fetches queue
- API Client → Healthcare Backend: requests patient data
- Healthcare Backend → API Client: returns patient data
- Dashboard Orchestrator → Patient Queue Card: renders queue
- Dashboard Orchestrator → Queue Statistics: passes patients
- Dashboard Orchestrator → Patient Detail: opens selected patient
- Dashboard Orchestrator → API Status Check: renders status
- Dashboard Orchestrator → Browser Audio: plays critical alert
- Patient Queue Card → Triage Display Helpers: formats priority and time
- Patient Detail → Triage Display Helpers: formats clinical details
- Patient Detail → API Client: loads prescription history
- Patient Detail → API Client: submits prescription
- API Client → Healthcare Backend: reads or writes prescriptions
- API Status Check → API Client: checks connectivity
- Patient Detail → Device Communication Apps: launches contact action
