# aliviahossain/ai-risk-predictor architecture

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

- Interactive diagram: https://gitdiagram.com/aliviahossain/ai-risk-predictor
- Repository: https://github.com/aliviahossain/ai-risk-predictor

## Overview

DEG Analysis Viewer accepts either existing DEG-result CSVs or expression data that it analyzes through a GEO or raw-upload workflow, then presents interactive results. The main path runs from upload selection through FastAPI and, for expression data, the R analysis job; parsed genes then enter the React results view for summaries, plots, tables, and downloads. The graph preserves the documented analysis and visualization capabilities. Some backend and visualization internals were not excerpted, so their links rely on README statements or are omitted where evidence is insufficient.

Main entry points: [`frontend/src/pages/ResultsPage.jsx`](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/pages/ResultsPage.jsx) (Results dashboard), [`frontend/src/pages/UploadPage.jsx`](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/pages/UploadPage.jsx) (Input modes), [`backend/routes/geo.py`](https://github.com/aliviahossain/ai-risk-predictor/blob/main/backend/routes/geo.py) (GEO job API), [`frontend/src/components/RawUploadForm.jsx`](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/RawUploadForm.jsx) (Raw upload form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Input and analysis"]
  node_webapp["Application state<br/>[App.js]"]
  node_upload["Input modes<br/>[UploadPage.jsx]"]
  node_rawform["Raw upload form<br/>[RawUploadForm.jsx]"]
  node_csvparse["CSV parser<br/>[parseCSV.js]"]
end

subgraph group_api["Backend API"]
  node_degapi["DEG CSV API<br/>[deg.py]"]
  node_geoapi["GEO job API<br/>[geo.py]"]
  node_apiapp["FastAPI app<br/>[main.py]"]
  node_rengine["DEG R pipeline<br/>[core_deg_engine.R]"]
  node_apiurl["API configuration<br/>[config.js]"]
end

subgraph group_results["Results experience"]
  node_results["Results dashboard<br/>[ResultsPage.jsx]"]
  node_summary["Summary statistics<br/>[parseCSV.js]"]
end

subgraph group_visuals["Visualization and export"]
  node_volcano["Volcano plot<br/>[VolcanoPlot.jsx]"]
  node_ma["MA plot<br/>[MAPlot.jsx]"]
  node_topgenes["Top genes chart<br/>[TopGenesChart.jsx]"]
  node_genetable["Gene table<br/>[GeneTable.jsx]"]
  node_heatmap["Heatmap viewer<br/>[HeatmapViewer.jsx]"]
  node_download["Download exports<br/>[DownloadButton.jsx]"]
end

node_researcher(("Researcher"))
node_geo["GEO repository"]

node_researcher -->|"selects input"| node_upload
node_upload -->|"renders"| node_rawform
node_upload -->|"parses CSV"| node_csvparse
node_rawform -->|"parses results"| node_csvparse
node_upload -->|"uses endpoint"| node_apiurl
node_rawform -->|"uses endpoint"| node_apiurl
node_apiapp -->|"registers router"| node_degapi
node_apiapp -->|"registers router"| node_geoapi
node_upload -.->|"uploads result CSV"| node_degapi
node_upload -->|"starts or polls job"| node_geoapi
node_rawform -.->|"starts or polls job"| node_geoapi
node_geoapi -->|"runs pipeline"| node_rengine
node_geo -.->|"provides dataset"| node_geoapi
node_geoapi -->|"returns job results"| node_upload
node_apiurl -.->|"targets API"| node_geoapi
node_webapp -->|"shows input"| node_upload
node_webapp -->|"shows results"| node_results
node_upload -->|"passes parsed genes"| node_webapp
node_results -->|"computes statistics"| node_summary
node_results -->|"renders"| node_volcano
node_results -->|"renders"| node_ma
node_results -->|"renders"| node_topgenes
node_results -->|"renders"| node_genetable
node_results -->|"renders"| node_heatmap
node_results -->|"renders"| node_download
node_results -->|"uses endpoint"| node_apiurl
node_heatmap -.->|"fetches heatmap"| node_geoapi

click node_webapp "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/App.js"
click node_upload "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/pages/UploadPage.jsx"
click node_rawform "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/RawUploadForm.jsx"
click node_csvparse "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/utils/parseCSV.js"
click node_degapi "https://github.com/aliviahossain/ai-risk-predictor/blob/main/backend/routes/deg.py"
click node_geoapi "https://github.com/aliviahossain/ai-risk-predictor/blob/main/backend/routes/geo.py"
click node_apiapp "https://github.com/aliviahossain/ai-risk-predictor/blob/main/backend/main.py"
click node_rengine "https://github.com/aliviahossain/ai-risk-predictor/blob/main/backend/analysis/core_deg_engine.R"
click node_results "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/pages/ResultsPage.jsx"
click node_summary "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/utils/parseCSV.js"
click node_volcano "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/VolcanoPlot.jsx"
click node_ma "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/MAPlot.jsx"
click node_topgenes "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/TopGenesChart.jsx"
click node_genetable "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/GeneTable.jsx"
click node_heatmap "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/HeatmapViewer.jsx"
click node_download "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/DownloadButton.jsx"
click node_apiurl "https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/config.js"

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_webapp,node_upload,node_rawform,node_csvparse toneBlue
class node_degapi,node_geoapi,node_apiapp,node_rengine,node_apiurl toneAmber
class node_results,node_summary toneMint
class node_volcano,node_ma,node_topgenes,node_genetable,node_heatmap,node_download toneRose
class node_researcher,node_geo toneIndigo
```

## Components

### Input and analysis

- [Application state](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Input modes](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/pages/UploadPage.jsx): `frontend/src/pages/UploadPage.jsx`
- [Raw upload form](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/RawUploadForm.jsx): `frontend/src/components/RawUploadForm.jsx`
- [CSV parser](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/utils/parseCSV.js): `frontend/src/utils/parseCSV.js`

### Backend API

- [DEG CSV API](https://github.com/aliviahossain/ai-risk-predictor/blob/main/backend/routes/deg.py): `backend/routes/deg.py`
- [GEO job API](https://github.com/aliviahossain/ai-risk-predictor/blob/main/backend/routes/geo.py): `backend/routes/geo.py`
- [FastAPI app](https://github.com/aliviahossain/ai-risk-predictor/blob/main/backend/main.py): `backend/main.py`
- [DEG R pipeline](https://github.com/aliviahossain/ai-risk-predictor/blob/main/backend/analysis/core_deg_engine.R): `backend/analysis/core_deg_engine.R`
- [API configuration](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/config.js): `frontend/src/config.js`

### Results experience

- [Results dashboard](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/pages/ResultsPage.jsx): `frontend/src/pages/ResultsPage.jsx`
- [Summary statistics](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/utils/parseCSV.js): `frontend/src/utils/parseCSV.js`

### Visualization and export

- [Volcano plot](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/VolcanoPlot.jsx): `frontend/src/components/VolcanoPlot.jsx`
- [MA plot](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/MAPlot.jsx): `frontend/src/components/MAPlot.jsx`
- [Top genes chart](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/TopGenesChart.jsx): `frontend/src/components/TopGenesChart.jsx`
- [Gene table](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/GeneTable.jsx): `frontend/src/components/GeneTable.jsx`
- [Heatmap viewer](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/HeatmapViewer.jsx): `frontend/src/components/HeatmapViewer.jsx`
- [Download exports](https://github.com/aliviahossain/ai-risk-predictor/blob/main/frontend/src/components/DownloadButton.jsx): `frontend/src/components/DownloadButton.jsx`

### Other components

- **Researcher**
- **GEO repository**

## Connections

- Researcher → Input modes: selects input (evidence: `README.md`)
- Input modes → Raw upload form: renders (evidence: `frontend/src/pages/UploadPage.jsx`)
- Input modes → CSV parser: parses CSV (evidence: `frontend/src/pages/UploadPage.jsx`)
- Raw upload form → CSV parser: parses results (evidence: `frontend/src/components/RawUploadForm.jsx`)
- Input modes → API configuration: uses endpoint (evidence: `frontend/src/pages/UploadPage.jsx`)
- Raw upload form → API configuration: uses endpoint (evidence: `frontend/src/components/RawUploadForm.jsx`)
- FastAPI app → DEG CSV API: registers router (evidence: `backend/main.py`)
- FastAPI app → GEO job API: registers router (evidence: `backend/main.py`)
- Input modes → DEG CSV API: uploads result CSV (evidence: `README.md`)
- Input modes → GEO job API: starts or polls job (evidence: `frontend/src/pages/UploadPage.jsx`)
- Raw upload form → GEO job API: starts or polls job (evidence: `README.md`)
- GEO job API → DEG R pipeline: runs pipeline (evidence: `README.md`)
- GEO repository → GEO job API: provides dataset (evidence: `README.md`)
- GEO job API → Input modes: returns job results (evidence: `frontend/src/pages/UploadPage.jsx`)
- API configuration → GEO job API: targets API (evidence: `frontend/src/config.js`)
- Application state → Input modes: shows input (evidence: `frontend/src/App.js`)
- Application state → Results dashboard: shows results (evidence: `frontend/src/App.js`)
- Input modes → Application state: passes parsed genes (evidence: `frontend/src/pages/UploadPage.jsx`)
- Results dashboard → Summary statistics: computes statistics (evidence: `frontend/src/pages/ResultsPage.jsx`)
- Results dashboard → Volcano plot: renders (evidence: `frontend/src/pages/ResultsPage.jsx`)
- Results dashboard → MA plot: renders (evidence: `frontend/src/pages/ResultsPage.jsx`)
- Results dashboard → Top genes chart: renders (evidence: `frontend/src/pages/ResultsPage.jsx`)
- Results dashboard → Gene table: renders (evidence: `frontend/src/pages/ResultsPage.jsx`)
- Results dashboard → Heatmap viewer: renders (evidence: `frontend/src/pages/ResultsPage.jsx`)
- Results dashboard → Download exports: renders (evidence: `frontend/src/pages/ResultsPage.jsx`)
- Results dashboard → API configuration: uses endpoint (evidence: `frontend/src/pages/ResultsPage.jsx`)
- Heatmap viewer → GEO job API: fetches heatmap (evidence: `README.md`)
