# anvation-2026/anv26-sc-04--ecocity-ai architecture

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

- Interactive diagram: https://gitdiagram.com/anvation-2026/anv26-sc-04--ecocity-ai
- Repository: https://github.com/anvation-2026/anv26-sc-04--ecocity-ai

## Overview

EcoCity AI is a municipal solid-waste command center. The user workflow runs from the React dashboard and operational screens, through the API client to FastAPI endpoints, then to forecasting, risk, routing, and segregation logic; results support monitoring and operational decisions. The frontend also includes local intelligence and fallback data. Major screens and backend domains are represented, but the README contains no usable capability detail, and some screen-to-backend relationships are not evidenced in the excerpts.

Main entry points: [`src/App.jsx`](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/App.jsx) (Dashboard App), [`backend/main.py`](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/main.py) (FastAPI Application), [`backend/api/agent.py`](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/agent.py) (Agent API), [`src/services/api.js`](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/services/api.js) (REST API Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Command Center UI"]
  node_app["Dashboard App<br/>[App.jsx]"]
  node_command["Command Center"]
  node_zones["Waste Zones"]
  node_history["Historical Analytics"]
  node_landfill["Landfill Intelligence"]
  node_collection["Collection Reliability"]
  node_segregation["Source Segregation"]
  node_dataai["Data and AI"]
  node_routeui["Route Optimization"]
  node_agentui["EcoAgent Drawer<br/>[EcoAgentDrawer.jsx]"]
end

subgraph group_client["Client Intelligence"]
  node_apiclient["REST API Client<br/>[api.js]"]
  node_localai["Browser AI Models"]
  node_routeclient["Route Simulator"]
  node_agenttools["Agent Tools<br/>[ecoAgentTools.js]"]
  node_mock["Fallback Data<br/>[mockData.js]"]
end

subgraph group_backend["Operations API"]
  node_server["FastAPI Application<br/>[main.py]"]
  node_dashboardapi["Dashboard API<br/>[dashboard.py]"]
  node_zonesapi["Zones API<br/>[zones.py]"]
  node_vehiclesapi["Vehicles API<br/>[vehicles.py]"]
  node_forecastapi["Forecast API<br/>[forecast.py]"]
  node_landfillapi["Landfill API<br/>[landfill.py]"]
  node_collectionapi["Collection API<br/>[collection.py]"]
  node_segregationapi["Segregation API<br/>[segregation.py]"]
  node_agentapi["Agent API<br/>[agent.py]"]
end

subgraph group_engines["Domain Engines"]
  node_risk["Risk Scoring<br/>[risk_engine.py]"]
  node_forecastengine["Waste Forecasting<br/>[forecast_engine.py]"]
  node_routeengine["Vehicle Routing<br/>[route_optimizer.py]"]
  node_segengine["Segregation Analysis<br/>[segregation.py]"]
end

node_operator(("Municipal Operator"))

node_operator -->|"uses"| node_app
node_app -->|"renders"| node_command
node_app -->|"renders"| node_zones
node_app -->|"renders"| node_history
node_app -->|"renders"| node_landfill
node_app -->|"renders"| node_collection
node_app -->|"renders"| node_segregation
node_app -->|"renders"| node_dataai
node_app -->|"renders"| node_routeui
node_app -->|"renders"| node_agentui
node_app -->|"fetches via"| node_apiclient
node_app -->|"simulates with"| node_localai
node_dataai -->|"analyzes with"| node_localai
node_collection -->|"fetches via"| node_apiclient
node_segregation -->|"fetches via"| node_apiclient
node_landfill -->|"reads"| node_mock
node_routeui -->|"simulates with"| node_routeclient
node_agentui -->|"queries"| node_apiclient
node_agentui -->|"runs tools"| node_agenttools
node_apiclient -->|"calls REST"| node_server
node_server -->|"registers"| node_dashboardapi
node_server -->|"registers"| node_zonesapi
node_server -->|"registers"| node_vehiclesapi
node_server -->|"registers"| node_forecastapi
node_server -->|"registers"| node_landfillapi
node_server -->|"registers"| node_collectionapi
node_server -->|"registers"| node_segregationapi
node_server -->|"registers"| node_agentapi
node_forecastapi -->|"uses"| node_forecastengine
node_forecastapi -->|"uses"| node_risk
node_landfillapi -->|"uses"| node_forecastengine
node_zonesapi -->|"scores with"| node_risk
node_vehiclesapi -->|"optimizes with"| node_routeengine
node_segregationapi -->|"analyzes with"| node_segengine
node_agentapi -->|"calls"| node_risk
node_agentapi -->|"calls"| node_forecastengine
node_agentapi -->|"calls"| node_routeengine
node_agentapi -->|"calls"| node_segengine

click node_app "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/App.jsx"
click node_command "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/CommandCenterScreen.jsx"
click node_zones "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/WasteZonesScreen.jsx"
click node_history "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/HistoricalAnalyticsScreen.jsx"
click node_landfill "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/LandfillIntelligenceScreen.jsx"
click node_collection "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/CollectionReliabilityScreen.jsx"
click node_segregation "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/SourceSegregationScreen.jsx"
click node_dataai "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/DataAndAIScreen.jsx"
click node_routeui "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/RouteOptimizationScreen.jsx"
click node_agentui "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/components/EcoAgentDrawer.jsx"
click node_apiclient "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/services/api.js"
click node_localai "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/services/aiIntelligenceEngine.js"
click node_routeclient "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/services/routeOptimizationEngine.js"
click node_agenttools "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/services/ecoAgentTools.js"
click node_mock "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/data/mockData.js"
click node_server "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/main.py"
click node_dashboardapi "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/dashboard.py"
click node_zonesapi "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/zones.py"
click node_vehiclesapi "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/vehicles.py"
click node_forecastapi "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/forecast.py"
click node_landfillapi "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/landfill.py"
click node_collectionapi "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/collection.py"
click node_segregationapi "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/segregation.py"
click node_agentapi "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/agent.py"
click node_risk "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/services/risk_engine.py"
click node_forecastengine "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/services/forecast_engine.py"
click node_routeengine "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/services/route_optimizer.py"
click node_segengine "https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/services/segregation.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_command,node_zones,node_history,node_landfill,node_collection,node_segregation,node_dataai,node_routeui,node_agentui toneBlue
class node_apiclient,node_localai,node_routeclient,node_agenttools,node_mock toneAmber
class node_server,node_dashboardapi,node_zonesapi,node_vehiclesapi,node_forecastapi,node_landfillapi,node_collectionapi,node_segregationapi,node_agentapi toneMint
class node_risk,node_forecastengine,node_routeengine,node_segengine toneRose
class node_operator toneIndigo
```

## Components

### Command Center UI

- [Dashboard App](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/App.jsx): `src/App.jsx`
- [Command Center](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/CommandCenterScreen.jsx): `src/screens/CommandCenterScreen.jsx`
- [Waste Zones](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/WasteZonesScreen.jsx): `src/screens/WasteZonesScreen.jsx`
- [Historical Analytics](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/HistoricalAnalyticsScreen.jsx): `src/screens/HistoricalAnalyticsScreen.jsx`
- [Landfill Intelligence](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/LandfillIntelligenceScreen.jsx): `src/screens/LandfillIntelligenceScreen.jsx`
- [Collection Reliability](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/CollectionReliabilityScreen.jsx): `src/screens/CollectionReliabilityScreen.jsx`
- [Source Segregation](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/SourceSegregationScreen.jsx): `src/screens/SourceSegregationScreen.jsx`
- [Data and AI](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/DataAndAIScreen.jsx): `src/screens/DataAndAIScreen.jsx`
- [Route Optimization](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/screens/RouteOptimizationScreen.jsx): `src/screens/RouteOptimizationScreen.jsx`
- [EcoAgent Drawer](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/components/EcoAgentDrawer.jsx): `src/components/EcoAgentDrawer.jsx`

### Client Intelligence

- [REST API Client](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/services/api.js): `src/services/api.js`
- [Browser AI Models](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/services/aiIntelligenceEngine.js): `src/services/aiIntelligenceEngine.js`
- [Route Simulator](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/services/routeOptimizationEngine.js): `src/services/routeOptimizationEngine.js`
- [Agent Tools](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/services/ecoAgentTools.js): `src/services/ecoAgentTools.js`
- [Fallback Data](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/src/data/mockData.js): `src/data/mockData.js`

### Operations API

- [FastAPI Application](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/main.py): `backend/main.py`
- [Dashboard API](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/dashboard.py): `backend/api/dashboard.py`
- [Zones API](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/zones.py): `backend/api/zones.py`
- [Vehicles API](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/vehicles.py): `backend/api/vehicles.py`
- [Forecast API](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/forecast.py): `backend/api/forecast.py`
- [Landfill API](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/landfill.py): `backend/api/landfill.py`
- [Collection API](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/collection.py): `backend/api/collection.py`
- [Segregation API](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/segregation.py): `backend/api/segregation.py`
- [Agent API](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/api/agent.py): `backend/api/agent.py`

### Domain Engines

- [Risk Scoring](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/services/risk_engine.py): `backend/services/risk_engine.py`
- [Waste Forecasting](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/services/forecast_engine.py): `backend/services/forecast_engine.py`
- [Vehicle Routing](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/services/route_optimizer.py): `backend/services/route_optimizer.py`
- [Segregation Analysis](https://github.com/anvation-2026/anv26-sc-04--ecocity-ai/blob/main/backend/services/segregation.py): `backend/services/segregation.py`

### Other components

- **Municipal Operator**

## Connections

- Municipal Operator → Dashboard App: uses (evidence: `src/App.jsx`)
- Dashboard App → Command Center: renders (evidence: `src/App.jsx`)
- Dashboard App → Waste Zones: renders (evidence: `src/App.jsx`)
- Dashboard App → Historical Analytics: renders (evidence: `src/App.jsx`)
- Dashboard App → Landfill Intelligence: renders (evidence: `src/App.jsx`)
- Dashboard App → Collection Reliability: renders (evidence: `src/App.jsx`)
- Dashboard App → Source Segregation: renders (evidence: `src/App.jsx`)
- Dashboard App → Data and AI: renders (evidence: `src/App.jsx`)
- Dashboard App → Route Optimization: renders (evidence: `src/App.jsx`)
- Dashboard App → EcoAgent Drawer: renders (evidence: `src/App.jsx`)
- Dashboard App → REST API Client: fetches via (evidence: `src/App.jsx`)
- Dashboard App → Browser AI Models: simulates with (evidence: `src/App.jsx`)
- Data and AI → Browser AI Models: analyzes with (evidence: `src/screens/DataAndAIScreen.jsx`)
- Collection Reliability → REST API Client: fetches via (evidence: `src/screens/CollectionReliabilityScreen.jsx`)
- Source Segregation → REST API Client: fetches via (evidence: `src/screens/SourceSegregationScreen.jsx`)
- Landfill Intelligence → Fallback Data: reads (evidence: `src/screens/LandfillIntelligenceScreen.jsx`)
- Route Optimization → Route Simulator: simulates with (evidence: `src/screens/RouteOptimizationScreen.jsx`)
- EcoAgent Drawer → REST API Client: queries (evidence: `src/components/EcoAgentDrawer.jsx`)
- EcoAgent Drawer → Agent Tools: runs tools (evidence: `src/components/EcoAgentDrawer.jsx`)
- REST API Client → FastAPI Application: calls REST (evidence: `src/services/api.js`)
- FastAPI Application → Dashboard API: registers (evidence: `backend/main.py`)
- FastAPI Application → Zones API: registers (evidence: `backend/main.py`)
- FastAPI Application → Vehicles API: registers (evidence: `backend/main.py`)
- FastAPI Application → Forecast API: registers (evidence: `backend/main.py`)
- FastAPI Application → Landfill API: registers (evidence: `backend/main.py`)
- FastAPI Application → Collection API: registers (evidence: `backend/main.py`)
- FastAPI Application → Segregation API: registers (evidence: `backend/main.py`)
- FastAPI Application → Agent API: registers (evidence: `backend/main.py`)
- Forecast API → Waste Forecasting: uses (evidence: `backend/api/forecast.py`)
- Forecast API → Risk Scoring: uses (evidence: `backend/api/forecast.py`)
- Landfill API → Waste Forecasting: uses (evidence: `backend/api/landfill.py`)
- Zones API → Risk Scoring: scores with (evidence: `backend/api/zones.py`)
- Vehicles API → Vehicle Routing: optimizes with (evidence: `backend/api/vehicles.py`)
- Segregation API → Segregation Analysis: analyzes with (evidence: `backend/api/segregation.py`)
- Agent API → Risk Scoring: calls (evidence: `backend/api/agent.py`)
- Agent API → Waste Forecasting: calls (evidence: `backend/api/agent.py`)
- Agent API → Vehicle Routing: calls (evidence: `backend/api/agent.py`)
- Agent API → Segregation Analysis: calls (evidence: `backend/api/agent.py`)
