Public
LikeTrafficIQ
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v15View latest version
A full-featured traffic monitoring app with live incident alerts, flow data, and intelligent route suggestions.
- π‘ 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
Rendering mermaid diagram...
| File | Purpose |
|---|---|
main.ts | Hono server β API proxy + simulation fallback |
frontend/index.html | App shell, loads Leaflet + React |
frontend/style.css | Dark UI design system |
frontend/index.tsx | React entry point |
frontend/components/App.tsx | Root component, state management, data fetching |
frontend/components/MapView.tsx | Leaflet map β markers, routes, incident overlays |
frontend/components/Sidebar.tsx | Traffic Flow / Routes / Incidents panel |
- Register for a free TomTom API key at developer.tomtom.com
- Add it as an environment variable in this val:
- Key:
TOMTOM_API_KEY - Value: your key
- Key:
Without the key the app runs in Demo Mode with realistic simulated data.
| Color | Meaning |
|---|---|
| π’ Green | Free flow (β₯85% speed) |
| π‘ Yellow | Moderate (65β85%) |
| π Orange | Slow (45β65%) |
| π΄ Red | Stop & Go (<45%) |