# samridh-kumar/cifa architecture

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

- Interactive diagram: https://gitdiagram.com/samridh-kumar/cifa
- Repository: https://github.com/samridh-kumar/cifa

## Overview

Cifa is presented as an AI-assisted cancer-diagnosis website. The implemented workflow is image selection in the browser, submission to Flask’s brain or oral prediction endpoint, model inference, and display of the returned prediction. The repository also contains training datasets and model notebooks. The README describes account management, Firebase storage, lung-cancer detection, and care recommendations, but the sampled runtime source does not establish those flows; they are not drawn as implemented components.

Main entry points: [`app.py`](https://github.com/samridh-kumar/cifa/blob/main/app.py) (Flask API), [`script.js`](https://github.com/samridh-kumar/cifa/blob/main/script.js) (Upload and submit), [`index.html`](https://github.com/samridh-kumar/cifa/blob/main/index.html) (Diagnosis page), [`Dataset_for_Brain_tumor`](https://github.com/samridh-kumar/cifa/tree/main/Dataset_for_Brain_tumor) (Brain image data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_page["Diagnosis page<br/>[index.html]"]
  node_browser["Upload and submit<br/>[script.js]"]
  node_result["Prediction display<br/>[result.html]"]
end

subgraph group_inference["Image inference"]
  node_api["Flask API<br/>[app.py]"]
  node_brain["Brain inference<br/>[app.py]"]
  node_oral["Oral inference<br/>[app.py]"]
  node_brainmodel["Brain model"]
  node_oralmodel["Oral model"]
end

subgraph group_ml["Model development"]
  node_braindata["Brain image data"]
  node_oraldata["Oral image data"]
  node_braintrain["Brain model notebook"]
  node_oraltrain["Oral model notebook"]
end

node_patient(("Patient"))

node_patient -->|"opens"| node_page
node_page -->|"loads"| node_browser
node_browser -->|"posts image"| node_api
node_api -->|"dispatches"| node_brain
node_api -->|"dispatches"| node_oral
node_brain -->|"predicts with"| node_brainmodel
node_oral -->|"predicts with"| node_oralmodel
node_api -->|"returns prediction"| node_browser
node_browser -->|"navigates with result"| node_result
node_braindata --> node_braintrain
node_oraldata --> node_oraltrain

click node_page "https://github.com/samridh-kumar/cifa/blob/main/index.html"
click node_browser "https://github.com/samridh-kumar/cifa/blob/main/script.js"
click node_result "https://github.com/samridh-kumar/cifa/blob/main/result.html"
click node_api "https://github.com/samridh-kumar/cifa/blob/main/app.py"
click node_brain "https://github.com/samridh-kumar/cifa/blob/main/app.py"
click node_oral "https://github.com/samridh-kumar/cifa/blob/main/app.py"
click node_brainmodel "https://github.com/samridh-kumar/cifa/blob/main/models/brain_tumor_model.pkl"
click node_oralmodel "https://github.com/samridh-kumar/cifa/blob/main/models/oral_cancer_mode.keras"
click node_braindata "https://github.com/samridh-kumar/cifa/tree/main/Dataset_for_Brain_tumor"
click node_oraldata "https://github.com/samridh-kumar/cifa/tree/main/Oral_cancer_dataset"
click node_braintrain "https://github.com/samridh-kumar/cifa/blob/main/Full%20code%20for%20models/BrainTumor_ML_Model.ipynb"
click node_oraltrain "https://github.com/samridh-kumar/cifa/blob/main/Full%20code%20for%20models/Oral_Cancer_ML_Model.ipynb"

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_page,node_browser,node_result toneBlue
class node_api,node_brain,node_oral,node_brainmodel,node_oralmodel toneAmber
class node_braindata,node_oraldata,node_braintrain,node_oraltrain toneMint
class node_patient toneIndigo
```

## Components

### Web interface

- [Diagnosis page](https://github.com/samridh-kumar/cifa/blob/main/index.html): `index.html`
- [Upload and submit](https://github.com/samridh-kumar/cifa/blob/main/script.js): `script.js`
- [Prediction display](https://github.com/samridh-kumar/cifa/blob/main/result.html): `result.html`

### Image inference

- [Flask API](https://github.com/samridh-kumar/cifa/blob/main/app.py): `app.py`
- [Brain inference](https://github.com/samridh-kumar/cifa/blob/main/app.py): `app.py`
- [Oral inference](https://github.com/samridh-kumar/cifa/blob/main/app.py): `app.py`
- [Brain model](https://github.com/samridh-kumar/cifa/blob/main/models/brain_tumor_model.pkl): `models/brain_tumor_model.pkl`
- [Oral model](https://github.com/samridh-kumar/cifa/blob/main/models/oral_cancer_mode.keras): `models/oral_cancer_mode.keras`

### Model development

- [Brain image data](https://github.com/samridh-kumar/cifa/tree/main/Dataset_for_Brain_tumor): `Dataset_for_Brain_tumor`
- [Oral image data](https://github.com/samridh-kumar/cifa/tree/main/Oral_cancer_dataset): `Oral_cancer_dataset`
- [Brain model notebook](https://github.com/samridh-kumar/cifa/blob/main/Full%20code%20for%20models/BrainTumor_ML_Model.ipynb): `Full code for models/BrainTumor_ML_Model.ipynb`
- [Oral model notebook](https://github.com/samridh-kumar/cifa/blob/main/Full%20code%20for%20models/Oral_Cancer_ML_Model.ipynb): `Full code for models/Oral_Cancer_ML_Model.ipynb`

### Other components

- **Patient**

## Connections

- Patient → Diagnosis page: opens
- Diagnosis page → Upload and submit: loads
- Upload and submit → Flask API: posts image
- Flask API → Brain inference: dispatches
- Flask API → Oral inference: dispatches
- Brain inference → Brain model: predicts with
- Oral inference → Oral model: predicts with
- Flask API → Upload and submit: returns prediction
- Upload and submit → Prediction display: navigates with result
- Brain image data → Brain model notebook
- Oral image data → Oral model notebook
