How keithligh/hk-traffic-intelligence works
HK Traffic Intelligence is a public Hong Kong transport and weather dashboard, not a route planner. Visitors use a map and operations panel to compare road speeds, harbour crossings, boundary queues, weather warnings and public-transport arrivals; map stops can expose arrival details. API handlers obtain and shape published feeds, while shared upstream caching limits repeat requests. The README documents the major product areas; some route-to-UI wiring and unsampled subsystem internals are not visible in the excerpts, so those links are omitted rather than inferred.
Main entry points: lib Feed processors · upstream.ts Upstream fetch and cache · dashboard.tsx Dashboard · city-map.tsx Interactive map
Components 24
Dashboard experience
- Dashboard
src/components/dashboard.tsx - Interactive map
src/components/city-map.tsx - Map detail cards
src/components/map-cards.ts - Language controls
src/components/locale.tsx - Priority intel
src/lib/intel.ts
Roads and conditions
- Road speeds
src/app/api/traffic/route.ts - Harbour approaches
src/app/api/approaches/route.ts - Cameras and works
src/app/api/picture/route.ts - Traffic incidents
src/app/api/incidents/route.ts - Boundary points
src/app/api/control-points/route.ts - Warnings and weather
src/app/api/warnings/route.ts
Public transport
- Rail arrivals
src/app/api/mtr/route.ts - Light Rail arrivals
src/app/api/lrt/route.ts - Bus arrivals
src/app/api/kmb/route.ts - Citybus arrivals
src/app/api/citybus/route.ts - Green minibus
src/app/api/gmb/route.ts - New Lantao Bus
src/app/api/nlb/route.ts - Ferry arrivals
src/app/api/ferry/route.ts - Stop boards
src/lib/stop-board.ts
Feed services
- Feed processors
src/lib - Upstream fetch and cache
src/lib/upstream.ts - Shared feed cache
src/lib/feed-cache.ts
Other components
- Visitor
- Public data publishers
Connections 27
- Visitor → Dashboard: opens
README.md - Dashboard → Interactive map: presents map
- Dashboard → Priority intel: surfaces priorities
- Interactive map → Map detail cards: opens details
src/components/city-map.tsx - Interactive map → Language controls: uses locale
src/components/city-map.tsx - Map detail cards → Language controls: formats text
src/components/map-cards.ts - Priority intel → Warnings and weather: ranks warnings
- Road speeds → Upstream fetch and cache: fetches feeds
src/app/api/traffic/route.ts - Road speeds → Feed processors: builds corridors
src/app/api/traffic/route.ts - Harbour approaches → Upstream fetch and cache: fetches journey times
src/app/api/approaches/route.ts - Harbour approaches → Feed processors: shapes points
src/app/api/approaches/route.ts - Cameras and works → Upstream fetch and cache: fetches layers
src/app/api/picture/route.ts - Cameras and works → Feed processors: enriches features
src/app/api/picture/route.ts - Traffic incidents → Feed processors: parses notices
src/app/api/incidents/route.ts - Boundary points → Feed processors: shapes points
src/app/api/control-points/route.ts - Warnings and weather → Upstream fetch and cache: fetches conditions
src/app/api/warnings/route.ts - Warnings and weather → Feed processors: parses weather
src/app/api/warnings/route.ts - Rail arrivals → Feed processors: loads arrivals
src/app/api/mtr/route.ts - Light Rail arrivals → Feed processors: loads arrivals
src/app/api/lrt/route.ts - Bus arrivals → Feed processors: loads arrivals
src/app/api/kmb/route.ts - Citybus arrivals → Feed processors: loads arrivals
src/app/api/citybus/route.ts - Green minibus → Feed processors: loads arrivals
src/app/api/gmb/route.ts - New Lantao Bus → Feed processors: loads arrivals
src/app/api/nlb/route.ts - Ferry arrivals → Feed processors: loads sailings
src/app/api/ferry/route.ts - Stop boards → Feed processors: assembles boards
src/app/api/board/route.ts - Upstream fetch and cache → Shared feed cache: reads and writes
src/lib/upstream.ts - Upstream fetch and cache → Public data publishers: requests feeds
src/lib/upstream.ts