# shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system architecture

> Architecture diagram of the GitHub repository shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system
- Repository: https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system

## Overview

This repository implements an AI-assisted traffic management system: a React dashboard presents live lane state and controls, a Node.js service schedules signals, and a Python/YOLOv8 service detects vehicles and supplies annotated frames. The main workflow runs from lane video detection through detection updates to signal scheduling and live dashboard updates. The tree also contains an earlier `runtimerulers` frontend with placeholder comparison and pollution pages; the active `traffic-system` frontend provides the documented dashboards. Backend details are represented at documented subsystem level because the excerpts do not expose their internal implementation.

Main entry points: [`traffic-system/src/App.jsx`](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/App.jsx) (Dashboard router), [`backend/python/main.py`](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/python/main.py) (Detection API), [`traffic-system/src/pages/TrafficSimulationNew.jsx`](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/pages/TrafficSimulationNew.jsx) (Traffic control), [`traffic-system/src/socket.js`](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/socket.js) (Socket client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Traffic dashboard"]
  node_app["Dashboard router<br/>[App.jsx]"]
  node_navigation["Live navigation<br/>[NavigationNew.jsx]"]
  node_traffic["Traffic control"]
  node_admin["District monitor<br/>[AdminDashboard.jsx]"]
  node_comparison["AI comparison<br/>[ComparisonPage.jsx]"]
  node_pollution["Pollution page"]
  node_socket["Socket client<br/>[socket.js]"]
end

subgraph group_signal["Signal engine"]
  node_engine["Signal service<br/>[server.js]"]
  node_scheduling["Signal scheduling<br/>[server.js]"]
  node_signalapi["Signal API and events<br/>[server.js]"]
end

subgraph group_vision["AI detection"]
  node_pythonapi["Detection API<br/>[main.py]"]
  node_detector["Vehicle detection<br/>[main.py]"]
  node_frames["Annotated frames<br/>[main.py]"]
end

node_operator(("Traffic operator"))
node_lanevideos["Lane video sources"]

node_operator -->|"uses"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"routes"| node_traffic
node_app -->|"routes"| node_admin
node_app -->|"routes"| node_comparison
node_operator -.->|"views"| node_pollution
node_navigation -->|"subscribes"| node_socket
node_traffic -->|"subscribes"| node_socket
node_admin -->|"subscribes"| node_socket
node_socket -->|"exchanges events"| node_signalapi
node_traffic -->|"fetches frames"| node_pythonapi
node_admin -.->|"fetches frames"| node_pythonapi
node_lanevideos -->|"supplies video"| node_detector
node_detector -->|"serves detections"| node_pythonapi
node_pythonapi -->|"posts detections"| node_signalapi
node_engine -->|"runs"| node_scheduling
node_engine -->|"exposes"| node_signalapi
node_pythonapi -->|"serves streams"| node_frames
node_frames -->|"displays frames"| node_traffic

click node_app "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/App.jsx"
click node_navigation "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/components/NavigationNew.jsx"
click node_traffic "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/pages/TrafficSimulationNew.jsx"
click node_admin "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/pages/AdminDashboard.jsx"
click node_comparison "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/pages/ComparisonPage.jsx"
click node_pollution "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/pages/PollutionControl.jsx"
click node_socket "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/socket.js"
click node_engine "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/node/server.js"
click node_scheduling "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/node/server.js"
click node_signalapi "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/node/server.js"
click node_pythonapi "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/python/main.py"
click node_detector "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/python/main.py"
click node_frames "https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/python/main.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_navigation,node_traffic,node_admin,node_comparison,node_pollution,node_socket toneBlue
class node_engine,node_scheduling,node_signalapi toneAmber
class node_pythonapi,node_detector,node_frames toneMint
class node_operator,node_lanevideos toneIndigo
```

## Components

### Traffic dashboard

- [Dashboard router](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/App.jsx): `traffic-system/src/App.jsx`
- [Live navigation](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/components/NavigationNew.jsx): `traffic-system/src/components/NavigationNew.jsx`
- [Traffic control](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/pages/TrafficSimulationNew.jsx): `traffic-system/src/pages/TrafficSimulationNew.jsx`
- [District monitor](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/pages/AdminDashboard.jsx): `traffic-system/src/pages/AdminDashboard.jsx`
- [AI comparison](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/pages/ComparisonPage.jsx): `traffic-system/src/pages/ComparisonPage.jsx`
- [Pollution page](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/pages/PollutionControl.jsx): `traffic-system/src/pages/PollutionControl.jsx`
- [Socket client](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/traffic-system/src/socket.js): `traffic-system/src/socket.js`

### Signal engine

- [Signal service](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/node/server.js): `backend/node/server.js`
- [Signal scheduling](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/node/server.js): `backend/node/server.js`
- [Signal API and events](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/node/server.js): `backend/node/server.js`

### AI detection

- [Detection API](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/python/main.py): `backend/python/main.py`
- [Vehicle detection](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/python/main.py): `backend/python/main.py`
- [Annotated frames](https://github.com/shivprasadpravindongapure/ai-based-intelligent-traffic-managment-system/blob/main/backend/python/main.py): `backend/python/main.py`

### Other components

- **Traffic operator**
- **Lane video sources**

## Connections

- Traffic operator → Dashboard router: uses (evidence: `README.md`)
- Dashboard router → Live navigation: renders (evidence: `traffic-system/src/App.jsx`)
- Dashboard router → Traffic control: routes (evidence: `traffic-system/src/App.jsx`)
- Dashboard router → District monitor: routes (evidence: `traffic-system/src/App.jsx`)
- Dashboard router → AI comparison: routes (evidence: `traffic-system/src/App.jsx`)
- Traffic operator → Pollution page: views
- Live navigation → Socket client: subscribes (evidence: `traffic-system/src/components/NavigationNew.jsx`)
- Traffic control → Socket client: subscribes (evidence: `traffic-system/src/pages/TrafficSimulationNew.jsx`)
- District monitor → Socket client: subscribes (evidence: `traffic-system/src/pages/AdminDashboard.jsx`)
- Socket client → Signal API and events: exchanges events (evidence: `README.md`)
- Traffic control → Detection API: fetches frames (evidence: `traffic-system/src/pages/TrafficSimulationNew.jsx`)
- District monitor → Detection API: fetches frames
- Lane video sources → Vehicle detection: supplies video (evidence: `README.md`)
- Vehicle detection → Detection API: serves detections (evidence: `README.md`)
- Detection API → Signal API and events: posts detections (evidence: `README.md`)
- Signal service → Signal scheduling: runs (evidence: `README.md`)
- Signal service → Signal API and events: exposes (evidence: `README.md`)
- Detection API → Annotated frames: serves streams (evidence: `README.md`)
- Annotated frames → Traffic control: displays frames (evidence: `traffic-system/src/pages/TrafficSimulationNew.jsx`)
