# jayanth1506/cognitivest architecture

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

- Interactive diagram: https://gitdiagram.com/jayanth1506/cognitivest
- Repository: https://github.com/jayanth1506/cognitivest

## Overview

Clinicians sign in, manage patients, and run screening sessions through the dashboard. The backend authenticates requests, stores session data, and orchestrates quality checks and multimodal screening through the FastAPI service; clinicians then review reports and alerts. The AI service also exposes analysis and summary capabilities. Source excerpts establish the session-to-AI flow and core fusion and quality logic; several other routes and frontend API calls were not sampled, so those links are omitted or marked unverified.

Main entry points: [`frontend/src/App.jsx`](https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/App.jsx) (Dashboard routes), [`backend/src/app.js`](https://github.com/jayanth1506/cognitivest/blob/main/backend/src/app.js) (REST application), [`backend/src/controllers/session.controller.js`](https://github.com/jayanth1506/cognitivest/blob/main/backend/src/controllers/session.controller.js) (Session orchestration), [`frontend/src/api/axios.js`](https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/api/axios.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Clinician dashboard"]
  node_dashboard["Dashboard routes<br/>[App.jsx]"]
  node_authui["Auth state<br/>[authStore.js]"]
  node_api["API client<br/>[axios.js]"]
  node_patientsui["Patient workspace<br/>[PatientsPage.jsx]"]
  node_screeningui["Screening workflow<br/>[Screening.jsx]"]
  node_reportsui["Cognitive reports"]
  node_alertsui["Alerts view<br/>[AlertsPage.jsx]"]
end

subgraph group_backend["Backend API"]
  node_backendapp["REST application<br/>[app.js]"]
  node_auth["Authentication<br/>[auth.controller.js]"]
  node_patients["Patient management"]
  node_sessions["Session orchestration"]
  node_alerts["Alert endpoints"]
  node_aiapi["AI endpoints<br/>[ai.controller.js]"]
end

subgraph group_ai["AI and clinical reasoning"]
  node_qualityrouter["Quality routes<br/>[quality.py]"]
  node_quality["Quality assessment<br/>[quality_service.py]"]
  node_predictionrouter["Prediction routes<br/>[prediction.py]"]
  node_fusion["Multimodal fusion<br/>[fusion_service.py]"]
  node_analysis["Clinical analysis<br/>[analysis.py]"]
  node_diagnosis["Diagnosis reasoning"]
  node_drug["Drug interactions"]
  node_summary["Clinical summaries<br/>[summary_service.py]"]
end

subgraph group_data["Clinical data"]
  node_mongo[("MongoDB")]
end

node_clinician(("Clinician"))

node_clinician -->|"uses"| node_dashboard
node_dashboard -->|"checks access"| node_authui
node_dashboard -->|"routes to"| node_patientsui
node_dashboard -->|"routes to"| node_screeningui
node_dashboard -->|"routes to"| node_reportsui
node_dashboard -->|"routes to"| node_alertsui
node_patientsui -->|"uses"| node_api
node_screeningui -->|"uses"| node_api
node_reportsui -->|"reads state"| node_authui
node_api -.->|"calls API"| node_backendapp
node_backendapp -->|"mounts routes"| node_auth
node_backendapp -->|"mounts routes"| node_patients
node_backendapp -->|"mounts routes"| node_sessions
node_backendapp -->|"mounts routes"| node_alerts
node_backendapp -->|"mounts routes"| node_aiapi
node_auth -->|"reads users"| node_mongo
node_patients -->|"reads patients"| node_mongo
node_sessions -->|"reads and writes"| node_mongo
node_sessions -->|"requests quality checks"| node_qualityrouter
node_sessions -->|"requests screening"| node_predictionrouter
node_qualityrouter -->|"delegates to"| node_quality
node_predictionrouter -->|"uses fusion"| node_fusion
node_analysis -.->|"may invoke"| node_diagnosis
node_analysis -.->|"may invoke"| node_drug
node_summary -.->|"provides summaries"| node_clinician

click node_dashboard "https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/store/authStore.js"
click node_api "https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/api/axios.js"
click node_patientsui "https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/pages/PatientsPage.jsx"
click node_screeningui "https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/pages/Screening.jsx"
click node_reportsui "https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/pages/CognitiveReportPage.jsx"
click node_alertsui "https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/pages/AlertsPage.jsx"
click node_backendapp "https://github.com/jayanth1506/cognitivest/blob/main/backend/src/app.js"
click node_auth "https://github.com/jayanth1506/cognitivest/blob/main/backend/src/controllers/auth.controller.js"
click node_patients "https://github.com/jayanth1506/cognitivest/blob/main/backend/src/controllers/patient.controller.js"
click node_sessions "https://github.com/jayanth1506/cognitivest/blob/main/backend/src/controllers/session.controller.js"
click node_alerts "https://github.com/jayanth1506/cognitivest/blob/main/backend/src/controllers/alert.controller.js"
click node_aiapi "https://github.com/jayanth1506/cognitivest/blob/main/backend/src/controllers/ai.controller.js"
click node_qualityrouter "https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/routers/quality.py"
click node_quality "https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/services/quality_service.py"
click node_predictionrouter "https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/routers/prediction.py"
click node_fusion "https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/services/fusion_service.py"
click node_analysis "https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/routers/analysis.py"
click node_diagnosis "https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/services/diagnosis_service.py"
click node_drug "https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/services/drug_interaction_service.py"
click node_summary "https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/services/summary_service.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_dashboard,node_authui,node_api,node_patientsui,node_screeningui,node_reportsui,node_alertsui toneBlue
class node_backendapp,node_auth,node_patients,node_sessions,node_alerts,node_aiapi toneAmber
class node_qualityrouter,node_quality,node_predictionrouter,node_fusion,node_analysis,node_diagnosis,node_drug,node_summary toneMint
class node_mongo toneRose
class node_clinician toneIndigo
```

## Components

### Clinician dashboard

- [Dashboard routes](https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth state](https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/store/authStore.js): `frontend/src/store/authStore.js`
- [API client](https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/api/axios.js): `frontend/src/api/axios.js`
- [Patient workspace](https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/pages/PatientsPage.jsx): `frontend/src/pages/PatientsPage.jsx`
- [Screening workflow](https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/pages/Screening.jsx): `frontend/src/pages/Screening.jsx`
- [Cognitive reports](https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/pages/CognitiveReportPage.jsx): `frontend/src/pages/CognitiveReportPage.jsx`
- [Alerts view](https://github.com/jayanth1506/cognitivest/blob/main/frontend/src/pages/AlertsPage.jsx): `frontend/src/pages/AlertsPage.jsx`

### Backend API

- [REST application](https://github.com/jayanth1506/cognitivest/blob/main/backend/src/app.js): `backend/src/app.js`
- [Authentication](https://github.com/jayanth1506/cognitivest/blob/main/backend/src/controllers/auth.controller.js): `backend/src/controllers/auth.controller.js`
- [Patient management](https://github.com/jayanth1506/cognitivest/blob/main/backend/src/controllers/patient.controller.js): `backend/src/controllers/patient.controller.js`
- [Session orchestration](https://github.com/jayanth1506/cognitivest/blob/main/backend/src/controllers/session.controller.js): `backend/src/controllers/session.controller.js`
- [Alert endpoints](https://github.com/jayanth1506/cognitivest/blob/main/backend/src/controllers/alert.controller.js): `backend/src/controllers/alert.controller.js`
- [AI endpoints](https://github.com/jayanth1506/cognitivest/blob/main/backend/src/controllers/ai.controller.js): `backend/src/controllers/ai.controller.js`

### AI and clinical reasoning

- [Quality routes](https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/routers/quality.py): `ai-service/app/routers/quality.py`
- [Quality assessment](https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/services/quality_service.py): `ai-service/app/services/quality_service.py`
- [Prediction routes](https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/routers/prediction.py): `ai-service/app/routers/prediction.py`
- [Multimodal fusion](https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/services/fusion_service.py): `ai-service/app/services/fusion_service.py`
- [Clinical analysis](https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/routers/analysis.py): `ai-service/app/routers/analysis.py`
- [Diagnosis reasoning](https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/services/diagnosis_service.py): `ai-service/app/services/diagnosis_service.py`
- [Drug interactions](https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/services/drug_interaction_service.py): `ai-service/app/services/drug_interaction_service.py`
- [Clinical summaries](https://github.com/jayanth1506/cognitivest/blob/main/ai-service/app/services/summary_service.py): `ai-service/app/services/summary_service.py`

### Clinical data

- **MongoDB**

### Other components

- **Clinician**

## Connections

- Clinician → Dashboard routes: uses (evidence: `frontend/src/App.jsx`)
- Dashboard routes → Auth state: checks access (evidence: `frontend/src/App.jsx`)
- Dashboard routes → Patient workspace: routes to (evidence: `frontend/src/App.jsx`)
- Dashboard routes → Screening workflow: routes to (evidence: `frontend/src/App.jsx`)
- Dashboard routes → Cognitive reports: routes to (evidence: `frontend/src/App.jsx`)
- Dashboard routes → Alerts view: routes to (evidence: `frontend/src/App.jsx`)
- Patient workspace → API client: uses (evidence: `frontend/src/pages/PatientsPage.jsx`)
- Screening workflow → API client: uses (evidence: `frontend/src/pages/Screening.jsx`)
- Cognitive reports → Auth state: reads state (evidence: `frontend/src/pages/CognitiveReportPage.jsx`)
- API client → REST application: calls API
- REST application → Authentication: mounts routes (evidence: `backend/src/app.js`)
- REST application → Patient management: mounts routes (evidence: `backend/src/app.js`)
- REST application → Session orchestration: mounts routes (evidence: `backend/src/app.js`)
- REST application → Alert endpoints: mounts routes (evidence: `backend/src/app.js`)
- REST application → AI endpoints: mounts routes (evidence: `backend/src/app.js`)
- Authentication → MongoDB: reads users (evidence: `backend/src/controllers/auth.controller.js`)
- Patient management → MongoDB: reads patients (evidence: `backend/src/controllers/patient.controller.js`)
- Session orchestration → MongoDB: reads and writes (evidence: `backend/src/controllers/session.controller.js`)
- Session orchestration → Quality routes: requests quality checks (evidence: `backend/src/controllers/session.controller.js`)
- Session orchestration → Prediction routes: requests screening (evidence: `backend/src/controllers/session.controller.js`)
- Quality routes → Quality assessment: delegates to (evidence: `ai-service/app/routers/quality.py`)
- Prediction routes → Multimodal fusion: uses fusion (evidence: `ai-service/app/routers/prediction.py`)
- Clinical analysis → Diagnosis reasoning: may invoke
- Clinical analysis → Drug interactions: may invoke
- Clinical summaries → Clinician: provides summaries
