# rishvinreddy/ecobin-smart-waste-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/rishvinreddy/ecobin-smart-waste-management-system
- Repository: https://github.com/rishvinreddy/ecobin-smart-waste-management-system

## Overview

EcoBin is a municipal waste-management system that combines simulated IoT bin data, fill forecasting, collection prioritization, vehicle routing, and operator dashboards. The documented main workflow runs from generated sensor history through feature engineering and prediction to route optimization and API delivery. The graph preserves major dashboard and field-operation capabilities. Some connections are documented only in the README; optional hardware linkage is shown as unverified because source excerpts do not establish it.

Main entry points: [`frontend/src/components/Dashboard.tsx`](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/Dashboard.tsx) (Admin dashboard), [`backend/main.py`](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/backend/main.py) (FastAPI services), [`database/db.py`](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/database/db.py) (Waste database), [`ml/preprocessing/features.py`](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/ml/preprocessing/features.py) (Feature engineering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Waste Data"]
  node_generator["Sensor data simulator<br/>[generator.py]"]
end

subgraph group_intelligence["Prediction and Routing"]
  node_feature["Feature engineering<br/>[features.py]"]
  node_forecast["Fill forecasting<br/>[models.py]"]
  node_priority["Collection priority<br/>[main.py]"]
  node_solver["CVRP route solver<br/>[solver.py]"]
end

subgraph group_service["API and Persistence"]
  node_api["FastAPI services<br/>[main.py]"]
  node_schema["Waste domain models<br/>[models.py]"]
  node_store[("Waste database<br/>[db.py]")]
end

subgraph group_dashboard["Operations Dashboard"]
  node_dashboard["Admin dashboard<br/>[Dashboard.tsx]"]
  node_map["GIS map<br/>[MapComponent.tsx]"]
  node_routes["Street routes"]
  node_analytics["Analytics<br/>[Analytics.tsx]"]
  node_bins["Bin inventory<br/>[BinsTable.tsx]"]
  node_fleet["Fleet management<br/>[FleetPanel.tsx]"]
  node_predictions["Prediction panel"]
  node_notifications["Notifications"]
  node_maintenance["Maintenance management"]
end

subgraph group_field["Field Operations"]
  node_driver["Driver dashboard"]
  node_scanner["QR scanner<br/>[SmartQRScanner.tsx]"]
  node_maintenanceui["Maintenance dashboard"]
  node_hardware{{"ESP32 sensor hardware<br/>[wokwi.ino]"}}
end

node_municipal(("Municipal operators"))

node_generator -->|"writes history"| node_store
node_store -->|"supplies records"| node_feature
node_feature -->|"builds features"| node_forecast
node_forecast -->|"forecasts risk"| node_priority
node_priority -->|"selects bins"| node_solver
node_solver -->|"returns routes"| node_api
node_api -->|"serves JSON"| node_dashboard
node_api -->|"reads and writes"| node_store
node_store -->|"maps tables"| node_schema
node_municipal -->|"uses"| node_dashboard
node_dashboard -->|"renders"| node_map
node_dashboard -->|"renders"| node_routes
node_dashboard -->|"renders"| node_analytics
node_dashboard -->|"renders"| node_bins
node_dashboard -->|"renders"| node_fleet
node_dashboard -->|"renders"| node_predictions
node_dashboard -->|"renders"| node_notifications
node_dashboard -->|"renders"| node_maintenance
node_municipal -->|"uses"| node_driver
node_municipal -->|"uses"| node_maintenanceui
node_driver -->|"uses"| node_scanner
node_hardware -.->|"sends sensor updates"| node_api

click node_generator "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/ml/data_generator/generator.py"
click node_feature "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/ml/preprocessing/features.py"
click node_forecast "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/ml/forecasting/models.py"
click node_priority "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/backend/main.py"
click node_solver "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/optimization/vrp_solver/solver.py"
click node_api "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/backend/main.py"
click node_schema "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/database/models.py"
click node_store "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/database/db.py"
click node_dashboard "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/Dashboard.tsx"
click node_map "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/MapComponent.tsx"
click node_routes "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/StreetRoutePanel.tsx"
click node_analytics "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/Analytics.tsx"
click node_bins "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/BinsTable.tsx"
click node_fleet "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/FleetPanel.tsx"
click node_predictions "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/PredictionPanel.tsx"
click node_notifications "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/NotificationsPanel.tsx"
click node_maintenance "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/MaintenanceManagementPanel.tsx"
click node_driver "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/driver/DriverDashboard.tsx"
click node_scanner "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/SmartQRScanner.tsx"
click node_maintenanceui "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/maintenance/MaintenanceDashboard.tsx"
click node_hardware "https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/hardware/wokwi/wokwi.ino"

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_generator toneBlue
class node_feature,node_forecast,node_priority,node_solver toneAmber
class node_api,node_schema,node_store toneMint
class node_dashboard,node_map,node_routes,node_analytics,node_bins,node_fleet,node_predictions,node_notifications,node_maintenance toneRose
class node_driver,node_scanner,node_maintenanceui,node_hardware,node_municipal toneIndigo
```

## Components

### Waste Data

- [Sensor data simulator](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/ml/data_generator/generator.py): `ml/data_generator/generator.py`

### Prediction and Routing

- [Feature engineering](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/ml/preprocessing/features.py): `ml/preprocessing/features.py`
- [Fill forecasting](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/ml/forecasting/models.py): `ml/forecasting/models.py`
- [Collection priority](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/backend/main.py): `backend/main.py`
- [CVRP route solver](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/optimization/vrp_solver/solver.py): `optimization/vrp_solver/solver.py`

### API and Persistence

- [FastAPI services](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/backend/main.py): `backend/main.py`
- [Waste domain models](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/database/models.py): `database/models.py`
- [Waste database](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/database/db.py): `database/db.py`

### Operations Dashboard

- [Admin dashboard](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/Dashboard.tsx): `frontend/src/components/Dashboard.tsx`
- [GIS map](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/MapComponent.tsx): `frontend/src/components/MapComponent.tsx`
- [Street routes](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/StreetRoutePanel.tsx): `frontend/src/components/StreetRoutePanel.tsx`
- [Analytics](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/Analytics.tsx): `frontend/src/components/Analytics.tsx`
- [Bin inventory](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/BinsTable.tsx): `frontend/src/components/BinsTable.tsx`
- [Fleet management](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/FleetPanel.tsx): `frontend/src/components/FleetPanel.tsx`
- [Prediction panel](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/PredictionPanel.tsx): `frontend/src/components/PredictionPanel.tsx`
- [Notifications](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/NotificationsPanel.tsx): `frontend/src/components/NotificationsPanel.tsx`
- [Maintenance management](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/MaintenanceManagementPanel.tsx): `frontend/src/components/MaintenanceManagementPanel.tsx`

### Field Operations

- [Driver dashboard](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/driver/DriverDashboard.tsx): `frontend/src/components/driver/DriverDashboard.tsx`
- [QR scanner](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/SmartQRScanner.tsx): `frontend/src/components/SmartQRScanner.tsx`
- [Maintenance dashboard](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/frontend/src/components/maintenance/MaintenanceDashboard.tsx): `frontend/src/components/maintenance/MaintenanceDashboard.tsx`
- [ESP32 sensor hardware](https://github.com/rishvinreddy/ecobin-smart-waste-management-system/blob/main/hardware/wokwi/wokwi.ino): `hardware/wokwi/wokwi.ino`

### Other components

- **Municipal operators**

## Connections

- Sensor data simulator → Waste database: writes history (evidence: `README.md`)
- Waste database → Feature engineering: supplies records (evidence: `README.md`)
- Feature engineering → Fill forecasting: builds features (evidence: `ml/forecasting/models.py`)
- Fill forecasting → Collection priority: forecasts risk (evidence: `README.md`)
- Collection priority → CVRP route solver: selects bins (evidence: `README.md`)
- CVRP route solver → FastAPI services: returns routes (evidence: `README.md`)
- FastAPI services → Admin dashboard: serves JSON (evidence: `README.md`)
- FastAPI services → Waste database: reads and writes (evidence: `backend/main.py`)
- Waste database → Waste domain models: maps tables (evidence: `database/db.py`)
- Municipal operators → Admin dashboard: uses (evidence: `README.md`)
- Admin dashboard → GIS map: renders (evidence: `frontend/src/components/Dashboard.tsx`)
- Admin dashboard → Street routes: renders (evidence: `frontend/src/components/Dashboard.tsx`)
- Admin dashboard → Analytics: renders (evidence: `frontend/src/components/Dashboard.tsx`)
- Admin dashboard → Bin inventory: renders (evidence: `frontend/src/components/Dashboard.tsx`)
- Admin dashboard → Fleet management: renders (evidence: `frontend/src/components/Dashboard.tsx`)
- Admin dashboard → Prediction panel: renders (evidence: `frontend/src/components/Dashboard.tsx`)
- Admin dashboard → Notifications: renders (evidence: `frontend/src/components/Dashboard.tsx`)
- Admin dashboard → Maintenance management: renders (evidence: `frontend/src/components/Dashboard.tsx`)
- Municipal operators → Driver dashboard: uses (evidence: `README.md`)
- Municipal operators → Maintenance dashboard: uses (evidence: `README.md`)
- Driver dashboard → QR scanner: uses (evidence: `frontend/src/components/driver/DriverDashboard.tsx`)
- ESP32 sensor hardware → FastAPI services: sends sensor updates
