🚦 TrafficIQ β€” Real-Time Traffic & Route Planning

A full-featured traffic monitoring app with live incident alerts, flow data, and intelligent route suggestions.

Features

  • πŸ“‘ Real-time traffic flow β€” current speed vs free-flow speed with visual indicators
  • 🚨 Live incident alerts β€” accidents, road works, hazards, closures on the map
  • πŸ—ΊοΈ Smart route planning β€” multiple routes with delay comparisons, auto-selects best
  • πŸ“ GPS location β€” auto-detects your position and centers the map
  • πŸŒ™ Dark mode map β€” high-contrast dark map with color-coded traffic layers
  • πŸ”„ Auto-refresh β€” incidents update every 60 seconds

Architecture

Rendering mermaid diagram...

Files

FilePurpose
main.tsHono server β€” API proxy + simulation fallback
frontend/index.htmlApp shell, loads Leaflet + React
frontend/style.cssDark UI design system
frontend/index.tsxReact entry point
frontend/components/App.tsxRoot component, state management, data fetching
frontend/components/MapView.tsxLeaflet map β€” markers, routes, incident overlays
frontend/components/Sidebar.tsxTraffic Flow / Routes / Incidents panel

Setup (for live traffic data)

  1. Register for a free TomTom API key at developer.tomtom.com
  2. Add it as an environment variable in this val:
    • Key: TOMTOM_API_KEY
    • Value: your key

Without the key the app runs in Demo Mode with realistic simulated data.

Color Legend

ColorMeaning
🟒 GreenFree flow (β‰₯85% speed)
🟑 YellowModerate (65–85%)
🟠 OrangeSlow (45–65%)
πŸ”΄ RedStop & Go (<45%)