# kishore-in2007/ml_pbl architecture

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

- Interactive diagram: https://gitdiagram.com/kishore-in2007/ml_pbl
- Repository: https://github.com/kishore-in2007/ml_pbl

## Overview

Vithara is a patient-and-clinician wound-recovery platform: patients authenticate, submit wound images and symptoms, and review AI assessment and recovery progress; clinicians review cases, triage alerts, and coordinate follow-up. The backend routes these workflows across persistence, image storage, ML inference, healing evaluation, and escalation. The README documents scratch-trained multi-task classification/segmentation, infection and erythema assessment, temporal healing velocity, and automated appointments. The graph combines excerpted wiring and SOURCE INDEX references with README-documented capabilities; unsampled internals are represented only where paths are supported.

Main entry points: [`Backend/app/main.py`](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/main.py) (FastAPI application), [`Backend/app/models.py`](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/models.py) (Clinical records), [`Backend/app/routers/patients.py`](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/patients.py) (Patient routes), [`Frontend/src/App.jsx`](https://github.com/kishore-in2007/ml_pbl/blob/main/Frontend/src/App.jsx) (Portal routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Patient and clinician portals"]
  node_app["Portal routes<br/>[App.jsx]"]
  node_login["Login and registration<br/>[Login.jsx]"]
  node_patient_views["Patient care views"]
  node_doctor_views["Clinician views"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["Backend API and workflows"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_auth_router["Authentication routes<br/>[auth.py]"]
  node_patient_router["Patient routes<br/>[patients.py]"]
  node_doctor_router["Doctor routes<br/>[doctors.py]"]
  node_classify_router["Classification routes<br/>[classify.py]"]
  node_segment_router["Segmentation routes<br/>[segment.py]"]
  node_triage_router["Triage routes<br/>[triage.py]"]
end

subgraph group_clinical["Clinical data and escalation"]
  node_recovery["Healing evaluation<br/>[recovery.py]"]
  node_doctor_services["Alerts and appointments<br/>[doctor_services.py]"]
  node_triage_logic["Triage assessment<br/>[triage.py]"]
end

subgraph group_ml["Wound AI and recovery"]
  node_classifier["Wound classification<br/>[classify.py]"]
  node_segmenter["Wound segmentation<br/>[segment.py]"]
  node_healing_engine["Healing velocity engine<br/>[healing_engine.py]"]
  node_training_model["Scratch multi-task model<br/>[vitharanet.py]"]
  node_cli["Diagnostic CLI<br/>[run_model.py]"]
end

subgraph group_storage["Persistence and media"]
  node_models[("Clinical records<br/>[models.py]")]
  node_database[("Database sessions<br/>[database.py]")]
  node_media[("Image storage<br/>[storage.py]")]
end

node_patient(("Patient"))
node_clinician(("Clinician"))

node_patient -->|"uses portal"| node_app
node_clinician -->|"uses portal"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_patient_views
node_app -->|"routes to"| node_doctor_views
node_login -->|"requests auth"| node_api_client
node_patient_views -->|"requests care data"| node_api_client
node_doctor_views -->|"requests clinical data"| node_api_client
node_api_client -->|"sends API requests"| node_backend
node_backend -->|"registers routes"| node_auth_router
node_backend -->|"registers routes"| node_patient_router
node_backend -->|"registers routes"| node_doctor_router
node_backend -->|"registers routes"| node_classify_router
node_backend -->|"registers routes"| node_segment_router
node_backend -->|"registers routes"| node_triage_router
node_auth_router -->|"queries sessions"| node_database
node_auth_router -->|"reads and creates users"| node_models
node_patient_router -->|"queries sessions"| node_database
node_patient_router -->|"reads and writes records"| node_models
node_patient_router -->|"evaluates recovery"| node_recovery
node_patient_router -->|"handles wound media"| node_media
node_doctor_router -->|"reads clinical records"| node_models
node_doctor_router -->|"uses care services"| node_doctor_services
node_classify_router -->|"requests classification"| node_classifier
node_classify_router -->|"stores assessment"| node_models
node_classify_router -->|"stores images"| node_media
node_segment_router -->|"requests segmentation"| node_segmenter
node_segment_router -->|"stores image outputs"| node_media
node_triage_router -->|"assesses triage"| node_triage_logic
node_triage_router -->|"dispatches notifications"| node_doctor_services
node_triage_router -->|"records triage cases"| node_models
node_recovery -.->|"uses velocity logic"| node_healing_engine
node_doctor_services -->|"creates appointments"| node_models
node_training_model -.->|"informs inference design"| node_classifier
node_cli -.->|"runs model inference"| node_training_model

click node_app "https://github.com/kishore-in2007/ml_pbl/blob/main/Frontend/src/App.jsx"
click node_login "https://github.com/kishore-in2007/ml_pbl/blob/main/Frontend/src/pages/common/Login.jsx"
click node_patient_views "https://github.com/kishore-in2007/ml_pbl/tree/main/Frontend/src/pages/patient"
click node_doctor_views "https://github.com/kishore-in2007/ml_pbl/tree/main/Frontend/src/pages/doctor"
click node_api_client "https://github.com/kishore-in2007/ml_pbl/blob/main/Frontend/src/api/api.js"
click node_backend "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/main.py"
click node_auth_router "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/auth.py"
click node_patient_router "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/patients.py"
click node_doctor_router "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/doctors.py"
click node_classify_router "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/classify.py"
click node_segment_router "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/segment.py"
click node_triage_router "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/triage.py"
click node_recovery "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/recovery.py"
click node_doctor_services "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/doctor_services.py"
click node_triage_logic "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/triage.py"
click node_models "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/models.py"
click node_database "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/database.py"
click node_media "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/storage.py"
click node_classifier "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/ml/classify.py"
click node_segmenter "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/ml/segment.py"
click node_healing_engine "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/Ml_training/src/healing_engine.py"
click node_training_model "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/Ml_training/src/vitharanet.py"
click node_cli "https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/Ml_training/run_model.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_app,node_login,node_patient_views,node_doctor_views,node_api_client toneBlue
class node_backend,node_auth_router,node_patient_router,node_doctor_router,node_classify_router,node_segment_router,node_triage_router toneAmber
class node_recovery,node_doctor_services,node_triage_logic toneMint
class node_classifier,node_segmenter,node_healing_engine,node_training_model,node_cli toneRose
class node_models,node_database,node_media,node_patient,node_clinician toneIndigo
```

## Components

### Patient and clinician portals

- [Portal routes](https://github.com/kishore-in2007/ml_pbl/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Login and registration](https://github.com/kishore-in2007/ml_pbl/blob/main/Frontend/src/pages/common/Login.jsx): `Frontend/src/pages/common/Login.jsx`
- [Patient care views](https://github.com/kishore-in2007/ml_pbl/tree/main/Frontend/src/pages/patient): `Frontend/src/pages/patient`
- [Clinician views](https://github.com/kishore-in2007/ml_pbl/tree/main/Frontend/src/pages/doctor): `Frontend/src/pages/doctor`
- [API client](https://github.com/kishore-in2007/ml_pbl/blob/main/Frontend/src/api/api.js): `Frontend/src/api/api.js`

### Backend API and workflows

- [FastAPI application](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/main.py): `Backend/app/main.py`
- [Authentication routes](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/auth.py): `Backend/app/routers/auth.py`
- [Patient routes](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/patients.py): `Backend/app/routers/patients.py`
- [Doctor routes](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/doctors.py): `Backend/app/routers/doctors.py`
- [Classification routes](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/classify.py): `Backend/app/routers/classify.py`
- [Segmentation routes](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/segment.py): `Backend/app/routers/segment.py`
- [Triage routes](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/routers/triage.py): `Backend/app/routers/triage.py`

### Clinical data and escalation

- [Healing evaluation](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/recovery.py): `Backend/app/recovery.py`
- [Alerts and appointments](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/doctor_services.py): `Backend/app/doctor_services.py`
- [Triage assessment](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/triage.py): `Backend/app/triage.py`

### Wound AI and recovery

- [Wound classification](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/ml/classify.py): `Backend/app/ml/classify.py`
- [Wound segmentation](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/ml/segment.py): `Backend/app/ml/segment.py`
- [Healing velocity engine](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/Ml_training/src/healing_engine.py): `Backend/Ml_training/src/healing_engine.py`
- [Scratch multi-task model](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/Ml_training/src/vitharanet.py): `Backend/Ml_training/src/vitharanet.py`
- [Diagnostic CLI](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/Ml_training/run_model.py): `Backend/Ml_training/run_model.py`

### Persistence and media

- [Clinical records](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/models.py): `Backend/app/models.py`
- [Database sessions](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/database.py): `Backend/app/database.py`
- [Image storage](https://github.com/kishore-in2007/ml_pbl/blob/main/Backend/app/storage.py): `Backend/app/storage.py`

### Other components

- **Patient**
- **Clinician**

## Connections

- Patient → Portal routes: uses portal (evidence: `README.md`)
- Clinician → Portal routes: uses portal (evidence: `README.md`)
- Portal routes → Login and registration: routes to (evidence: `Frontend/src/App.jsx`)
- Portal routes → Patient care views: routes to (evidence: `Frontend/src/App.jsx`)
- Portal routes → Clinician views: routes to (evidence: `Frontend/src/App.jsx`)
- Login and registration → API client: requests auth (evidence: `Frontend/src/pages/common/Login.jsx`)
- Patient care views → API client: requests care data (evidence: `Frontend/src/pages/patient/CaptureWoundPhoto.jsx`)
- Clinician views → API client: requests clinical data (evidence: `Frontend/src/pages/doctor/WoundReview.jsx`)
- API client → FastAPI application: sends API requests (evidence: `README.md`)
- FastAPI application → Authentication routes: registers routes (evidence: `Backend/app/main.py`)
- FastAPI application → Patient routes: registers routes (evidence: `Backend/app/main.py`)
- FastAPI application → Doctor routes: registers routes (evidence: `Backend/app/main.py`)
- FastAPI application → Classification routes: registers routes (evidence: `Backend/app/main.py`)
- FastAPI application → Segmentation routes: registers routes (evidence: `Backend/app/main.py`)
- FastAPI application → Triage routes: registers routes (evidence: `Backend/app/main.py`)
- Authentication routes → Database sessions: queries sessions (evidence: `Backend/app/routers/auth.py`)
- Authentication routes → Clinical records: reads and creates users (evidence: `Backend/app/routers/auth.py`)
- Patient routes → Database sessions: queries sessions (evidence: `Backend/app/routers/patients.py`)
- Patient routes → Clinical records: reads and writes records (evidence: `Backend/app/routers/patients.py`)
- Patient routes → Healing evaluation: evaluates recovery (evidence: `Backend/app/routers/patients.py`)
- Patient routes → Image storage: handles wound media
- Doctor routes → Clinical records: reads clinical records (evidence: `Backend/app/routers/doctors.py`)
- Doctor routes → Alerts and appointments: uses care services (evidence: `Backend/app/routers/doctors.py`)
- Classification routes → Wound classification: requests classification (evidence: `Backend/app/routers/classify.py`)
- Classification routes → Clinical records: stores assessment (evidence: `Backend/app/routers/classify.py`)
- Classification routes → Image storage: stores images (evidence: `Backend/app/routers/classify.py`)
- Segmentation routes → Wound segmentation: requests segmentation (evidence: `Backend/app/routers/segment.py`)
- Segmentation routes → Image storage: stores image outputs (evidence: `Backend/app/routers/segment.py`)
- Triage routes → Triage assessment: assesses triage (evidence: `Backend/app/routers/triage.py`)
- Triage routes → Alerts and appointments: dispatches notifications (evidence: `Backend/app/routers/triage.py`)
- Triage routes → Clinical records: records triage cases (evidence: `Backend/app/routers/triage.py`)
- Healing evaluation → Healing velocity engine: uses velocity logic
- Alerts and appointments → Clinical records: creates appointments (evidence: `Backend/app/doctor_services.py`)
- Scratch multi-task model → Wound classification: informs inference design
- Diagnostic CLI → Scratch multi-task model: runs model inference
