# humansamiksha/care architecture

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

- Interactive diagram: https://gitdiagram.com/humansamiksha/care
- Repository: https://github.com/humansamiksha/care

## Overview

C.A.R.E. is a static, browser-based hospital intake kiosk. Patients speak or scan a prescription; the app conducts multilingual AI-assisted intake, converts speech to voice prompts, and syncs patient records for staff review. The main runtime is concentrated in app.js; the README documents capabilities whose specific implementation is not fully shown in the excerpts.

Main entry points: [`app.js`](https://github.com/humansamiksha/care/blob/main/app.js) (Kiosk Controller), [`index.html`](https://github.com/humansamiksha/care/blob/main/index.html) (Kiosk Interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Patient Intake"]
  node_kiosk["Kiosk Interface<br/>[index.html]"]
  node_controller["Kiosk Controller<br/>[app.js]"]
  node_voice_capture["Voice Recognition<br/>[app.js]"]
  node_language["Language Handling<br/>[app.js]"]
  node_conversation["Conversation Logic<br/>[app.js]"]
  node_speech_output["Spoken Prompts<br/>[app.js]"]
end

subgraph group_ai["AI Services"]
  node_groq["Groq LLM"]
  node_speech_api["Web Speech API"]
  node_scan["Prescription Scanning<br/>[app.js]"]
  node_ocr_space["OCR.space"]
  node_handwriting_model["Handwriting Model"]
end

subgraph group_records["Records and Dashboard"]
  node_records_store[("Patient Local Storage")]
  node_sync["Record Sync<br/>[app.js]"]
  node_dashboard["Staff Dashboard<br/>[app.js]"]
  node_broadcast["Broadcast Channel"]
end

subgraph group_config["Kiosk Configuration"]
  node_settings["API Settings<br/>[app.js]"]
end

node_patient(("Patient"))
node_staff(("Hospital Staff"))

node_patient -->|"uses"| node_kiosk
node_kiosk -->|"dispatches input"| node_controller
node_controller -->|"starts recognition"| node_voice_capture
node_voice_capture -->|"captures speech"| node_speech_api
node_controller -->|"detects language"| node_language
node_controller -->|"processes responses"| node_conversation
node_conversation -->|"requests replies"| node_groq
node_controller -->|"speaks prompts"| node_speech_output
node_speech_output -->|"uses synthesis"| node_speech_api
node_controller -->|"handles scans"| node_scan
node_scan -->|"submits images"| node_ocr_space
node_scan -.->|"runs recognition"| node_handwriting_model
node_controller -->|"syncs patient data"| node_sync
node_sync -->|"writes records"| node_records_store
node_dashboard -->|"reads records"| node_records_store
node_controller -->|"refreshes view"| node_dashboard
node_dashboard -->|"presents records"| node_staff
node_controller -->|"publishes updates"| node_broadcast
node_broadcast -->|"delivers updates"| node_sync
node_settings -->|"persists keys"| node_records_store

click node_kiosk "https://github.com/humansamiksha/care/blob/main/index.html"
click node_controller "https://github.com/humansamiksha/care/blob/main/app.js"
click node_voice_capture "https://github.com/humansamiksha/care/blob/main/app.js"
click node_language "https://github.com/humansamiksha/care/blob/main/app.js"
click node_conversation "https://github.com/humansamiksha/care/blob/main/app.js"
click node_speech_output "https://github.com/humansamiksha/care/blob/main/app.js"
click node_scan "https://github.com/humansamiksha/care/blob/main/app.js"
click node_sync "https://github.com/humansamiksha/care/blob/main/app.js"
click node_dashboard "https://github.com/humansamiksha/care/blob/main/app.js"
click node_settings "https://github.com/humansamiksha/care/blob/main/app.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_kiosk,node_controller,node_voice_capture,node_language,node_conversation,node_speech_output toneBlue
class node_groq,node_speech_api,node_scan,node_ocr_space,node_handwriting_model toneAmber
class node_records_store,node_sync,node_dashboard,node_broadcast toneMint
class node_settings toneRose
class node_patient,node_staff toneIndigo
```

## Components

### Patient Intake

- [Kiosk Interface](https://github.com/humansamiksha/care/blob/main/index.html): `index.html`
- [Kiosk Controller](https://github.com/humansamiksha/care/blob/main/app.js): `app.js`
- [Voice Recognition](https://github.com/humansamiksha/care/blob/main/app.js): `app.js`
- [Language Handling](https://github.com/humansamiksha/care/blob/main/app.js): `app.js`
- [Conversation Logic](https://github.com/humansamiksha/care/blob/main/app.js): `app.js`
- [Spoken Prompts](https://github.com/humansamiksha/care/blob/main/app.js): `app.js`

### AI Services

- **Groq LLM**
- **Web Speech API**
- [Prescription Scanning](https://github.com/humansamiksha/care/blob/main/app.js): `app.js`
- **OCR.space**
- **Handwriting Model**

### Records and Dashboard

- **Patient Local Storage**
- [Record Sync](https://github.com/humansamiksha/care/blob/main/app.js): `app.js`
- [Staff Dashboard](https://github.com/humansamiksha/care/blob/main/app.js): `app.js`
- **Broadcast Channel**

### Kiosk Configuration

- [API Settings](https://github.com/humansamiksha/care/blob/main/app.js): `app.js`

### Other components

- **Patient**
- **Hospital Staff**

## Connections

- Patient → Kiosk Interface: uses
- Kiosk Interface → Kiosk Controller: dispatches input
- Kiosk Controller → Voice Recognition: starts recognition
- Voice Recognition → Web Speech API: captures speech
- Kiosk Controller → Language Handling: detects language
- Kiosk Controller → Conversation Logic: processes responses
- Conversation Logic → Groq LLM: requests replies
- Kiosk Controller → Spoken Prompts: speaks prompts
- Spoken Prompts → Web Speech API: uses synthesis
- Kiosk Controller → Prescription Scanning: handles scans
- Prescription Scanning → OCR.space: submits images
- Prescription Scanning → Handwriting Model: runs recognition
- Kiosk Controller → Record Sync: syncs patient data
- Record Sync → Patient Local Storage: writes records
- Staff Dashboard → Patient Local Storage: reads records
- Kiosk Controller → Staff Dashboard: refreshes view
- Staff Dashboard → Hospital Staff: presents records
- Kiosk Controller → Broadcast Channel: publishes updates
- Broadcast Channel → Record Sync: delivers updates
- API Settings → Patient Local Storage: persists keys
