# zrn2003/skinsightai architecture

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

- Interactive diagram: https://gitdiagram.com/zrn2003/skinsightai
- Repository: https://github.com/zrn2003/skinsightai

## Overview

SkinSight is a browser-based skin-image screening app backed by a FastAPI inference service. The user uploads an image; the backend preprocesses it, first checks whether it depicts skin, then runs a disease classifier and returns confidence/probabilities for the interface to present. The README also describes hair removal, CLAHE, color normalization, and the ResNet50–InceptionV3 ensemble. Backend stages share app.py; unsampled wiring is omitted or marked unverified.

Main entry points: [`frontend/src/pages/Index.tsx`](https://github.com/zrn2003/skinsightai/blob/main/frontend/src/pages/Index.tsx) (Scan workflow), [`app.py`](https://github.com/zrn2003/skinsightai/blob/main/app.py) (Prediction API), [`frontend/src/App.tsx`](https://github.com/zrn2003/skinsightai/blob/main/frontend/src/App.tsx) (App routing), [`frontend/src/components/PredictionResult.tsx`](https://github.com/zrn2003/skinsightai/blob/main/frontend/src/components/PredictionResult.tsx) (Prediction results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_entry["React entry<br/>[main.tsx]"]
  node_app["App routing<br/>[App.tsx]"]
  node_scanpage["Scan workflow<br/>[Index.tsx]"]
  node_uploader["Image uploader<br/>[ImageUploader.tsx]"]
  node_results["Prediction results"]
  node_confidence["Confidence display<br/>[ConfidenceBar.tsx]"]
  node_header["History header<br/>[Header.tsx]"]
  node_history[("Browser history")]
  node_notfound["Unknown route<br/>[NotFound.tsx]"]
end

subgraph group_backend["Inference service"]
  node_api["Prediction API<br/>[app.py]"]
  node_response["Inference response<br/>[app.py]"]
end

subgraph group_preprocess["Image preparation"]
  node_processor["Image processing<br/>[app.py]"]
end

subgraph group_models["Classification"]
  node_filter["Skin filter<br/>[app.py]"]
  node_diagnosis["Fusion diagnosis<br/>[app.py]"]
end

node_visitor(("User"))

node_entry -->|"renders"| node_app
node_app -->|"routes to"| node_scanpage
node_app -->|"routes to"| node_notfound
node_visitor -->|"uploads image"| node_uploader
node_scanpage -->|"uses"| node_uploader
node_scanpage -.->|"uses"| node_header
node_scanpage -->|"renders"| node_results
node_results -->|"renders"| node_confidence
node_scanpage -->|"reads"| node_history
node_scanpage -.->|"submits image"| node_api
node_api -->|"preprocesses"| node_processor
node_api -->|"runs filter"| node_filter
node_filter -->|"passes valid skin"| node_diagnosis
node_api -->|"returns result"| node_response
node_processor -->|"prepares input"| node_filter
node_processor -->|"prepares input"| node_diagnosis
node_api -->|"runs ensemble"| node_diagnosis
node_api -->|"reports filter-only fallback"| node_response

click node_entry "https://github.com/zrn2003/skinsightai/blob/main/frontend/src/main.tsx"
click node_app "https://github.com/zrn2003/skinsightai/blob/main/frontend/src/App.tsx"
click node_scanpage "https://github.com/zrn2003/skinsightai/blob/main/frontend/src/pages/Index.tsx"
click node_uploader "https://github.com/zrn2003/skinsightai/blob/main/frontend/src/components/ImageUploader.tsx"
click node_results "https://github.com/zrn2003/skinsightai/blob/main/frontend/src/components/PredictionResult.tsx"
click node_confidence "https://github.com/zrn2003/skinsightai/blob/main/frontend/src/components/ConfidenceBar.tsx"
click node_header "https://github.com/zrn2003/skinsightai/blob/main/frontend/src/components/Header.tsx"
click node_api "https://github.com/zrn2003/skinsightai/blob/main/app.py"
click node_processor "https://github.com/zrn2003/skinsightai/blob/main/app.py"
click node_filter "https://github.com/zrn2003/skinsightai/blob/main/app.py"
click node_diagnosis "https://github.com/zrn2003/skinsightai/blob/main/app.py"
click node_response "https://github.com/zrn2003/skinsightai/blob/main/app.py"
click node_notfound "https://github.com/zrn2003/skinsightai/blob/main/frontend/src/pages/NotFound.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_entry,node_app,node_scanpage,node_uploader,node_results,node_confidence,node_header,node_history,node_notfound,node_visitor toneBlue
class node_api,node_response toneAmber
class node_processor toneMint
class node_filter,node_diagnosis toneRose
```

## Components

### Frontend experience

- [React entry](https://github.com/zrn2003/skinsightai/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [App routing](https://github.com/zrn2003/skinsightai/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Scan workflow](https://github.com/zrn2003/skinsightai/blob/main/frontend/src/pages/Index.tsx): `frontend/src/pages/Index.tsx`
- [Image uploader](https://github.com/zrn2003/skinsightai/blob/main/frontend/src/components/ImageUploader.tsx): `frontend/src/components/ImageUploader.tsx`
- [Prediction results](https://github.com/zrn2003/skinsightai/blob/main/frontend/src/components/PredictionResult.tsx): `frontend/src/components/PredictionResult.tsx`
- [Confidence display](https://github.com/zrn2003/skinsightai/blob/main/frontend/src/components/ConfidenceBar.tsx): `frontend/src/components/ConfidenceBar.tsx`
- [History header](https://github.com/zrn2003/skinsightai/blob/main/frontend/src/components/Header.tsx): `frontend/src/components/Header.tsx`
- **Browser history**
- [Unknown route](https://github.com/zrn2003/skinsightai/blob/main/frontend/src/pages/NotFound.tsx): `frontend/src/pages/NotFound.tsx`

### Inference service

- [Prediction API](https://github.com/zrn2003/skinsightai/blob/main/app.py): `app.py`
- [Inference response](https://github.com/zrn2003/skinsightai/blob/main/app.py): `app.py`

### Image preparation

- [Image processing](https://github.com/zrn2003/skinsightai/blob/main/app.py): `app.py`

### Classification

- [Skin filter](https://github.com/zrn2003/skinsightai/blob/main/app.py): `app.py`
- [Fusion diagnosis](https://github.com/zrn2003/skinsightai/blob/main/app.py): `app.py`

### Other components

- **User**

## Connections

- React entry → App routing: renders (evidence: `frontend/src/main.tsx`)
- App routing → Scan workflow: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Unknown route: routes to (evidence: `frontend/src/App.tsx`)
- User → Image uploader: uploads image (evidence: `README.md`)
- Scan workflow → Image uploader: uses (evidence: `frontend/src/pages/Index.tsx`)
- Scan workflow → History header: uses
- Scan workflow → Prediction results: renders (evidence: `frontend/src/pages/Index.tsx`)
- Prediction results → Confidence display: renders (evidence: `frontend/src/components/PredictionResult.tsx`)
- Scan workflow → Browser history: reads (evidence: `frontend/src/pages/Index.tsx`)
- Scan workflow → Prediction API: submits image
- Prediction API → Image processing: preprocesses (evidence: `app.py`)
- Prediction API → Skin filter: runs filter (evidence: `app.py`)
- Skin filter → Fusion diagnosis: passes valid skin (evidence: `app.py`)
- Prediction API → Inference response: returns result (evidence: `app.py`)
- Image processing → Skin filter: prepares input (evidence: `app.py`)
- Image processing → Fusion diagnosis: prepares input (evidence: `app.py`)
- Prediction API → Fusion diagnosis: runs ensemble (evidence: `app.py`)
- Prediction API → Inference response: reports filter-only fallback (evidence: `app.py`)
