--- title: Tuas Crossing emoji: 🚗 colorFrom: blue colorTo: green sdk: docker app_port: 7860 pinned: false --- # Tuas Crossing A live + forecast dashboard for the **Tuas Second Link** outbound (Singapore → Johor Bahru) crossing. - **Now** — live corridor speed bands (AYE / Tuas Viaduct / Tuas Second Crossing), predicted AYE → Tuas Checkpoint travel time, incidents, and live traffic camera stills. - **When to cross** — a day × hour heatmap built from accumulated history. ## How it works - `GET /api/live` — travel time, cameras, and incidents come live from LTA DataMall server-side (the API key lives only as the `DATAMALL_KEY` Space secret), cached ~60s. The **corridor speed bands are read from the public dataset** (the laptop collector is the single client of LTA's heavy `v4/TrafficSpeedBands` feed), shown with their age. - `GET /api/history` — reads the public companion dataset CSVs and aggregates average speed band by (day-of-week, hour). - `GET /api/freshness` — newest collected-sample age, for the stale-data badge. Data source: [LTA DataMall](https://datamall.lta.gov.sg/). History is collected on a private always-on machine and pushed to a public Hugging Face Dataset. The DataMall key is **never** exposed to the client — it is used only server-side.