A real-time traffic congestion monitoring, analysis, and forecasting platform for Jakarta road segments. This project utilizes ARIMA (AutoRegressive Integrated Moving Average) statistical models to predict traffic volume and congestion status, providing deep insights into urban mobility.
The Jakarta Traffic Intelligence dashboard is built to help researchers, operators, and analysts understand traffic patterns across Jakarta. By integrating historical traffic volume data with live traffic metrics, the system calculates congestion scores, evaluates model accuracy, and performs continuous forecasting.
The project uses a hybrid architecture approach:
- Backend: A high-performance Python FastAPI server acting as the primary engine for serving data, running ARIMA models, and performing Exploratory Data Analysis (EDA).
- Frontend: A modern, enterprise-grade dashboard built with vanilla HTML5, CSS (CSS Variables for theming), and JavaScript, ensuring a lightweight and rapid user experience without heavy frameworks.
- Live & Historical Snapshots: View the status (Lancar, Padat, Macet) of multiple road segments based on congestion scores.
- ARIMA Forecasting: Real-time univariate ARIMA model training with 80/20 train-test splitting. Evaluates models using RMSE, MAE, MSE, and MAPE.
- Exploratory Data Analysis (EDA): Detailed statistical breakdowns including correlation matrices, data completeness, hourly distributions, and temporal hotspots.
- Live Traffic Overlay: Integrates with live mapping providers (via Folium) to visualize current bottlenecks dynamically.
- Batch Ranking Exports: Generate and export diagnostic rankings for all available road segments in CSV or Summary format.
- Automated Scheduling: Support for automated live data collection to continuously populate the SQLite history database.
- Enterprise Dark/Light Mode: A clean, data-dense UI heavily inspired by modern design paradigms with zero external CSS dependencies.
- Language: Python 3.9+ / JavaScript (ES6)
- Backend API: FastAPI, Uvicorn
- Data & Modeling: Pandas, NumPy, Statsmodels, pmdarima
- Mapping: Folium
- Frontend: HTML5, Vanilla JS, Vanilla CSS
- Python 3.9 or higher
- PowerShell (for running automation scripts)
git clone https://github.com/Rajapranata512/jakarta-traffic-intelligence.git
cd jakarta-traffic-intelligenceIt is highly recommended to use a virtual environment.
python -m venv .venv
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate
pip install -r requirements.txtCopy the example environment files and configure your keys if necessary:
cp .env.example .env
cp live_provider.env.example live_provider.envNote: Ensure your .env files are not pushed to version control for security.
The easiest way to start both the FastAPI backend and any accompanying services is via the provided PowerShell script:
.\scripts\start_hybrid_stack.ps1Once running, access the Operations Console at: http://localhost:8000/client/compact
- Data Ingestion: The system consumes data from
data/master_traffic.csvand merges it with live datasets tracked insidedata/live_traffic_history.sqlite. - Analysis: When a user selects a segment, the API (
api.py) invokesrun_arima_studyto calculate metrics dynamically. - Frontend Presentation:
app.jsruns concurrent asynchronous fetch requests to compile the dashboard instantly without blocking the user interface.
This project is an academic/thesis implementation focused on statistical traffic analysis. The data within this repository is for research purposes. Live API tokens or personal machine identifiable files are strictly excluded from version control to maintain privacy and security.
Created for Thesis / Research Purposes.