Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Jakarta Traffic Intelligence

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.

Overview

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.

Features

  • 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.

Technical Stack

  • Language: Python 3.9+ / JavaScript (ES6)
  • Backend API: FastAPI, Uvicorn
  • Data & Modeling: Pandas, NumPy, Statsmodels, pmdarima
  • Mapping: Folium
  • Frontend: HTML5, Vanilla JS, Vanilla CSS

Setup & Installation

Prerequisites

  • Python 3.9 or higher
  • PowerShell (for running automation scripts)

1. Clone the Repository

git clone https://github.com/Rajapranata512/jakarta-traffic-intelligence.git
cd jakarta-traffic-intelligence

2. Install Dependencies

It 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.txt

3. Environment Configuration

Copy the example environment files and configure your keys if necessary:

cp .env.example .env
cp live_provider.env.example live_provider.env

Note: Ensure your .env files are not pushed to version control for security.

4. Running the Project

The easiest way to start both the FastAPI backend and any accompanying services is via the provided PowerShell script:

.\scripts\start_hybrid_stack.ps1

Once running, access the Operations Console at: http://localhost:8000/client/compact

Architecture & Data Flow

  1. Data Ingestion: The system consumes data from data/master_traffic.csv and merges it with live datasets tracked inside data/live_traffic_history.sqlite.
  2. Analysis: When a user selects a segment, the API (api.py) invokes run_arima_study to calculate metrics dynamically.
  3. Frontend Presentation: app.js runs concurrent asynchronous fetch requests to compile the dashboard instantly without blocking the user interface.

Disclaimer

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.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages