# yashashree737/veercare-sih2026 architecture

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

- Interactive diagram: https://gitdiagram.com/yashashree737/veercare-sih2026
- Repository: https://github.com/yashashree737/veercare-sih2026

## Overview

VEER CARE is a welfare decision-support product: role-based personnel, welfare, command and HR interfaces collect operational and wellbeing signals, generate risk predictions and insights, and support human-reviewed interventions and follow-up. The sampled API shows authentication, prediction assembly and persistence; the README documents the broader assessment and companion capabilities. Some route and frontend internals were not sampled, so their detailed wiring is not inferred.

Main entry points: [`backend/main.py`](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/main.py) (FastAPI Application), [`frontend/lib/api.ts`](https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/lib/api.ts) (Frontend API Client), [`backend/routes/ml_routes.py`](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/routes/ml_routes.py) (Prediction API), [`backend/database.py`](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/database.py) (SQLAlchemy Database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_web_app["Role Dashboards<br/>[page.tsx]"]
  node_personnel_view["Personnel View<br/>[page.tsx]"]
  node_intervention_view["Interventions<br/>[page.tsx]"]
  node_companion["VEER Companion<br/>[VoiceAgent.tsx]"]
  node_api_client["Frontend API Client<br/>[api.ts]"]
  node_assessments["Wellbeing and Cognitive Assessments"]
  node_context_chat["Contextual Assessment"]
end

subgraph group_api["API and Access"]
  node_api_server["FastAPI Application<br/>[main.py]"]
  node_auth["Login and Access<br/>[auth_routes.py]"]
  node_role_routes["Role APIs<br/>[commander.py]"]
  node_ui_bridge["UI Bridge API<br/>[ui_bridge.py]"]
end

subgraph group_analysis["Signals and Analysis"]
  node_ml_api["Prediction API<br/>[ml_routes.py]"]
  node_feature_engineering["Baseline and Features<br/>[derive.py]"]
  node_encoding["Signal Encoding<br/>[datapipeline.py]"]
  node_inference["Risk Inference<br/>[ml.py]"]
end

subgraph group_welfare["Welfare Operations"]
  node_welfare_api["Welfare API<br/>[welfare.py]"]
  node_human_support["Human Review and Follow-up<br/>[intervention.py]"]
end

subgraph group_persistence["Persistence"]
  node_signal_records[("Personnel and Signal Records")]
  node_database[("SQLAlchemy Database<br/>[database.py]")]
  node_prediction_records[("Prediction Records<br/>[ml_prediction.py]")]
end

node_personnel(("Personnel"))
node_welfare_officer(("Welfare Officer"))
node_commander(("Commander / HR"))

node_personnel -->|"uses dashboards"| node_web_app
node_welfare_officer -->|"reviews welfare"| node_web_app
node_commander -->|"views unit trends"| node_web_app
node_personnel -->|"views wellbeing"| node_personnel_view
node_personnel -->|"completes assessments"| node_assessments
node_personnel -->|"uses companion"| node_companion
node_web_app -.->|"requests data"| node_api_client
node_personnel_view -.->|"requests data"| node_api_client
node_intervention_view -.->|"requests actions"| node_api_client
node_api_client -.->|"calls API"| node_api_server
node_api_server -->|"registers router"| node_auth
node_api_server -->|"registers router"| node_ui_bridge
node_api_server -->|"registers router"| node_role_routes
node_api_server -->|"registers router"| node_welfare_api
node_api_server -->|"registers router"| node_ml_api
node_auth -->|"queries users"| node_database
node_role_routes -->|"queries role data"| node_database
node_welfare_api -->|"queries welfare data"| node_database
node_ml_api -->|"reads signal records"| node_signal_records
node_signal_records -->|"maps tables"| node_database
node_ml_api -->|"derives features"| node_feature_engineering
node_feature_engineering -->|"produces features"| node_encoding
node_ml_api -->|"runs prediction"| node_inference
node_inference -->|"processes inputs"| node_encoding
node_ml_api -->|"persists prediction"| node_prediction_records
node_prediction_records -->|"maps prediction table"| node_database
node_welfare_api -.->|"manages interventions"| node_human_support
node_welfare_officer -->|"reviews actions"| node_intervention_view
node_assessments -.->|"submits responses"| node_api_client
node_context_chat -.->|"requests assessment"| node_api_client

click node_web_app "https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/app/dashboard/page.tsx"
click node_personnel_view "https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/app/personnel/%5Bid%5D/page.tsx"
click node_intervention_view "https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/app/interventions/page.tsx"
click node_companion "https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/components/VoiceAgent.tsx"
click node_api_client "https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/lib/api.ts"
click node_api_server "https://github.com/yashashree737/veercare-sih2026/blob/main/backend/main.py"
click node_auth "https://github.com/yashashree737/veercare-sih2026/blob/main/backend/routes/auth_routes.py"
click node_role_routes "https://github.com/yashashree737/veercare-sih2026/blob/main/backend/routes/commander.py"
click node_ui_bridge "https://github.com/yashashree737/veercare-sih2026/blob/main/backend/routes/ui_bridge.py"
click node_welfare_api "https://github.com/yashashree737/veercare-sih2026/blob/main/backend/routes/welfare.py"
click node_ml_api "https://github.com/yashashree737/veercare-sih2026/blob/main/backend/routes/ml_routes.py"
click node_signal_records "https://github.com/yashashree737/veercare-sih2026/tree/main/backend/models"
click node_database "https://github.com/yashashree737/veercare-sih2026/blob/main/backend/database.py"
click node_feature_engineering "https://github.com/yashashree737/veercare-sih2026/blob/main/backend/derive.py"
click node_encoding "https://github.com/yashashree737/veercare-sih2026/blob/main/backend/ml/datapipeline.py"
click node_inference "https://github.com/yashashree737/veercare-sih2026/blob/main/backend/ml/ml.py"
click node_prediction_records "https://github.com/yashashree737/veercare-sih2026/blob/main/backend/models/ml_prediction.py"
click node_human_support "https://github.com/yashashree737/veercare-sih2026/blob/main/backend/models/intervention.py"
click node_assessments "https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/components/PeriodicTestView.tsx"
click node_context_chat "https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/components/SituationalAssessmentChat.tsx"

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_web_app,node_personnel_view,node_intervention_view,node_companion,node_api_client,node_assessments,node_context_chat toneBlue
class node_api_server,node_auth,node_role_routes,node_ui_bridge toneAmber
class node_ml_api,node_feature_engineering,node_encoding,node_inference toneMint
class node_welfare_api,node_human_support toneRose
class node_signal_records,node_database,node_prediction_records,node_personnel,node_welfare_officer,node_commander toneIndigo
```

## Components

### User Experience

- [Role Dashboards](https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/app/dashboard/page.tsx): `frontend/app/dashboard/page.tsx`
- [Personnel View](https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/app/personnel/%5Bid%5D/page.tsx): `frontend/app/personnel/[id]/page.tsx`
- [Interventions](https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/app/interventions/page.tsx): `frontend/app/interventions/page.tsx`
- [VEER Companion](https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/components/VoiceAgent.tsx): `frontend/components/VoiceAgent.tsx`
- [Frontend API Client](https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`
- [Wellbeing and Cognitive Assessments](https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/components/PeriodicTestView.tsx): `frontend/components/PeriodicTestView.tsx`
- [Contextual Assessment](https://github.com/yashashree737/veercare-sih2026/blob/main/frontend/components/SituationalAssessmentChat.tsx): `frontend/components/SituationalAssessmentChat.tsx`

### API and Access

- [FastAPI Application](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/main.py): `backend/main.py`
- [Login and Access](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/routes/auth_routes.py): `backend/routes/auth_routes.py`
- [Role APIs](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/routes/commander.py): `backend/routes/commander.py`
- [UI Bridge API](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/routes/ui_bridge.py): `backend/routes/ui_bridge.py`

### Signals and Analysis

- [Prediction API](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/routes/ml_routes.py): `backend/routes/ml_routes.py`
- [Baseline and Features](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/derive.py): `backend/derive.py`
- [Signal Encoding](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/ml/datapipeline.py): `backend/ml/datapipeline.py`
- [Risk Inference](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/ml/ml.py): `backend/ml/ml.py`

### Welfare Operations

- [Welfare API](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/routes/welfare.py): `backend/routes/welfare.py`
- [Human Review and Follow-up](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/models/intervention.py): `backend/models/intervention.py`

### Persistence

- [Personnel and Signal Records](https://github.com/yashashree737/veercare-sih2026/tree/main/backend/models): `backend/models`
- [SQLAlchemy Database](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/database.py): `backend/database.py`
- [Prediction Records](https://github.com/yashashree737/veercare-sih2026/blob/main/backend/models/ml_prediction.py): `backend/models/ml_prediction.py`

### Other components

- **Personnel**
- **Welfare Officer**
- **Commander / HR**

## Connections

- Personnel → Role Dashboards: uses dashboards
- Welfare Officer → Role Dashboards: reviews welfare
- Commander / HR → Role Dashboards: views unit trends
- Personnel → Personnel View: views wellbeing
- Personnel → Wellbeing and Cognitive Assessments: completes assessments
- Personnel → VEER Companion: uses companion
- Role Dashboards → Frontend API Client: requests data
- Personnel View → Frontend API Client: requests data
- Interventions → Frontend API Client: requests actions
- Frontend API Client → FastAPI Application: calls API
- FastAPI Application → Login and Access: registers router (evidence: `backend/main.py`)
- FastAPI Application → UI Bridge API: registers router (evidence: `backend/main.py`)
- FastAPI Application → Role APIs: registers router (evidence: `backend/main.py`)
- FastAPI Application → Welfare API: registers router (evidence: `backend/main.py`)
- FastAPI Application → Prediction API: registers router (evidence: `backend/main.py`)
- Login and Access → SQLAlchemy Database: queries users (evidence: `backend/routes/auth_routes.py`)
- Role APIs → SQLAlchemy Database: queries role data (evidence: `backend/routes/commander.py`)
- Welfare API → SQLAlchemy Database: queries welfare data (evidence: `backend/routes/welfare.py`)
- Prediction API → Personnel and Signal Records: reads signal records (evidence: `backend/routes/ml_routes.py`)
- Personnel and Signal Records → SQLAlchemy Database: maps tables (evidence: `backend/models/personnel.py`)
- Prediction API → Baseline and Features: derives features
- Baseline and Features → Signal Encoding: produces features (evidence: `backend/ml/datapipeline.py`)
- Prediction API → Risk Inference: runs prediction (evidence: `backend/routes/ml_routes.py`)
- Risk Inference → Signal Encoding: processes inputs (evidence: `backend/ml/ml.py`)
- Prediction API → Prediction Records: persists prediction (evidence: `backend/routes/ml_routes.py`)
- Prediction Records → SQLAlchemy Database: maps prediction table (evidence: `backend/models/ml_prediction.py`)
- Welfare API → Human Review and Follow-up: manages interventions (evidence: `backend/routes/welfare.py`)
- Welfare Officer → Interventions: reviews actions
- Wellbeing and Cognitive Assessments → Frontend API Client: submits responses
- Contextual Assessment → Frontend API Client: requests assessment
