# kaesit/oncomind architecture

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

- Interactive diagram: https://gitdiagram.com/kaesit/oncomind
- Repository: https://github.com/kaesit/oncomind

## Overview

OncoMind is an experimental cancer-research and clinical-exploration platform: medical staff use a web dashboard to manage patient records, review analyses, and explore treatment and drug-candidate tools. The frontend calls the .NET API for patient operations; the API persists clinical data in MongoDB and has a Python ML client for model-backed capabilities. The README also describes dataset/model management, toxicity visualization, and educational pages. Some of these branches are represented from documented capabilities because their implementation was not sampled; dashed, unevidenced links mark uncertain wiring.

Main entry points: [`oncomind-frontend/src/main.tsx`](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/main.tsx) (App routes), [`OncoMind.Api/Program.cs`](https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Program.cs) (HTTP API), [`oncomind-frontend/src/services/patientService.ts`](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/services/patientService.ts) (Patient API client), [`OncoMind.Api/Controllers/AnalysisController.cs`](https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Controllers/AnalysisController.cs) (Analysis routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_frontend_routes["App routes<br/>[main.tsx]"]
  node_patient_ui["Patient registry<br/>[Patients.tsx]"]
  node_patient_detail_ui["Patient history<br/>[PatientInfo.tsx]"]
  node_analytics_ui["Clinical analytics"]
  node_treatment_ui["Treatment tools"]
  node_drug_ui["Drug candidates<br/>[DrugCandidates.tsx]"]
  node_toxicity_ui["Toxicity view"]
  node_anatomy_view["Body visualization<br/>[AnatomyView.tsx]"]
  node_patient_client["Patient API client<br/>[patientService.ts]"]
end

subgraph group_clinical["Clinical API"]
  node_api_host["HTTP API<br/>[Program.cs]"]
  node_patient_routes["Patient routes"]
  node_analysis_routes["Analysis routes"]
  node_drug_routes["Candidate routes"]
  node_admin_routes["Dashboard routes"]
  node_auth_routes["Doctor access<br/>[AuthController.cs]"]
  node_patient_service["Patient service<br/>[PatientService.cs]"]
  node_mongo_context["Mongo collections<br/>[MongoDbContext.cs]"]
  node_mongo_store[("OncoMind database")]
  node_ml_client["Python ML client<br/>[PythonMLService.cs]"]
end

subgraph group_ml["ML research"]
  node_ml_api["ML endpoints<br/>[app.py]"]
  node_training["Model training<br/>[train.py]"]
  node_segmentation_training["Image segmentation"]
  node_dataset_tools["Research datasets"]
end

subgraph group_education["Research education"]
  node_awareness["Patient education<br/>[Awareness.tsx]"]
  node_research_page["Research overview<br/>[Research.tsx]"]
end

node_staff(("Medical staff"))
node_research_data[("Public research data")]

node_staff -->|"uses"| node_frontend_routes
node_frontend_routes -->|"routes to"| node_patient_ui
node_frontend_routes -->|"routes to"| node_patient_detail_ui
node_frontend_routes -->|"routes to"| node_analytics_ui
node_frontend_routes -->|"routes to"| node_treatment_ui
node_frontend_routes -->|"routes to"| node_drug_ui
node_patient_ui -->|"calls"| node_patient_client
node_patient_detail_ui -.->|"loads history"| node_patient_client
node_patient_client -->|"HTTP requests"| node_patient_routes
node_patient_client -->|"posts analyses"| node_analysis_routes
node_api_host -->|"maps"| node_patient_routes
node_api_host -->|"maps"| node_analysis_routes
node_api_host -->|"maps"| node_drug_routes
node_api_host -->|"maps"| node_admin_routes
node_api_host -->|"maps"| node_auth_routes
node_patient_routes -.->|"delegates"| node_patient_service
node_analysis_routes -->|"creates records"| node_patient_service
node_analysis_routes -->|"requests analysis"| node_ml_client
node_drug_routes -->|"requests candidates"| node_ml_client
node_admin_routes -->|"queries dashboard data"| node_mongo_context
node_auth_routes -->|"checks doctors"| node_mongo_context
node_patient_service -->|"reads and writes"| node_mongo_context
node_mongo_context -->|"stores collections"| node_mongo_store
node_ml_client -->|"HTTP requests"| node_ml_api
node_ml_api -.->|"uses trained models"| node_training
node_training -.->|"uses datasets"| node_dataset_tools
node_segmentation_training -.->|"trains on images"| node_research_data
node_dataset_tools -.->|"acquires data"| node_research_data
node_drug_ui -.->|"offers toxicity tool"| node_toxicity_ui
node_toxicity_ui -->|"visualizes organs"| node_anatomy_view
node_staff -->|"reads"| node_awareness
node_staff -->|"reads"| node_research_page
node_research_page -->|"describes acquisition"| node_research_data

click node_frontend_routes "https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/main.tsx"
click node_patient_ui "https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/dashboardpages/Patients.tsx"
click node_patient_detail_ui "https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/dashboardpages/PatientInfo.tsx"
click node_analytics_ui "https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/dashboardpages/DashboardAnalytics.tsx"
click node_treatment_ui "https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/dashboardpages/PersonalizedTreatment.tsx"
click node_drug_ui "https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/dashboardpages/DrugCandidates.tsx"
click node_toxicity_ui "https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/components/ToxicityAnalysisPopup.tsx"
click node_anatomy_view "https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/dashboard/anatomy/AnatomyView.tsx"
click node_patient_client "https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/services/patientService.ts"
click node_api_host "https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Program.cs"
click node_patient_routes "https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Controllers/PatientController.cs"
click node_analysis_routes "https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Controllers/AnalysisController.cs"
click node_drug_routes "https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Controllers/DrugCandidateController.cs"
click node_admin_routes "https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Controllers/DashboardController.cs"
click node_auth_routes "https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Controllers/AuthController.cs"
click node_patient_service "https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Services/PatientService.cs"
click node_mongo_context "https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Services/MongoDbContext.cs"
click node_ml_client "https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Services/PythonMLService.cs"
click node_ml_api "https://github.com/kaesit/oncomind/blob/main/oncomind-ml/app.py"
click node_training "https://github.com/kaesit/oncomind/blob/main/oncomind-ml/train.py"
click node_segmentation_training "https://github.com/kaesit/oncomind/blob/main/oncomind-ml/train_segmentation_model.py"
click node_dataset_tools "https://github.com/kaesit/oncomind/blob/main/oncomind-ml/download_datasets.py"
click node_awareness "https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/Awareness.tsx"
click node_research_page "https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/Research.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_frontend_routes,node_patient_ui,node_patient_detail_ui,node_analytics_ui,node_treatment_ui,node_drug_ui,node_toxicity_ui,node_anatomy_view,node_patient_client toneBlue
class node_api_host,node_patient_routes,node_analysis_routes,node_drug_routes,node_admin_routes,node_auth_routes,node_patient_service,node_mongo_context,node_mongo_store,node_ml_client,node_research_data toneAmber
class node_ml_api,node_training,node_segmentation_training,node_dataset_tools toneMint
class node_awareness,node_research_page toneRose
class node_staff toneIndigo
```

## Components

### Web experience

- [App routes](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/main.tsx): `oncomind-frontend/src/main.tsx`
- [Patient registry](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/dashboardpages/Patients.tsx): `oncomind-frontend/src/pages/dashboardpages/Patients.tsx`
- [Patient history](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/dashboardpages/PatientInfo.tsx): `oncomind-frontend/src/pages/dashboardpages/PatientInfo.tsx`
- [Clinical analytics](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/dashboardpages/DashboardAnalytics.tsx): `oncomind-frontend/src/pages/dashboardpages/DashboardAnalytics.tsx`
- [Treatment tools](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/dashboardpages/PersonalizedTreatment.tsx): `oncomind-frontend/src/pages/dashboardpages/PersonalizedTreatment.tsx`
- [Drug candidates](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/dashboardpages/DrugCandidates.tsx): `oncomind-frontend/src/pages/dashboardpages/DrugCandidates.tsx`
- [Toxicity view](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/components/ToxicityAnalysisPopup.tsx): `oncomind-frontend/src/components/ToxicityAnalysisPopup.tsx`
- [Body visualization](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/dashboard/anatomy/AnatomyView.tsx): `oncomind-frontend/src/dashboard/anatomy/AnatomyView.tsx`
- [Patient API client](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/services/patientService.ts): `oncomind-frontend/src/services/patientService.ts`

### Clinical API

- [HTTP API](https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Program.cs): `OncoMind.Api/Program.cs`
- [Patient routes](https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Controllers/PatientController.cs): `OncoMind.Api/Controllers/PatientController.cs`
- [Analysis routes](https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Controllers/AnalysisController.cs): `OncoMind.Api/Controllers/AnalysisController.cs`
- [Candidate routes](https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Controllers/DrugCandidateController.cs): `OncoMind.Api/Controllers/DrugCandidateController.cs`
- [Dashboard routes](https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Controllers/DashboardController.cs): `OncoMind.Api/Controllers/DashboardController.cs`
- [Doctor access](https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Controllers/AuthController.cs): `OncoMind.Api/Controllers/AuthController.cs`
- [Patient service](https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Services/PatientService.cs): `OncoMind.Api/Services/PatientService.cs`
- [Mongo collections](https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Services/MongoDbContext.cs): `OncoMind.Api/Services/MongoDbContext.cs`
- **OncoMind database**
- [Python ML client](https://github.com/kaesit/oncomind/blob/main/OncoMind.Api/Services/PythonMLService.cs): `OncoMind.Api/Services/PythonMLService.cs`

### ML research

- [ML endpoints](https://github.com/kaesit/oncomind/blob/main/oncomind-ml/app.py): `oncomind-ml/app.py`
- [Model training](https://github.com/kaesit/oncomind/blob/main/oncomind-ml/train.py): `oncomind-ml/train.py`
- [Image segmentation](https://github.com/kaesit/oncomind/blob/main/oncomind-ml/train_segmentation_model.py): `oncomind-ml/train_segmentation_model.py`
- [Research datasets](https://github.com/kaesit/oncomind/blob/main/oncomind-ml/download_datasets.py): `oncomind-ml/download_datasets.py`

### Research education

- [Patient education](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/Awareness.tsx): `oncomind-frontend/src/pages/Awareness.tsx`
- [Research overview](https://github.com/kaesit/oncomind/blob/main/oncomind-frontend/src/pages/Research.tsx): `oncomind-frontend/src/pages/Research.tsx`

### Other components

- **Medical staff**
- **Public research data**

## Connections

- Medical staff → App routes: uses (evidence: `oncomind-frontend/src/main.tsx`)
- App routes → Patient registry: routes to (evidence: `oncomind-frontend/src/main.tsx`)
- App routes → Patient history: routes to (evidence: `oncomind-frontend/src/main.tsx`)
- App routes → Clinical analytics: routes to (evidence: `oncomind-frontend/src/main.tsx`)
- App routes → Treatment tools: routes to (evidence: `oncomind-frontend/src/main.tsx`)
- App routes → Drug candidates: routes to (evidence: `oncomind-frontend/src/main.tsx`)
- Patient registry → Patient API client: calls (evidence: `oncomind-frontend/src/pages/dashboardpages/Patients.tsx`)
- Patient history → Patient API client: loads history
- Patient API client → Patient routes: HTTP requests (evidence: `oncomind-frontend/src/services/patientService.ts`)
- Patient API client → Analysis routes: posts analyses (evidence: `oncomind-frontend/src/services/patientService.ts`)
- HTTP API → Patient routes: maps (evidence: `OncoMind.Api/Program.cs`)
- HTTP API → Analysis routes: maps (evidence: `OncoMind.Api/Program.cs`)
- HTTP API → Candidate routes: maps (evidence: `OncoMind.Api/Program.cs`)
- HTTP API → Dashboard routes: maps (evidence: `OncoMind.Api/Program.cs`)
- HTTP API → Doctor access: maps (evidence: `OncoMind.Api/Program.cs`)
- Patient routes → Patient service: delegates
- Analysis routes → Patient service: creates records (evidence: `OncoMind.Api/Controllers/AnalysisController.cs`)
- Analysis routes → Python ML client: requests analysis (evidence: `OncoMind.Api/Controllers/AnalysisController.cs`)
- Candidate routes → Python ML client: requests candidates (evidence: `OncoMind.Api/Controllers/DrugCandidateController.cs`)
- Dashboard routes → Mongo collections: queries dashboard data (evidence: `OncoMind.Api/Controllers/DashboardController.cs`)
- Doctor access → Mongo collections: checks doctors (evidence: `OncoMind.Api/Controllers/AuthController.cs`)
- Patient service → Mongo collections: reads and writes (evidence: `OncoMind.Api/Services/PatientService.cs`)
- Mongo collections → OncoMind database: stores collections (evidence: `OncoMind.Api/Services/MongoDbContext.cs`)
- Python ML client → ML endpoints: HTTP requests (evidence: `OncoMind.Api/Services/PythonMLService.cs`)
- ML endpoints → Model training: uses trained models
- Model training → Research datasets: uses datasets
- Image segmentation → Public research data: trains on images
- Research datasets → Public research data: acquires data
- Drug candidates → Toxicity view: offers toxicity tool
- Toxicity view → Body visualization: visualizes organs
- Medical staff → Patient education: reads
- Medical staff → Research overview: reads
- Research overview → Public research data: describes acquisition (evidence: `oncomind-frontend/src/pages/Research.tsx`)
