How cyruschu430/hk-city-monitor works
HK City Monitor is a static, browser-based Hong Kong situational-awareness dashboard. A reader opens the map, selects a scenario or panel, and sees sourced observations rendered as map layers and readouts; the app also supports camera imagery, search, bilingual display, and an offline-generated city brief. The main wiring and key fetch/render relationships are visible in excerpts; some README capabilities are documented but their data registries are absent from the supplied tree. The graph omits unverified links and treats the Worker as an optional proxy integration.
Main entry points: main.ts App bootstrap · panels.ts Panel engine · adapters.ts Source adapters · sources.ts Source registry
Components 20
Dashboard runtime
- App bootstrap
web/src/main.ts - Bilingual UI
web/src/lib/i18n.ts - ⌘K search
web/src/lib/search.ts
Data and panels
- Panel engine
web/src/ui/panels.ts - Source adapters
web/src/lib/adapters.ts - Payload parsers
web/src/lib/parsers.ts - Source registry
web/src/lib/sources.ts - Freshness states
web/src/lib/honesty.ts - Panel renderer
web/src/lib/render.ts - City brief
scripts/build_ai_summary.py
Map experience
- Map layers
web/src/map/overlays.ts - Basemap
web/src/map/basemap.ts - Camera layer
web/src/map/cameras.ts - Map symbols
web/src/map/symbols.ts - Layer controls
web/src/ui/layercontrol.ts - Live ticker
web/src/ui/ticker.ts
External services
- Whitelist proxy
worker/src/index.js - Public data publishers
- Published brief file
Other components
- Dashboard reader
Connections 21
- Dashboard reader → App bootstrap: opens
README.md - App bootstrap → Source registry: loads registry
web/src/main.ts - App bootstrap → Camera layer: loads cameras
web/src/main.ts - App bootstrap → Map layers: applies layers
web/src/main.ts - App bootstrap → Live ticker: creates ticker
web/src/main.ts - App bootstrap → Layer controls: wires controls
web/src/main.ts - App bootstrap → Panel engine: mounts panels
web/src/main.ts - Panel engine → Source adapters: fetches data
web/src/ui/panels.ts - Source adapters → Source registry: fetches sources
web/src/lib/adapters.ts - Source adapters → Payload parsers: parses payloads
web/src/lib/adapters.ts - Panel engine → Freshness states: tracks freshness
web/src/ui/panels.ts - Panel engine → Panel renderer: renders panels
web/src/ui/panels.ts - Map layers → Source adapters: adapts layer data
web/src/map/overlays.ts - Map layers → Source registry: fetches layer data
web/src/map/overlays.ts - Camera layer → Map symbols: registers glyphs
web/src/map/cameras.ts - Dashboard reader → City brief: reads brief
README.md - City brief → Public data publishers: assembles feeds
README.md - City brief → Published brief file: publishes JSON
README.md - Panel engine → Public data publishers: shows observations
README.md - Source registry → Whitelist proxy: proxies restricted feeds
README.md - Whitelist proxy → Public data publishers: requests whitelisted data