# hima121k/health-care-summary architecture

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

- Interactive diagram: https://gitdiagram.com/hima121k/health-care-summary
- Repository: https://github.com/hima121k/health-care-summary

## Overview

Dynamic Intake Co-Pilot is implemented as a React client backed by a FastAPI service. Patients register or log in, chat with an AI intake assistant, and submit a generated SOAP note as a draft; physicians review and edit drafts, then approve and save them. The sampled backend implements authentication, Gemini requests, and Firestore operations in one file. The README describes a Streamlit version and additional deployment details that do not match the supplied tree, so this map follows the visible React/FastAPI implementation; unsampled backend routes and deployment infrastructure are not expanded.

Main entry points: [`frontend/src/App.jsx`](https://github.com/hima121k/health-care-summary/blob/main/frontend/src/App.jsx) (Role Router), [`frontend/src/components/PatientChat.jsx`](https://github.com/hima121k/health-care-summary/blob/main/frontend/src/components/PatientChat.jsx) (Patient Chat), [`frontend/src/components/PhysicianDashboard.jsx`](https://github.com/hima121k/health-care-summary/blob/main/frontend/src/components/PhysicianDashboard.jsx) (Review Dashboard), [`backend/main.py`](https://github.com/hima121k/health-care-summary/blob/main/backend/main.py) (Authentication API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React Client"]
  node_app["Role Router<br/>[App.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_signup["Signup<br/>[Signup.jsx]"]
  node_chat_ui["Patient Chat<br/>[PatientChat.jsx]"]
  node_dashboard["Review Dashboard"]
end

subgraph group_service["API Workflows"]
  node_auth_api["Authentication API<br/>[main.py]"]
  node_chat_api["Interview API<br/>[main.py]"]
  node_soap_api["SOAP Generation<br/>[main.py]"]
  node_draft_api["Draft Management<br/>[main.py]"]
  node_save_api["Note Approval<br/>[main.py]"]
end

subgraph group_integrations["External Services"]
  node_gemini{{"Gemini"}}
  node_firestore[("Firestore")]
end

node_patient(("Patient"))
node_physician(("Physician"))

node_patient -->|"uses"| node_app
node_physician -->|"uses"| node_app
node_app -->|"renders"| node_login
node_app -->|"renders"| node_signup
node_app -->|"routes patient"| node_chat_ui
node_app -->|"routes doctor"| node_dashboard
node_login -->|"posts login"| node_auth_api
node_signup -->|"posts registration"| node_auth_api
node_chat_ui -->|"posts messages"| node_chat_api
node_chat_ui -->|"submits transcript"| node_soap_api
node_chat_ui -->|"saves generated draft"| node_draft_api
node_dashboard -->|"loads drafts"| node_draft_api
node_dashboard -->|"submits approval"| node_save_api
node_auth_api -->|"reads and writes users"| node_firestore
node_chat_api -->|"requests reply"| node_gemini
node_soap_api -->|"generates structured note"| node_gemini
node_draft_api -->|"stores and reads drafts"| node_firestore
node_save_api -->|"writes visit and deletes draft"| node_firestore

click node_app "https://github.com/hima121k/health-care-summary/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/hima121k/health-care-summary/blob/main/frontend/src/components/Login.jsx"
click node_signup "https://github.com/hima121k/health-care-summary/blob/main/frontend/src/components/Signup.jsx"
click node_chat_ui "https://github.com/hima121k/health-care-summary/blob/main/frontend/src/components/PatientChat.jsx"
click node_dashboard "https://github.com/hima121k/health-care-summary/blob/main/frontend/src/components/PhysicianDashboard.jsx"
click node_auth_api "https://github.com/hima121k/health-care-summary/blob/main/backend/main.py"
click node_chat_api "https://github.com/hima121k/health-care-summary/blob/main/backend/main.py"
click node_soap_api "https://github.com/hima121k/health-care-summary/blob/main/backend/main.py"
click node_draft_api "https://github.com/hima121k/health-care-summary/blob/main/backend/main.py"
click node_save_api "https://github.com/hima121k/health-care-summary/blob/main/backend/main.py"

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_login,node_signup,node_chat_ui,node_dashboard toneBlue
class node_auth_api,node_chat_api,node_soap_api,node_draft_api,node_save_api toneAmber
class node_gemini,node_firestore toneMint
class node_patient,node_physician toneIndigo
```

## Components

### React Client

- [Role Router](https://github.com/hima121k/health-care-summary/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login](https://github.com/hima121k/health-care-summary/blob/main/frontend/src/components/Login.jsx): `frontend/src/components/Login.jsx`
- [Signup](https://github.com/hima121k/health-care-summary/blob/main/frontend/src/components/Signup.jsx): `frontend/src/components/Signup.jsx`
- [Patient Chat](https://github.com/hima121k/health-care-summary/blob/main/frontend/src/components/PatientChat.jsx): `frontend/src/components/PatientChat.jsx`
- [Review Dashboard](https://github.com/hima121k/health-care-summary/blob/main/frontend/src/components/PhysicianDashboard.jsx): `frontend/src/components/PhysicianDashboard.jsx`

### API Workflows

- [Authentication API](https://github.com/hima121k/health-care-summary/blob/main/backend/main.py): `backend/main.py`
- [Interview API](https://github.com/hima121k/health-care-summary/blob/main/backend/main.py): `backend/main.py`
- [SOAP Generation](https://github.com/hima121k/health-care-summary/blob/main/backend/main.py): `backend/main.py`
- [Draft Management](https://github.com/hima121k/health-care-summary/blob/main/backend/main.py): `backend/main.py`
- [Note Approval](https://github.com/hima121k/health-care-summary/blob/main/backend/main.py): `backend/main.py`

### External Services

- **Gemini**
- **Firestore**

### Other components

- **Patient**
- **Physician**

## Connections

- Patient → Role Router: uses (evidence: `frontend/src/App.jsx`)
- Physician → Role Router: uses (evidence: `frontend/src/App.jsx`)
- Role Router → Login: renders (evidence: `frontend/src/App.jsx`)
- Role Router → Signup: renders (evidence: `frontend/src/App.jsx`)
- Role Router → Patient Chat: routes patient (evidence: `frontend/src/App.jsx`)
- Role Router → Review Dashboard: routes doctor (evidence: `frontend/src/App.jsx`)
- Login → Authentication API: posts login (evidence: `frontend/src/components/Login.jsx`)
- Signup → Authentication API: posts registration (evidence: `frontend/src/components/Signup.jsx`)
- Patient Chat → Interview API: posts messages (evidence: `frontend/src/components/PatientChat.jsx`)
- Patient Chat → SOAP Generation: submits transcript (evidence: `frontend/src/components/PatientChat.jsx`)
- Patient Chat → Draft Management: saves generated draft (evidence: `frontend/src/components/PatientChat.jsx`)
- Review Dashboard → Draft Management: loads drafts (evidence: `frontend/src/components/PhysicianDashboard.jsx`)
- Review Dashboard → Note Approval: submits approval (evidence: `frontend/src/components/PhysicianDashboard.jsx`)
- Authentication API → Firestore: reads and writes users (evidence: `backend/main.py`)
- Interview API → Gemini: requests reply (evidence: `backend/main.py`)
- SOAP Generation → Gemini: generates structured note (evidence: `backend/main.py`)
- Draft Management → Firestore: stores and reads drafts (evidence: `backend/main.py`)
- Note Approval → Firestore: writes visit and deletes draft (evidence: `backend/main.py`)
