# imskr/plant_disease_detection architecture

> Architecture diagram of the GitHub repository imskr/plant_disease_detection, 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/imskr/plant_disease_detection
- Repository: https://github.com/imskr/plant_disease_detection

## Overview

Plant Disease Detector is a web app for classifying uploaded plant-leaf images. A user selects an image in the browser, submits it for analysis, and sees the predicted disease class. The sampled server code loads a FastAI learner and uses it for inference; the README documents a broad set of plant and disease classes. Training notebooks and deployment guides are present, but are not part of the runtime workflow described here. The graph reflects the sampled Starlette app; the separate Flask example is omitted.

Main entry points: [`app/server.py`](https://github.com/imskr/plant_disease_detection/blob/master/app/server.py) (Starlette server), [`app/view/index.html`](https://github.com/imskr/plant_disease_detection/blob/master/app/view/index.html) (Upload page), [`app/static/client.js`](https://github.com/imskr/plant_disease_detection/blob/master/app/static/client.js) (Upload client), [`app/static/style.css`](https://github.com/imskr/plant_disease_detection/blob/master/app/static/style.css) (Page styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser experience"]
  node_page["Upload page<br/>[index.html]"]
  node_client["Upload client<br/>[client.js]"]
  node_styles["Page styles<br/>[style.css]"]
end

subgraph group_inference["Inference service"]
  node_server["Starlette server<br/>[server.py]"]
  node_prediction["Image prediction<br/>[server.py]"]
end

subgraph group_model["Model assets"]
  node_model_file["ResNet34 model"]
end

node_user(("User"))
node_model_source["Model download"]

node_user -->|"opens"| node_page
node_server -->|"serves"| node_page
node_page -->|"loads"| node_client
node_page -->|"loads"| node_styles
node_client -->|"posts image"| node_server
node_server -->|"dispatches"| node_prediction
node_prediction -->|"uses learner"| node_model_file
node_server -->|"returns result"| node_client
node_model_source -.->|"downloads if absent"| node_server

click node_page "https://github.com/imskr/plant_disease_detection/blob/master/app/view/index.html"
click node_client "https://github.com/imskr/plant_disease_detection/blob/master/app/static/client.js"
click node_styles "https://github.com/imskr/plant_disease_detection/blob/master/app/static/style.css"
click node_server "https://github.com/imskr/plant_disease_detection/blob/master/app/server.py"
click node_prediction "https://github.com/imskr/plant_disease_detection/blob/master/app/server.py"
click node_model_file "https://github.com/imskr/plant_disease_detection/blob/master/app/models/export_resnet34_model.pkl"

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_client,node_styles,node_user toneBlue
class node_server,node_prediction toneAmber
class node_model_file toneMint
class node_model_source toneIndigo
```

## Components

### Browser experience

- [Upload page](https://github.com/imskr/plant_disease_detection/blob/master/app/view/index.html): `app/view/index.html`
- [Upload client](https://github.com/imskr/plant_disease_detection/blob/master/app/static/client.js): `app/static/client.js`
- [Page styles](https://github.com/imskr/plant_disease_detection/blob/master/app/static/style.css): `app/static/style.css`

### Inference service

- [Starlette server](https://github.com/imskr/plant_disease_detection/blob/master/app/server.py): `app/server.py`
- [Image prediction](https://github.com/imskr/plant_disease_detection/blob/master/app/server.py): `app/server.py`

### Model assets

- [ResNet34 model](https://github.com/imskr/plant_disease_detection/blob/master/app/models/export_resnet34_model.pkl): `app/models/export_resnet34_model.pkl`

### Other components

- **User**
- **Model download**

## Connections

- User → Upload page: opens
- Starlette server → Upload page: serves
- Upload page → Upload client: loads
- Upload page → Page styles: loads
- Upload client → Starlette server: posts image
- Starlette server → Image prediction: dispatches
- Image prediction → ResNet34 model: uses learner
- Starlette server → Upload client: returns result
- Model download → Starlette server: downloads if absent
