# oloyede-hub/potato_disease_classifier_frontend architecture

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

- Interactive diagram: https://gitdiagram.com/oloyede-hub/potato_disease_classifier_frontend
- Repository: https://github.com/oloyede-hub/potato_disease_classifier_frontend

## Overview

This is a single-page potato leaf disease-classification frontend. The user selects or drops an image, reviews its preview, submits it to a configurable prediction API, and sees returned labels and confidence values. The sampled client component owns upload handling, preview state, the API request, and result display; the server-side styling registry supports rendering. README capabilities such as responsive design and animations are primarily presentation concerns. The backend implementation is not present in the tree, so it is shown only as an external service.

Main entry points: [`app/page-client.tsx`](https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/page-client.tsx) (Classifier UI), [`app/page.tsx`](https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/page.tsx) (Page route), [`app/layout.tsx`](https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/layout.tsx) (Root layout), [`lib/registry.tsx`](https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/lib/registry.tsx) (Style registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_classifier["Classifier UI<br/>[page-client.tsx]"]
  node_image_flow["Image workflow<br/>[page-client.tsx]"]
  node_results["Results display<br/>[page-client.tsx]"]
end

subgraph group_application["Next.js application"]
  node_page["Page route<br/>[page.tsx]"]
  node_root_layout["Root layout<br/>[layout.tsx]"]
end

subgraph group_styling["Styling support"]
  node_style_registry["Style registry<br/>[registry.tsx]"]
end

node_user(("User"))
node_prediction_api{{"Prediction API"}}

node_page -->|"renders"| node_classifier
node_user -->|"interacts"| node_classifier
node_classifier -->|"handles images"| node_image_flow
node_classifier -->|"POSTs image"| node_prediction_api
node_prediction_api -->|"returns JSON"| node_classifier
node_classifier -->|"renders results"| node_results
node_root_layout -->|"wraps children"| node_style_registry

click node_page "https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/page.tsx"
click node_classifier "https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/page-client.tsx"
click node_image_flow "https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/page-client.tsx"
click node_results "https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/page-client.tsx"
click node_root_layout "https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/layout.tsx"
click node_style_registry "https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/lib/registry.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_classifier,node_image_flow,node_results,node_user toneBlue
class node_page,node_root_layout toneAmber
class node_style_registry,node_prediction_api toneMint
```

## Components

### User experience

- [Classifier UI](https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/page-client.tsx): `app/page-client.tsx`
- [Image workflow](https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/page-client.tsx): `app/page-client.tsx`
- [Results display](https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/page-client.tsx): `app/page-client.tsx`

### Next.js application

- [Page route](https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/page.tsx): `app/page.tsx`
- [Root layout](https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/app/layout.tsx): `app/layout.tsx`

### Styling support

- [Style registry](https://github.com/oloyede-hub/potato_disease_classifier_frontend/blob/main/lib/registry.tsx): `lib/registry.tsx`

### Other components

- **User**
- **Prediction API**

## Connections

- Page route → Classifier UI: renders (evidence: `app/page.tsx`)
- User → Classifier UI: interacts (evidence: `app/page-client.tsx`)
- Classifier UI → Image workflow: handles images (evidence: `app/page-client.tsx`)
- Classifier UI → Prediction API: POSTs image (evidence: `app/page-client.tsx`)
- Prediction API → Classifier UI: returns JSON (evidence: `app/page-client.tsx`)
- Classifier UI → Results display: renders results (evidence: `app/page-client.tsx`)
- Root layout → Style registry: wraps children (evidence: `app/layout.tsx`)
