# useriswild7099/sahayak-dashboard- architecture

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

- Interactive diagram: https://gitdiagram.com/useriswild7099/sahayak-dashboard-
- Repository: https://github.com/useriswild7099/sahayak-dashboard-

## Overview

This is a browser-based caseworker and survivor-support application for managing atrocity cases and multilingual check-ins through simulated IVR and SMS. Caseworkers review a queue and case details, initiate a voice check-in, and the IVR engine records responses; the app persists completed check-ins and requests a therapy-model score. Scheduling, SMS, privacy, and ethics are additional product capabilities visible in the tree and excerpts. Evidence is partial, so uncertain component wiring is omitted; browser storage and the optional custom model endpoint are shown where supported.

Main entry points: [`src/App.tsx`](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/App.tsx) (Application shell), [`src/services/storageService.ts`](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/storageService.ts) (Case and check-in store), [`src/services/ivrEngine.ts`](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/ivrEngine.ts) (IVR engine), [`src/services/therapyModelService.ts`](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/therapyModelService.ts) (Therapy model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_casework["Casework"]
  node_app["Application shell<br/>[App.tsx]"]
  node_queue["Case queue"]
  node_detail["Case details"]
  node_edit["Edit case"]
  node_schedule["Schedule interaction"]
  node_batch["Batch runner"]
  node_privacy["Privacy portal"]
  node_ethics["Ethical charter"]
end

subgraph group_outreach["Outreach"]
  node_phone["Phone simulator"]
  node_engine["IVR engine<br/>[ivrEngine.ts]"]
  node_audio["DTMF audio"]
  node_sms["SMS service<br/>[smsService.ts]"]
  node_scheduler["Scheduler"]
end

subgraph group_analysis["Assessment"]
  node_model["Therapy model"]
end

subgraph group_state["State and data"]
  node_records[("Case and check-in store<br/>[storageService.ts]")]
  node_seed["Initial case data<br/>[mockCases.ts]"]
  node_types["Domain types<br/>[ivr.ts]"]
end

node_worker(("Caseworker"))
node_citizen(("Survivor"))
node_browser[("Browser storage")]
node_endpoint["Custom model endpoint"]

node_worker -->|"uses"| node_app
node_citizen -->|"responds through"| node_phone
node_app -->|"renders"| node_queue
node_app -->|"renders"| node_phone
node_app -->|"renders"| node_privacy
node_app -->|"renders"| node_ethics
node_app -->|"renders"| node_detail
node_app -->|"reads and updates"| node_records
node_app -->|"registers completion"| node_engine
node_phone -->|"controls session"| node_engine
node_engine -->|"plays tones"| node_audio
node_engine -->|"returns completed record"| node_app
node_app -->|"scores completed case"| node_model
node_app -->|"stores check-in"| node_records
node_records -->|"persists"| node_browser
node_records -->|"initializes from"| node_seed
node_sms -->|"reads case data"| node_records
node_scheduler -->|"reads due cases"| node_records
node_scheduler -->|"dispatches SMS"| node_sms
node_scheduler -->|"queues IVR"| node_engine
node_model -->|"reads and updates cases"| node_records
node_model -->|"reads messages"| node_sms
node_model -.->|"posts analysis"| node_endpoint

click node_app "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/App.tsx"
click node_queue "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/CaseworkerQueue.tsx"
click node_detail "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/CaseDetailModal.tsx"
click node_edit "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/EditCaseRecordModal.tsx"
click node_schedule "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/ScheduleInteractionModal.tsx"
click node_batch "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/ScheduledBatchRunnerModal.tsx"
click node_privacy "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/CitizenPrivacyPortal.tsx"
click node_ethics "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/EthicalCharterModal.tsx"
click node_phone "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/IVRPhoneSimulator.tsx"
click node_engine "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/ivrEngine.ts"
click node_audio "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/dtmfAudioService.ts"
click node_sms "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/smsService.ts"
click node_scheduler "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/schedulerService.ts"
click node_model "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/therapyModelService.ts"
click node_records "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/storageService.ts"
click node_seed "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/data/mockCases.ts"
click node_types "https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/types/ivr.ts"

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_queue,node_detail,node_edit,node_schedule,node_batch,node_privacy,node_ethics toneBlue
class node_phone,node_engine,node_audio,node_sms,node_scheduler,node_browser toneAmber
class node_model toneMint
class node_records,node_seed,node_types,node_worker toneRose
class node_citizen,node_endpoint toneIndigo
```

## Components

### Casework

- [Application shell](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/App.tsx): `src/App.tsx`
- [Case queue](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/CaseworkerQueue.tsx): `src/components/CaseworkerQueue.tsx`
- [Case details](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/CaseDetailModal.tsx): `src/components/CaseDetailModal.tsx`
- [Edit case](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/EditCaseRecordModal.tsx): `src/components/EditCaseRecordModal.tsx`
- [Schedule interaction](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/ScheduleInteractionModal.tsx): `src/components/ScheduleInteractionModal.tsx`
- [Batch runner](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/ScheduledBatchRunnerModal.tsx): `src/components/ScheduledBatchRunnerModal.tsx`
- [Privacy portal](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/CitizenPrivacyPortal.tsx): `src/components/CitizenPrivacyPortal.tsx`
- [Ethical charter](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/EthicalCharterModal.tsx): `src/components/EthicalCharterModal.tsx`

### Outreach

- [Phone simulator](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/components/IVRPhoneSimulator.tsx): `src/components/IVRPhoneSimulator.tsx`
- [IVR engine](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/ivrEngine.ts): `src/services/ivrEngine.ts`
- [DTMF audio](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/dtmfAudioService.ts): `src/services/dtmfAudioService.ts`
- [SMS service](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/smsService.ts): `src/services/smsService.ts`
- [Scheduler](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/schedulerService.ts): `src/services/schedulerService.ts`

### Assessment

- [Therapy model](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/therapyModelService.ts): `src/services/therapyModelService.ts`

### State and data

- [Case and check-in store](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/services/storageService.ts): `src/services/storageService.ts`
- [Initial case data](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/data/mockCases.ts): `src/data/mockCases.ts`
- [Domain types](https://github.com/useriswild7099/sahayak-dashboard-/blob/main/src/types/ivr.ts): `src/types/ivr.ts`

### Other components

- **Caseworker**
- **Survivor**
- **Browser storage**
- **Custom model endpoint**

## Connections

- Caseworker → Application shell: uses
- Survivor → Phone simulator: responds through
- Application shell → Case queue: renders
- Application shell → Phone simulator: renders
- Application shell → Privacy portal: renders
- Application shell → Ethical charter: renders
- Application shell → Case details: renders
- Application shell → Case and check-in store: reads and updates
- Application shell → IVR engine: registers completion
- Phone simulator → IVR engine: controls session
- IVR engine → DTMF audio: plays tones
- IVR engine → Application shell: returns completed record
- Application shell → Therapy model: scores completed case
- Application shell → Case and check-in store: stores check-in
- Case and check-in store → Browser storage: persists
- Case and check-in store → Initial case data: initializes from
- SMS service → Case and check-in store: reads case data
- Scheduler → Case and check-in store: reads due cases
- Scheduler → SMS service: dispatches SMS
- Scheduler → IVR engine: queues IVR
- Therapy model → Case and check-in store: reads and updates cases
- Therapy model → SMS service: reads messages
- Therapy model → Custom model endpoint: posts analysis
