# sajagshri300707-ui/parkinson-s-disease-detection architecture

> Architecture diagram of the GitHub repository sajagshri300707-ui/parkinson-s-disease-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sajagshri300707-ui/parkinson-s-disease-detection
- Repository: https://github.com/sajagshri300707-ui/parkinson-s-disease-detection

## Overview

NeuroScan AI is a research-oriented Parkinson’s screening application. Users sign in, submit voice, drawing, or tablet data, receive modality-specific predictions and visualizations, and can combine scores into a fused report. The graph follows the documented frontend-to-API workflow and sampled predictor/model calls; several routes and page implementations were not fully excerpted, so those links are included only where the index or README supports them.

Main entry points: [`backend/main.py`](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/main.py) (FastAPI entry and compatibility routes), [`frontend/src/pages/VoiceAnalysis.jsx`](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/pages/VoiceAnalysis.jsx) (Voice analysis), [`frontend/src/pages/DrawingAnalysis.jsx`](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/pages/DrawingAnalysis.jsx) (Drawing and tablet), [`frontend/src/App.jsx`](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/App.jsx) (App and routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["App and routing<br/>[App.jsx]"]
  node_voice_page["Voice analysis<br/>[VoiceAnalysis.jsx]"]
  node_drawing_page["Drawing and tablet"]
  node_report_page["Diagnostic report"]
  node_upload["File upload<br/>[UploadZone.jsx]"]
  node_results["Result state<br/>[ResultsContext.jsx]"]
  node_api_client["API client<br/>[client.js]"]
  node_gauge["Risk gauge<br/>[Gauge.jsx]"]
  node_spinner["Progress indicator<br/>[Spinner.jsx]"]
end

subgraph group_api["API service"]
  node_backend["FastAPI entry and compatibility routes<br/>[main.py]"]
  node_voice_route["Voice route<br/>[voice.py]"]
  node_drawing_route["Drawing route<br/>[drawing.py]"]
  node_tablet_route["Tablet route<br/>[tablet.py]"]
  node_report_route["Fusion route<br/>[report.py]"]
  node_backend_auth["Backend authentication<br/>[auth.py]"]
end

subgraph group_analysis["Biomarker analysis"]
  node_voice_model["Voice prediction<br/>[predict_voice.py]"]
  node_audio_features["Acoustic features<br/>[audio_features.py]"]
  node_drawing_model["Drawing prediction<br/>[predict_drawing.py]"]
  node_tablet_model["Kinematic prediction<br/>[predict_tablet.py]"]
  node_model_store[("Loaded ML models<br/>[models.py]")]
  node_fusion["Score fusion<br/>[fuse.py]"]
  node_dataset_index["Drawing dataset index<br/>[dataset_indexer.py]"]
end

subgraph group_identity["Identity and records"]
  node_auth_context["Auth context<br/>[AuthContext.jsx]"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
  node_database_helpers["Profile and report data<br/>[database.js]"]
end

subgraph group_assistant["Voice assistant"]
  node_assistant_ui["Voice assistant UI<br/>[VoiceAssistant.jsx]"]
  node_assistant_service["Assistant service<br/>[voiceAssistant.js]"]
  node_voice_prompts["Voice prompts<br/>[voicePrompts.js]"]
end

node_user(("User"))
node_supabase[("Supabase services")]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_voice_page
node_app -->|"routes to"| node_drawing_page
node_app -->|"routes to"| node_report_page
node_voice_page -->|"renders"| node_upload
node_drawing_page -->|"renders"| node_upload
node_voice_page -->|"requests analysis"| node_api_client
node_drawing_page -->|"requests analysis"| node_api_client
node_report_page -->|"requests fusion"| node_api_client
node_voice_page -->|"stores results"| node_results
node_drawing_page -->|"stores results"| node_results
node_report_page -->|"reads scores"| node_results
node_api_client -->|"HTTP requests"| node_backend
node_backend -->|"calls predictor"| node_voice_model
node_backend -->|"calls predictor"| node_drawing_model
node_backend -->|"calls predictor"| node_tablet_model
node_backend -->|"calls fusion"| node_fusion
node_backend -->|"registers routes"| node_voice_route
node_backend -->|"registers routes"| node_drawing_route
node_backend -->|"registers routes"| node_tablet_route
node_backend -->|"registers routes"| node_report_route
node_voice_route -->|"dispatches prediction"| node_voice_model
node_drawing_route -->|"dispatches prediction"| node_drawing_model
node_drawing_route -->|"uses indexer"| node_dataset_index
node_tablet_route -->|"dispatches prediction"| node_tablet_model
node_report_route -->|"calls fusion"| node_fusion
node_voice_model -->|"extracts features"| node_audio_features
node_voice_model -->|"uses speech model"| node_model_store
node_drawing_model -->|"uses drawing models"| node_model_store
node_tablet_model -->|"uses kinematic model"| node_model_store
node_auth_context -->|"uses auth"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase
node_database_helpers -->|"reads and writes"| node_supabase
node_backend_auth -->|"authenticates users"| node_supabase
node_voice_page -->|"persists results"| node_database_helpers
node_report_page -->|"renders risk"| node_gauge
node_drawing_page -->|"renders risk"| node_gauge
node_voice_page -->|"shows progress"| node_spinner
node_drawing_page -->|"shows progress"| node_spinner
node_assistant_ui -->|"calls service"| node_assistant_service
node_assistant_service -->|"uses prompts"| node_voice_prompts

click node_app "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/App.jsx"
click node_voice_page "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/pages/VoiceAnalysis.jsx"
click node_drawing_page "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/pages/DrawingAnalysis.jsx"
click node_report_page "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/pages/DiagnosticReport.jsx"
click node_upload "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/components/UploadZone.jsx"
click node_results "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/context/ResultsContext.jsx"
click node_api_client "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/api/client.js"
click node_backend "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/main.py"
click node_voice_route "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/routes/voice.py"
click node_drawing_route "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/routes/drawing.py"
click node_tablet_route "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/routes/tablet.py"
click node_report_route "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/routes/report.py"
click node_voice_model "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/core/predict_voice.py"
click node_audio_features "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/audio_features.py"
click node_drawing_model "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/core/predict_drawing.py"
click node_tablet_model "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/core/predict_tablet.py"
click node_model_store "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/core/models.py"
click node_fusion "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/core/fuse.py"
click node_dataset_index "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/core/dataset_indexer.py"
click node_auth_context "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/context/AuthContext.jsx"
click node_supabase_client "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/lib/supabase.js"
click node_database_helpers "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/lib/database.js"
click node_backend_auth "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/routes/auth.py"
click node_assistant_ui "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/components/VoiceAssistant.jsx"
click node_assistant_service "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/services/voiceAssistant.js"
click node_voice_prompts "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/constants/voicePrompts.js"
click node_gauge "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/components/Gauge.jsx"
click node_spinner "https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/components/Spinner.jsx"

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_voice_page,node_drawing_page,node_report_page,node_upload,node_results,node_api_client,node_gauge,node_spinner,node_user toneBlue
class node_backend,node_voice_route,node_drawing_route,node_tablet_route,node_report_route,node_backend_auth,node_supabase toneAmber
class node_voice_model,node_audio_features,node_drawing_model,node_tablet_model,node_model_store,node_fusion,node_dataset_index toneMint
class node_auth_context,node_supabase_client,node_database_helpers toneRose
class node_assistant_ui,node_assistant_service,node_voice_prompts toneIndigo
```

## Components

### Web application

- [App and routing](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Voice analysis](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/pages/VoiceAnalysis.jsx): `frontend/src/pages/VoiceAnalysis.jsx`
- [Drawing and tablet](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/pages/DrawingAnalysis.jsx): `frontend/src/pages/DrawingAnalysis.jsx`
- [Diagnostic report](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/pages/DiagnosticReport.jsx): `frontend/src/pages/DiagnosticReport.jsx`
- [File upload](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/components/UploadZone.jsx): `frontend/src/components/UploadZone.jsx`
- [Result state](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/context/ResultsContext.jsx): `frontend/src/context/ResultsContext.jsx`
- [API client](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Risk gauge](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/components/Gauge.jsx): `frontend/src/components/Gauge.jsx`
- [Progress indicator](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/components/Spinner.jsx): `frontend/src/components/Spinner.jsx`

### API service

- [FastAPI entry and compatibility routes](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/main.py): `backend/main.py`
- [Voice route](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/routes/voice.py): `backend/routes/voice.py`
- [Drawing route](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/routes/drawing.py): `backend/routes/drawing.py`
- [Tablet route](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/routes/tablet.py): `backend/routes/tablet.py`
- [Fusion route](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/routes/report.py): `backend/routes/report.py`
- [Backend authentication](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/routes/auth.py): `backend/routes/auth.py`

### Biomarker analysis

- [Voice prediction](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/core/predict_voice.py): `backend/core/predict_voice.py`
- [Acoustic features](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/audio_features.py): `audio_features.py`
- [Drawing prediction](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/core/predict_drawing.py): `backend/core/predict_drawing.py`
- [Kinematic prediction](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/core/predict_tablet.py): `backend/core/predict_tablet.py`
- [Loaded ML models](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/core/models.py): `backend/core/models.py`
- [Score fusion](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/core/fuse.py): `backend/core/fuse.py`
- [Drawing dataset index](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/backend/core/dataset_indexer.py): `backend/core/dataset_indexer.py`

### Identity and records

- [Auth context](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Supabase client](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/lib/supabase.js): `frontend/src/lib/supabase.js`
- [Profile and report data](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/lib/database.js): `frontend/src/lib/database.js`

### Voice assistant

- [Voice assistant UI](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/components/VoiceAssistant.jsx): `frontend/src/components/VoiceAssistant.jsx`
- [Assistant service](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/services/voiceAssistant.js): `frontend/src/services/voiceAssistant.js`
- [Voice prompts](https://github.com/sajagshri300707-ui/parkinson-s-disease-detection/blob/main/frontend/src/constants/voicePrompts.js): `frontend/src/constants/voicePrompts.js`

### Other components

- **User**
- **Supabase services**

## Connections

- User → App and routing: uses (evidence: `frontend/src/App.jsx`)
- App and routing → Voice analysis: routes to (evidence: `frontend/src/App.jsx`)
- App and routing → Drawing and tablet: routes to (evidence: `frontend/src/App.jsx`)
- App and routing → Diagnostic report: routes to (evidence: `frontend/src/App.jsx`)
- Voice analysis → File upload: renders (evidence: `frontend/src/pages/VoiceAnalysis.jsx`)
- Drawing and tablet → File upload: renders (evidence: `frontend/src/pages/DrawingAnalysis.jsx`)
- Voice analysis → API client: requests analysis (evidence: `frontend/src/pages/VoiceAnalysis.jsx`)
- Drawing and tablet → API client: requests analysis (evidence: `frontend/src/pages/DrawingAnalysis.jsx`)
- Diagnostic report → API client: requests fusion (evidence: `frontend/src/pages/DiagnosticReport.jsx`)
- Voice analysis → Result state: stores results (evidence: `frontend/src/pages/VoiceAnalysis.jsx`)
- Drawing and tablet → Result state: stores results (evidence: `frontend/src/pages/DrawingAnalysis.jsx`)
- Diagnostic report → Result state: reads scores (evidence: `frontend/src/pages/DiagnosticReport.jsx`)
- API client → FastAPI entry and compatibility routes: HTTP requests (evidence: `frontend/src/api/client.js`)
- FastAPI entry and compatibility routes → Voice prediction: calls predictor (evidence: `backend/main.py`)
- FastAPI entry and compatibility routes → Drawing prediction: calls predictor (evidence: `backend/main.py`)
- FastAPI entry and compatibility routes → Kinematic prediction: calls predictor (evidence: `backend/main.py`)
- FastAPI entry and compatibility routes → Score fusion: calls fusion (evidence: `backend/main.py`)
- FastAPI entry and compatibility routes → Voice route: registers routes (evidence: `backend/main.py`)
- FastAPI entry and compatibility routes → Drawing route: registers routes (evidence: `backend/main.py`)
- FastAPI entry and compatibility routes → Tablet route: registers routes (evidence: `backend/main.py`)
- FastAPI entry and compatibility routes → Fusion route: registers routes (evidence: `backend/main.py`)
- Voice route → Voice prediction: dispatches prediction (evidence: `backend/routes/voice.py`)
- Drawing route → Drawing prediction: dispatches prediction (evidence: `backend/routes/drawing.py`)
- Drawing route → Drawing dataset index: uses indexer (evidence: `backend/routes/drawing.py`)
- Tablet route → Kinematic prediction: dispatches prediction (evidence: `backend/routes/tablet.py`)
- Fusion route → Score fusion: calls fusion (evidence: `backend/routes/report.py`)
- Voice prediction → Acoustic features: extracts features (evidence: `backend/core/predict_voice.py`)
- Voice prediction → Loaded ML models: uses speech model (evidence: `backend/core/predict_voice.py`)
- Drawing prediction → Loaded ML models: uses drawing models (evidence: `backend/core/predict_drawing.py`)
- Kinematic prediction → Loaded ML models: uses kinematic model (evidence: `backend/core/predict_tablet.py`)
- Auth context → Supabase client: uses auth (evidence: `frontend/src/context/AuthContext.jsx`)
- Supabase client → Supabase services: connects to (evidence: `frontend/src/lib/supabase.js`)
- Profile and report data → Supabase services: reads and writes (evidence: `frontend/src/lib/database.js`)
- Backend authentication → Supabase services: authenticates users (evidence: `backend/routes/auth.py`)
- Voice analysis → Profile and report data: persists results (evidence: `frontend/src/pages/VoiceAnalysis.jsx`)
- Diagnostic report → Risk gauge: renders risk (evidence: `frontend/src/pages/DiagnosticReport.jsx`)
- Drawing and tablet → Risk gauge: renders risk (evidence: `frontend/src/pages/DrawingAnalysis.jsx`)
- Voice analysis → Progress indicator: shows progress (evidence: `frontend/src/pages/VoiceAnalysis.jsx`)
- Drawing and tablet → Progress indicator: shows progress (evidence: `frontend/src/pages/DrawingAnalysis.jsx`)
- Voice assistant UI → Assistant service: calls service (evidence: `frontend/src/components/VoiceAssistant.jsx`)
- Assistant service → Voice prompts: uses prompts (evidence: `frontend/src/services/voiceAssistant.js`)
