# solfazzer/derma-ai architecture

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

- Interactive diagram: https://gitdiagram.com/solfazzer/derma-ai
- Repository: https://github.com/solfazzer/derma-ai

## Overview

Derma-AI is an academic prototype for dermoscopic-image classification and Grad-CAM explanations, but the checked-in runtime is currently only a FastAPI health endpoint. The documented broader workflow includes a web interface, model training, and local model use; those capabilities are represented as planned or documented components, not as implemented request flow. The API reads settings from environment-backed configuration. Edges for training and model handling follow README statements; unsampled implementation details are intentionally left unconnected.

Main entry points: [`app/main.py`](https://github.com/solfazzer/derma-ai/blob/main/app/main.py) (FastAPI service), [`app`](https://github.com/solfazzer/derma-ai/tree/main/app) (Image classification), [`frontend`](https://github.com/solfazzer/derma-ai/tree/main/frontend) (Web interface), [`models`](https://github.com/solfazzer/derma-ai/tree/main/models) (Local model file)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_api["FastAPI service<br/>[main.py]"]
  node_health["Health endpoint<br/>[main.py]"]
  node_settings["Runtime settings<br/>[config.py]"]
end

subgraph group_prediction["Prediction product"]
  node_web["Web interface"]
  node_image_classification["Image classification"]
  node_gradcam["Grad-CAM explanation"]
end

subgraph group_training["Model lifecycle"]
  node_training_notebook["HAM10000 training"]
  node_model_file["Local model file"]
  node_local_data[("Local data and SQLite")]
end

node_user(("User"))
node_drive[("Google Drive")]

node_user -->|"requests health"| node_api
node_api -->|"routes health"| node_health
node_api -->|"reads settings"| node_settings
node_user -.->|"uses interface"| node_web
node_web -.->|"submits images"| node_image_classification
node_image_classification -.->|"explains prediction"| node_gradcam
node_training_notebook -->|"stores model"| node_drive
node_drive -->|"copies model"| node_model_file
node_model_file -.->|"provides model"| node_image_classification

click node_api "https://github.com/solfazzer/derma-ai/blob/main/app/main.py"
click node_health "https://github.com/solfazzer/derma-ai/blob/main/app/main.py"
click node_settings "https://github.com/solfazzer/derma-ai/blob/main/app/config.py"
click node_web "https://github.com/solfazzer/derma-ai/tree/main/frontend"
click node_image_classification "https://github.com/solfazzer/derma-ai/tree/main/app"
click node_gradcam "https://github.com/solfazzer/derma-ai/tree/main/app"
click node_training_notebook "https://github.com/solfazzer/derma-ai/blob/main/notebooks/01_entrenamiento_ham10000.ipynb"
click node_model_file "https://github.com/solfazzer/derma-ai/tree/main/models"
click node_local_data "https://github.com/solfazzer/derma-ai/tree/main/data"

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_api,node_health,node_settings,node_user toneBlue
class node_web,node_image_classification,node_gradcam,node_drive toneAmber
class node_training_notebook,node_model_file,node_local_data toneMint
```

## Components

### API

- [FastAPI service](https://github.com/solfazzer/derma-ai/blob/main/app/main.py): `app/main.py`
- [Health endpoint](https://github.com/solfazzer/derma-ai/blob/main/app/main.py): `app/main.py`
- [Runtime settings](https://github.com/solfazzer/derma-ai/blob/main/app/config.py): `app/config.py`

### Prediction product

- [Web interface](https://github.com/solfazzer/derma-ai/tree/main/frontend): `frontend`
- [Image classification](https://github.com/solfazzer/derma-ai/tree/main/app): `app`
- [Grad-CAM explanation](https://github.com/solfazzer/derma-ai/tree/main/app): `app`

### Model lifecycle

- [HAM10000 training](https://github.com/solfazzer/derma-ai/blob/main/notebooks/01_entrenamiento_ham10000.ipynb): `notebooks/01_entrenamiento_ham10000.ipynb`
- [Local model file](https://github.com/solfazzer/derma-ai/tree/main/models): `models`
- [Local data and SQLite](https://github.com/solfazzer/derma-ai/tree/main/data): `data`

### Other components

- **User**
- **Google Drive**

## Connections

- User → FastAPI service: requests health (evidence: `README.md`)
- FastAPI service → Health endpoint: routes health (evidence: `app/main.py`)
- FastAPI service → Runtime settings: reads settings (evidence: `app/main.py`)
- User → Web interface: uses interface (evidence: `README.md`)
- Web interface → Image classification: submits images
- Image classification → Grad-CAM explanation: explains prediction (evidence: `README.md`)
- HAM10000 training → Google Drive: stores model (evidence: `README.md`)
- Google Drive → Local model file: copies model (evidence: `README.md`)
- Local model file → Image classification: provides model (evidence: `README.md`)
