# lekhan-blaze/oncoaifusion architecture

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

- Interactive diagram: https://gitdiagram.com/lekhan-blaze/oncoaifusion
- Repository: https://github.com/lekhan-blaze/oncoaifusion

## Overview

OncoAI Fusion is a browser-based medical-image classification platform: users upload an image, the API detects or accepts a cancer type, a corresponding classifier returns predictions and probabilities, and users can request a structured diagnostic report. The report route can augment its template with Groq-generated content. The graph preserves all eight documented classifier services and the main API/UI modules. Edges reflect the supplied source index, excerpts, or README; unsampled modules are included where substantial, but are not assigned speculative connections.

Main entry points: [`backend/app/routes/predict.py`](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/routes/predict.py) (Prediction endpoints), [`backend/main.py`](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/main.py) (FastAPI application), [`frontend/src/App.jsx`](https://github.com/lekhan-blaze/oncoaifusion/blob/main/frontend/src/App.jsx) (Diagnostic dashboard), [`backend/app/routes/report.py`](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/routes/report.py) (Report endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_ui["Diagnostic dashboard<br/>[App.jsx]"]
  node_app_entry["React entry<br/>[main.jsx]"]
end

subgraph group_api["API routing"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_health_route["Health endpoint<br/>[health.py]"]
  node_predict_route["Prediction endpoints<br/>[predict.py]"]
  node_report_route["Report endpoints<br/>[report.py]"]
end

subgraph group_classification["Image classification"]
  node_brain_classifier["Brain classifier"]
  node_breast_classifier["Breast classifier"]
  node_cervical_classifier["Cervical classifier"]
  node_colon_classifier["Colon classifier"]
  node_kidney_classifier["Kidney classifier"]
  node_lung_classifier["Lung classifier"]
  node_lymphoma_classifier["Lymphoma classifier"]
  node_oral_classifier["Oral classifier"]
  node_inference_service["Inference service<br/>[inference.py]"]
  node_resnet_model["ResNet50 model<br/>[resnet50.py]"]
end

subgraph group_reporting["Reports and configuration"]
  node_llm_service["LLM report generator<br/>[llm_service.py]"]
  node_settings["Application settings<br/>[settings.py]"]
end

node_browser(("User browser"))
node_groq{{"Groq API"}}

node_browser -->|"uses"| node_ui
node_app_entry -->|"renders"| node_ui
node_ui -->|"HTTP requests"| node_api_app
node_api_app -->|"registers"| node_health_route
node_api_app -->|"registers"| node_predict_route
node_api_app -->|"registers"| node_report_route
node_predict_route -->|"dispatches"| node_brain_classifier
node_predict_route -->|"dispatches"| node_breast_classifier
node_predict_route -->|"dispatches"| node_cervical_classifier
node_predict_route -->|"dispatches"| node_colon_classifier
node_predict_route -->|"dispatches"| node_kidney_classifier
node_predict_route -->|"dispatches"| node_lung_classifier
node_predict_route -->|"dispatches"| node_lymphoma_classifier
node_predict_route -->|"dispatches"| node_oral_classifier
node_report_route -->|"requests analysis"| node_llm_service
node_llm_service -.->|"generates report"| node_groq

click node_ui "https://github.com/lekhan-blaze/oncoaifusion/blob/main/frontend/src/App.jsx"
click node_app_entry "https://github.com/lekhan-blaze/oncoaifusion/blob/main/frontend/src/main.jsx"
click node_api_app "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/main.py"
click node_health_route "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/routes/health.py"
click node_predict_route "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/routes/predict.py"
click node_report_route "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/routes/report.py"
click node_brain_classifier "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/brain_cancer_inference.py"
click node_breast_classifier "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/breast_cancer_inference.py"
click node_cervical_classifier "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/cervical_cancer_inference.py"
click node_colon_classifier "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/colon_cancer_inference.py"
click node_kidney_classifier "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/kidney_cancer_inference.py"
click node_lung_classifier "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/lung_cancer_inference.py"
click node_lymphoma_classifier "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/lymphoma_inference.py"
click node_oral_classifier "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/oral_cancer_inference.py"
click node_inference_service "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/inference.py"
click node_resnet_model "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/models/resnet50.py"
click node_llm_service "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/llm_service.py"
click node_settings "https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/config/settings.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_ui,node_app_entry,node_browser toneBlue
class node_api_app,node_health_route,node_predict_route,node_report_route toneAmber
class node_brain_classifier,node_breast_classifier,node_cervical_classifier,node_colon_classifier,node_kidney_classifier,node_lung_classifier,node_lymphoma_classifier,node_oral_classifier,node_inference_service,node_resnet_model,node_groq toneMint
class node_llm_service,node_settings toneRose
```

## Components

### Web interface

- [Diagnostic dashboard](https://github.com/lekhan-blaze/oncoaifusion/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [React entry](https://github.com/lekhan-blaze/oncoaifusion/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`

### API routing

- [FastAPI application](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/main.py): `backend/main.py`
- [Health endpoint](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/routes/health.py): `backend/app/routes/health.py`
- [Prediction endpoints](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/routes/predict.py): `backend/app/routes/predict.py`
- [Report endpoints](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/routes/report.py): `backend/app/routes/report.py`

### Image classification

- [Brain classifier](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/brain_cancer_inference.py): `backend/app/services/brain_cancer_inference.py`
- [Breast classifier](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/breast_cancer_inference.py): `backend/app/services/breast_cancer_inference.py`
- [Cervical classifier](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/cervical_cancer_inference.py): `backend/app/services/cervical_cancer_inference.py`
- [Colon classifier](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/colon_cancer_inference.py): `backend/app/services/colon_cancer_inference.py`
- [Kidney classifier](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/kidney_cancer_inference.py): `backend/app/services/kidney_cancer_inference.py`
- [Lung classifier](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/lung_cancer_inference.py): `backend/app/services/lung_cancer_inference.py`
- [Lymphoma classifier](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/lymphoma_inference.py): `backend/app/services/lymphoma_inference.py`
- [Oral classifier](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/oral_cancer_inference.py): `backend/app/services/oral_cancer_inference.py`
- [Inference service](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/inference.py): `backend/app/services/inference.py`
- [ResNet50 model](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/models/resnet50.py): `backend/app/models/resnet50.py`

### Reports and configuration

- [LLM report generator](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/services/llm_service.py): `backend/app/services/llm_service.py`
- [Application settings](https://github.com/lekhan-blaze/oncoaifusion/blob/main/backend/app/config/settings.py): `backend/app/config/settings.py`

### Other components

- **User browser**
- **Groq API**

## Connections

- User browser → Diagnostic dashboard: uses (evidence: `README.md`)
- React entry → Diagnostic dashboard: renders (evidence: `frontend/src/main.jsx`)
- Diagnostic dashboard → FastAPI application: HTTP requests (evidence: `README.md`)
- FastAPI application → Health endpoint: registers (evidence: `backend/main.py`)
- FastAPI application → Prediction endpoints: registers (evidence: `backend/main.py`)
- FastAPI application → Report endpoints: registers (evidence: `backend/main.py`)
- Prediction endpoints → Brain classifier: dispatches (evidence: `backend/app/routes/predict.py`)
- Prediction endpoints → Breast classifier: dispatches (evidence: `backend/app/routes/predict.py`)
- Prediction endpoints → Cervical classifier: dispatches (evidence: `backend/app/routes/predict.py`)
- Prediction endpoints → Colon classifier: dispatches (evidence: `backend/app/routes/predict.py`)
- Prediction endpoints → Kidney classifier: dispatches (evidence: `backend/app/routes/predict.py`)
- Prediction endpoints → Lung classifier: dispatches (evidence: `backend/app/routes/predict.py`)
- Prediction endpoints → Lymphoma classifier: dispatches (evidence: `backend/app/routes/predict.py`)
- Prediction endpoints → Oral classifier: dispatches (evidence: `backend/app/routes/predict.py`)
- Report endpoints → LLM report generator: requests analysis (evidence: `backend/app/routes/report.py`)
- LLM report generator → Groq API: generates report (evidence: `backend/app/services/llm_service.py`)
