TrafficFlow AI is a robust, dynamic edge-AI traffic management simulator. It features a React-based frontend dashboard, a Python AI heuristic engine for routing traffic, a Java WebSocket message broker, and a full computer vision integration for detecting ambulances and estimating real-time vehicle density.
- Node.js (v18+)
- Java JDK 17+
- Python 3.10+
- RabbitMQ (Running via Docker or local installation)
Ensure RabbitMQ is running. If using Docker:
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-managementAll dependencies for the backend services have been unified.
Create a virtual environment at the root of the project and install all required Python libraries (including TensorFlow, OpenCV, FastAPI, and Flask):
python -m venv venv
.\venv\Scripts\activate
pip install -r requirements.txtcd frontend
npm install
cd ..To launch all 4 services (React UI, Java Broker, Python Backend, and the Computer Vision MJPEG Streamer), simply run the included start_all.bat script from the root directory.
.\start_all.batThis will automatically spawn:
- Frontend Dashboard:
http://localhost:4173(or5173) - Java WebSocket API:
http://localhost:8080 - Python AI Controller:
http://localhost:8001 - CV Video Feed Streamer:
http://localhost:5001/video_feed
- Open your browser and navigate to
http://localhost:4173. - Click Go to Sandbox to build your traffic node network. Connect nodes using standard edges.
- Once built, click the Play button in the top left toolbar to enable the
sim_runningloop. - Go to Debug & Logs to monitor live CV bounding boxes and the proactive AI heuristic clear-out decisions.