# jambojuakshaya/wastedetectionapp architecture

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

- Interactive diagram: https://gitdiagram.com/jambojuakshaya/wastedetectionapp
- Repository: https://github.com/jambojuakshaya/wastedetectionapp

## Overview

WasteDetectionApp is a waste-image classification application. Its implemented web workflow is login, upload an image, request a prediction, and view the labeled result; the app uses a hard-coded login rather than the separate JSON user helpers. The repository also includes camera-frame prediction code and a dataset augmentation/training workflow. The README describes real-time image and video use, but the sampled app exposes no camera route, and the camera’s imported frame-prediction function is not present in the utils excerpt. Those links are shown only where source evidence supports them.

Main entry points: [`utils.py`](https://github.com/jambojuakshaya/wastedetectionapp/blob/main/utils.py) (Image classifier), [`app.py`](https://github.com/jambojuakshaya/wastedetectionapp/blob/main/app.py) (Web routes), [`train_model.py`](https://github.com/jambojuakshaya/wastedetectionapp/blob/main/train_model.py) (Model training), [`camera.py`](https://github.com/jambojuakshaya/wastedetectionapp/blob/main/camera.py) (Camera stream)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Web routes<br/>[app.py]"]
  node_uploads["Uploaded images"]
  node_results["Labeled results"]
end

subgraph group_vision["Vision runtime"]
  node_detector["Image classifier<br/>[utils.py]"]
  node_camera["Camera stream<br/>[camera.py]"]
end

subgraph group_model["Model lifecycle"]
  node_model_artifact["Trained model"]
  node_augment["Dataset augmentation<br/>[augment_data.py]"]
  node_trainer["Model training<br/>[train_model.py]"]
  node_dataset[("Image dataset")]
end

subgraph group_users["User data"]
  node_user_store[("User JSON<br/>[users.json]")]
  node_user_helpers["User helpers<br/>[database.py]"]
end

node_user(("App user"))

node_user -->|"submits requests"| node_app
node_app -->|"writes upload"| node_uploads
node_app -->|"calls detection"| node_detector
node_detector -->|"reads image"| node_uploads
node_detector -->|"loads model"| node_model_artifact
node_detector -->|"writes result"| node_results
node_app -->|"renders result"| node_results
node_camera -->|"predicts frames"| node_detector
node_augment -->|"augments images"| node_dataset
node_trainer -->|"loads images"| node_dataset
node_trainer -->|"saves model"| node_model_artifact
node_user_helpers -->|"reads and writes"| node_user_store

click node_app "https://github.com/jambojuakshaya/wastedetectionapp/blob/main/app.py"
click node_detector "https://github.com/jambojuakshaya/wastedetectionapp/blob/main/utils.py"
click node_camera "https://github.com/jambojuakshaya/wastedetectionapp/blob/main/camera.py"
click node_augment "https://github.com/jambojuakshaya/wastedetectionapp/blob/main/augment_data.py"
click node_trainer "https://github.com/jambojuakshaya/wastedetectionapp/blob/main/train_model.py"
click node_user_store "https://github.com/jambojuakshaya/wastedetectionapp/blob/main/users.json"
click node_user_helpers "https://github.com/jambojuakshaya/wastedetectionapp/blob/main/database.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_uploads,node_results,node_user toneBlue
class node_detector,node_camera toneAmber
class node_model_artifact,node_augment,node_trainer,node_dataset toneMint
class node_user_store,node_user_helpers toneRose
```

## Components

### Web application

- [Web routes](https://github.com/jambojuakshaya/wastedetectionapp/blob/main/app.py): `app.py`
- **Uploaded images**
- **Labeled results**

### Vision runtime

- [Image classifier](https://github.com/jambojuakshaya/wastedetectionapp/blob/main/utils.py): `utils.py`
- [Camera stream](https://github.com/jambojuakshaya/wastedetectionapp/blob/main/camera.py): `camera.py`

### Model lifecycle

- **Trained model**
- [Dataset augmentation](https://github.com/jambojuakshaya/wastedetectionapp/blob/main/augment_data.py): `augment_data.py`
- [Model training](https://github.com/jambojuakshaya/wastedetectionapp/blob/main/train_model.py): `train_model.py`
- **Image dataset**

### User data

- [User JSON](https://github.com/jambojuakshaya/wastedetectionapp/blob/main/users.json): `users.json`
- [User helpers](https://github.com/jambojuakshaya/wastedetectionapp/blob/main/database.py): `database.py`

### Other components

- **App user**

## Connections

- App user → Web routes: submits requests (evidence: `app.py`)
- Web routes → Uploaded images: writes upload (evidence: `app.py`)
- Web routes → Image classifier: calls detection (evidence: `app.py`)
- Image classifier → Uploaded images: reads image (evidence: `utils.py`)
- Image classifier → Trained model: loads model (evidence: `utils.py`)
- Image classifier → Labeled results: writes result (evidence: `utils.py`)
- Web routes → Labeled results: renders result (evidence: `app.py`)
- Camera stream → Image classifier: predicts frames (evidence: `camera.py`)
- Dataset augmentation → Image dataset: augments images (evidence: `augment_data.py`)
- Model training → Image dataset: loads images (evidence: `train_model.py`)
- Model training → Trained model: saves model (evidence: `train_model.py`)
- User helpers → User JSON: reads and writes (evidence: `database.py`)
