# abishek-kk/aortavision-3d architecture

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

- Interactive diagram: https://gitdiagram.com/abishek-kk/aortavision-3d
- Repository: https://github.com/abishek-kk/aortavision-3d

## Overview

AortaVision 3D is a research-oriented coronary disease risk prediction app. A user supplies one patient’s clinical data through the intake page (or uses a sample), then the frontend calls the FastAPI prediction service. The backend validates inputs, preprocesses them and produces CAD plus LAD/LCX/RCA probabilities, thresholds and SHAP contributions; the analysis dashboard presents these with a 3D heart, clinical measurements and validation metrics. The graph also preserves the educational guide and disclaimer capabilities. Several backend internals and dashboard details are documented in the README but were not sampled, so those links cite the README.

Main entry points: [`frontend/src/pages/Analyze.jsx`](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/pages/Analyze.jsx) (Analysis dashboard), [`backend/main.py`](https://github.com/abishek-kk/aortavision-3d/blob/master/backend/main.py) (FastAPI service), [`frontend/src/pages/Home.jsx`](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/pages/Home.jsx) (Patient intake), [`frontend/src/services/predict.js`](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/services/predict.js) (Prediction client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Patient intake"]
  node_app["App routes<br/>[App.jsx]"]
  node_intake_page["Patient intake<br/>[Home.jsx]"]
  node_sample["Sample patient<br/>[samplePatient.js]"]
  node_patient_state["Patient session state"]
end

subgraph group_prediction["Prediction service"]
  node_prediction_client["Prediction client<br/>[predict.js]"]
  node_api["FastAPI service<br/>[main.py]"]
  node_request_schema["Input validation<br/>[patient_schema.py]"]
  node_preprocessing["Feature preprocessing"]
  node_model_artifacts[("Four trained models")]
  node_explanations["SHAP explanations<br/>[main.py]"]
end

subgraph group_analysis["Analysis experience"]
  node_analysis_page["Analysis dashboard<br/>[Analyze.jsx]"]
  node_heart_scene["Interactive 3D heart<br/>[Analyze.jsx]"]
  node_reference_ranges["Clinical reference ranges<br/>[referenceRanges.js]"]
  node_risk_levels["Risk level mapping<br/>[risk.js]"]
  node_metrics["Validation metrics<br/>[main.py]"]
end

subgraph group_education["Education and safety"]
  node_guide["Clinical glossary<br/>[Guide.jsx]"]
  node_glossary_data["Glossary terms<br/>[glossary.js]"]
  node_disclaimer["Safety disclaimer"]
end

node_patient(("Patient / clinician"))

node_patient -->|"provides data"| node_intake_page
node_app -->|"routes to"| node_intake_page
node_intake_page -->|"loads sample"| node_sample
node_intake_page -->|"stores inputs"| node_patient_state
node_intake_page -->|"requests prediction"| node_prediction_client
node_analysis_page -->|"requests prediction"| node_prediction_client
node_prediction_client -->|"POSTs features"| node_api
node_api -->|"validates request"| node_request_schema
node_api -->|"preprocesses features"| node_preprocessing
node_api -->|"runs models"| node_model_artifacts
node_api -->|"computes SHAP"| node_explanations
node_api -->|"serves metrics"| node_metrics
node_prediction_client -->|"returns results"| node_analysis_page
node_analysis_page -->|"reads results"| node_patient_state
node_analysis_page -->|"renders risk"| node_heart_scene
node_analysis_page -->|"uses ranges"| node_reference_ranges
node_analysis_page -->|"maps risk"| node_risk_levels
node_analysis_page -->|"displays metrics"| node_metrics
node_app -->|"routes to"| node_guide
node_guide -->|"renders terms"| node_glossary_data
node_app -.->|"shows safety notice"| node_disclaimer

click node_app "https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/App.jsx"
click node_intake_page "https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/pages/Home.jsx"
click node_sample "https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/data/samplePatient.js"
click node_patient_state "https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/context/PatientDataContext.jsx"
click node_prediction_client "https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/services/predict.js"
click node_api "https://github.com/abishek-kk/aortavision-3d/blob/master/backend/main.py"
click node_request_schema "https://github.com/abishek-kk/aortavision-3d/blob/master/backend/schemas/patient_schema.py"
click node_preprocessing "https://github.com/abishek-kk/aortavision-3d/blob/master/model/aortavision_preprocessing.py"
click node_model_artifacts "https://github.com/abishek-kk/aortavision-3d/tree/master/model/serialized"
click node_explanations "https://github.com/abishek-kk/aortavision-3d/blob/master/backend/main.py"
click node_analysis_page "https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/pages/Analyze.jsx"
click node_heart_scene "https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/pages/Analyze.jsx"
click node_reference_ranges "https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/config/referenceRanges.js"
click node_risk_levels "https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/utils/risk.js"
click node_metrics "https://github.com/abishek-kk/aortavision-3d/blob/master/backend/main.py"
click node_guide "https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/pages/Guide.jsx"
click node_glossary_data "https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/data/glossary.js"
click node_disclaimer "https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/components/DisclaimerModal.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_intake_page,node_sample,node_patient_state toneBlue
class node_prediction_client,node_api,node_request_schema,node_preprocessing,node_model_artifacts,node_explanations toneAmber
class node_analysis_page,node_heart_scene,node_reference_ranges,node_risk_levels,node_metrics toneMint
class node_guide,node_glossary_data,node_disclaimer toneRose
class node_patient toneIndigo
```

## Components

### Patient intake

- [App routes](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Patient intake](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Sample patient](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/data/samplePatient.js): `frontend/src/data/samplePatient.js`
- [Patient session state](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/context/PatientDataContext.jsx): `frontend/src/context/PatientDataContext.jsx`

### Prediction service

- [Prediction client](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/services/predict.js): `frontend/src/services/predict.js`
- [FastAPI service](https://github.com/abishek-kk/aortavision-3d/blob/master/backend/main.py): `backend/main.py`
- [Input validation](https://github.com/abishek-kk/aortavision-3d/blob/master/backend/schemas/patient_schema.py): `backend/schemas/patient_schema.py`
- [Feature preprocessing](https://github.com/abishek-kk/aortavision-3d/blob/master/model/aortavision_preprocessing.py): `model/aortavision_preprocessing.py`
- [Four trained models](https://github.com/abishek-kk/aortavision-3d/tree/master/model/serialized): `model/serialized`
- [SHAP explanations](https://github.com/abishek-kk/aortavision-3d/blob/master/backend/main.py): `backend/main.py`

### Analysis experience

- [Analysis dashboard](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/pages/Analyze.jsx): `frontend/src/pages/Analyze.jsx`
- [Interactive 3D heart](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/pages/Analyze.jsx): `frontend/src/pages/Analyze.jsx`
- [Clinical reference ranges](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/config/referenceRanges.js): `frontend/src/config/referenceRanges.js`
- [Risk level mapping](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/utils/risk.js): `frontend/src/utils/risk.js`
- [Validation metrics](https://github.com/abishek-kk/aortavision-3d/blob/master/backend/main.py): `backend/main.py`

### Education and safety

- [Clinical glossary](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/pages/Guide.jsx): `frontend/src/pages/Guide.jsx`
- [Glossary terms](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/data/glossary.js): `frontend/src/data/glossary.js`
- [Safety disclaimer](https://github.com/abishek-kk/aortavision-3d/blob/master/frontend/src/components/DisclaimerModal.jsx): `frontend/src/components/DisclaimerModal.jsx`

### Other components

- **Patient / clinician**

## Connections

- Patient / clinician → Patient intake: provides data (evidence: `README.md`)
- App routes → Patient intake: routes to (evidence: `frontend/src/App.jsx`)
- Patient intake → Sample patient: loads sample (evidence: `frontend/src/pages/Home.jsx`)
- Patient intake → Patient session state: stores inputs (evidence: `frontend/src/pages/Home.jsx`)
- Patient intake → Prediction client: requests prediction (evidence: `frontend/src/pages/Home.jsx`)
- Analysis dashboard → Prediction client: requests prediction (evidence: `frontend/src/pages/Analyze.jsx`)
- Prediction client → FastAPI service: POSTs features (evidence: `README.md`)
- FastAPI service → Input validation: validates request (evidence: `backend/main.py`)
- FastAPI service → Feature preprocessing: preprocesses features (evidence: `README.md`)
- FastAPI service → Four trained models: runs models (evidence: `README.md`)
- FastAPI service → SHAP explanations: computes SHAP (evidence: `README.md`)
- FastAPI service → Validation metrics: serves metrics (evidence: `README.md`)
- Prediction client → Analysis dashboard: returns results (evidence: `frontend/src/pages/Analyze.jsx`)
- Analysis dashboard → Patient session state: reads results (evidence: `frontend/src/pages/Analyze.jsx`)
- Analysis dashboard → Interactive 3D heart: renders risk (evidence: `README.md`)
- Analysis dashboard → Clinical reference ranges: uses ranges (evidence: `frontend/src/pages/Analyze.jsx`)
- Analysis dashboard → Risk level mapping: maps risk (evidence: `frontend/src/pages/Analyze.jsx`)
- Analysis dashboard → Validation metrics: displays metrics (evidence: `README.md`)
- App routes → Clinical glossary: routes to (evidence: `frontend/src/App.jsx`)
- Clinical glossary → Glossary terms: renders terms (evidence: `frontend/src/pages/Guide.jsx`)
- App routes → Safety disclaimer: shows safety notice (evidence: `README.md`)
