How tharunsai01/capstone_smarttraffic works
Smart Traffic Management combines a React operations portal with an Express backend for authentication and AI traffic orchestration. The main workflow is: an operator selects zones and signal mode in the dashboard; it requests an orchestration cycle; the backend runs perception, forecasting, incident and emergency assessment, then signal optimization; the dashboard presents metrics and signal recommendations. Authentication supports local credentials and Google OAuth. The tree and excerpts support the orchestration and auth flows, but not the detailed internals of the ML models or several README-described capabilities.
Main entry points: orchestrator.js Agent Orchestrator · ai.js AI Endpoint · App.jsx React Router · Dashboard.jsx Operations Dashboard
Components 21
Traffic Portal
- React Router
frontend/src/App.jsx - Operations Dashboard
frontend/src/Dashboard.jsx - Citizen Portal
frontend/src/UserPortal.jsx - Login and Signup
frontend/src/Login.jsx
Backend API
- Express Server
backend/app.js - AI Endpoint
backend/routes/ai.js
Traffic Agents
- Agent Orchestrator
backend/services/agenticAI/orchestrator.js - Traffic Perception
backend/services/agenticAI/mlModels.js - Flow Forecasting
backend/services/agenticAI/mlModels.js - Incident Detection
backend/services/agenticAI/mlModels.js - Emergency Priority
backend/services/agenticAI/mlModels.js - Signal Optimization
backend/services/agenticAI/mlModels.js - Agent Utilities
backend/services/agenticAI/utils.js
Identity
- Auth Endpoints
backend/routes/auth.js - Auth Controller
backend/controllers/authController.js - Google OAuth
backend/config/passport.js - User Records
backend/models/User.js - Activity Logs
backend/models/ActivityLog.js
Other components
- Operator
- MongoDB
Connections 26
- Operator → React Router: uses
- React Router → Operations Dashboard: routes
- React Router → Login and Signup: routes
- React Router → Citizen Portal: routes
- Operations Dashboard → Express Server: requests status
- Operations Dashboard → AI Endpoint: posts zones
- Express Server → AI Endpoint: mounts endpoint
- Express Server → Auth Endpoints: mounts endpoints
- Login and Signup → Auth Endpoints: authenticates
- Auth Endpoints → User Records: reads and writes
- Auth Endpoints → Google OAuth: starts OAuth
- Google OAuth → User Records: reads and writes
- Google OAuth → Google: federated login
- Auth Controller → User Records: reads and writes
- Auth Controller → Activity Logs: records events
- User Records → MongoDB: persists
- Activity Logs → MongoDB: persists
- AI Endpoint → Agent Orchestrator: runs cycle
- Agent Orchestrator → Traffic Perception: invokes
- Agent Orchestrator → Flow Forecasting: invokes
- Agent Orchestrator → Incident Detection: invokes
- Agent Orchestrator → Emergency Priority: invokes
- Agent Orchestrator → Signal Optimization: invokes
- Agent Orchestrator → Agent Utilities: uses helpers
- Agent Orchestrator → AI Endpoint: returns results
- AI Endpoint → Operations Dashboard: returns payload