Smart traffic management platform with:
- real-time intersection simulation,
- AI-assisted recommendations,
- interactive operator dashboard,
- analytics and decision logging.
This repository contains both:
FastAPIbackend (/app,/core,/ml,/sim,/weather)React + Vitefrontend (/sigap-frontend)
SIGAP AI is designed to help traffic operators:
- monitor congestion in real time,
- receive AI recommendations for signal timing,
- apply or reject recommendations with operator control,
- track outcomes through analytics and decision logs.
- Real-time traffic state updates (2-second ticks).
- AI recommendation workflow:
Apply AI AdjustmentReject- confirmation prompt before critical actions.
- Manual signal override controls.
- Prediction and forecast endpoints.
- Heatmap and decision log analytics.
- Notification and settings APIs.
- BMKG weather integration with fallback behavior.
- Backend:
Python,FastAPI,Uvicorn,Pydantic - ML/Data:
TensorFlow,scikit-learn,XGBoost,pandas,numpy - Frontend:
React 19,Vite,Tailwind CSS,Recharts,Axios
sigap/
├─ app/ # FastAPI app, routes, runtime tick loop
├─ core/ # Shared config, schemas, utility contracts
├─ ml/ # Model training/inference and artifacts
├─ sim/ # Traffic simulation logic
├─ weather/ # Weather provider services (BMKG/fallback)
├─ data/ # Dummy/sample datasets
├─ scripts/ # Utility scripts (sanity checks, training helper)
├─ sigap-frontend/ # React frontend
├─ requirements.txt # Python dependencies
└─ README.md
If you only need to run and evaluate quickly, follow this section.
From project root:
python -m venv .venvActivate environment:
# Windows (PowerShell)
.venv\Scripts\Activate.ps1
# Windows (CMD)
.venv\Scripts\activate.bat
# macOS/Linux
source .venv/bin/activateInstall dependencies:
pip install -r requirements.txtRun API server:
python -m uvicorn app.main:app --host 127.0.0.1 --port 8000Health check:
curl http://127.0.0.1:8000/healthExpected response:
{"status":"ok"}Open a new terminal:
cd sigap-frontend
npm install
npm run dev -- --host 127.0.0.1 --port 5173Open:
http://127.0.0.1:5173
Use this demo account on the login page:
- Email:
demo@sigapai.com - Password:
demo1234
- Open Dashboard and verify live data refresh.
- Trigger AI action:
- click
Apply AI Adjustmentand confirmYes, - or click
Rejectand confirmYes.
- click
- Check Analytics/Decision Log updates.
- Open Profile and verify admin UI content.
- (Optional) Check API docs at
http://127.0.0.1:8000/docs.
Base URL:
http://127.0.0.1:8000/api
Main endpoints:
GET /systemGET /intersectionsGET /intersections/{intersectionId}/livePOST /intersections/{intersectionId}/adjustGET /intersections/{intersectionId}/prediction/15mGET /intersections/{intersectionId}/forecast?horizons=2h,4hGET /predictions/model-infoGET /recommendations/topPOST /recommendations/{recommendationId}/applyPOST /recommendations/{recommendationId}/rejectGET /analytics/heatmapGET /analytics/decision-logGET /notificationsPOST /notifications/mark-all-readGET /settingsPUT /settings
Core config lives in:
core/config.py
Notable defaults:
- API prefix:
/api - Tick interval: every
2seconds - Timezone:
Asia/Jakarta - CORS enabled for local frontend (
localhost:5173,127.0.0.1:5173)
- Backend default URL for frontend is:
http://127.0.0.1:8000
- Frontend can be pointed to another API using:
VITE_API_BASEin your Vite environment.
- If ports are busy, stop existing processes first or run on different ports.
Cannot connect to backend:- ensure backend is running on
127.0.0.1:8000.
- ensure backend is running on
- Frontend shows stale content:
- hard refresh browser (
Ctrl+F5).
- hard refresh browser (
- CORS issues:
- run frontend on allowed local origins (
5173or3000).
- run frontend on allowed local origins (
- Dependency install problems:
- use current
Node.js LTSand Python3.10+(recommended).
- use current
This repository is optimized for demo/development workflows.
For production deployment, add:
- environment-based secrets/config,
- proper auth and RBAC,
- persistent storage,
- structured logging/monitoring,
- CI/CD and containerization.