Metrovivo Santiago
Santiago's Metro network in 3D, every train in sync with the official timetable.
- Open source
- Web applications
- Full-stack development
- JavaScript · three.js · GSAP · Vite · Vitest · Playwright · GTFS

Summary
Metrovivo draws Santiago's Metro network in 3D and 2D with a single three.js renderer. Every train sits where the official timetable says it should: its position is a deterministic function of the time in America/Santiago, derived from published headways and a physical speed profile, not from random animation. Click a train and the camera flies into its cab.
The data comes from DTPM's official GTFS feed. The script that downloads it rejects the undated file that still circulates in tutorials and refuses to run on an expired feed, because in this domain failure isn't a 404: it's a perfectly valid response full of stale data.
The simulation is a pure function, with no DOM and no renderer, which is why the whole engine is unit-tested. Everything else consumes a single contract, PositionProvider, which doesn't know where positions come from: it's the seam for the day real train data exists. Buses are the exception, since they do show measured positions, and that's why they're drawn blurrier than the trains: they're an uncertain measurement, not an exact fiction.
Metrovivo is not affiliated with Metro de Santiago or DTPM and doesn't use their logo. Train positions are simulated and must not be used to plan a trip.
Problem
Santiago's Metro publishes no live train positions. For service status, the only feed a static site can read is a community API that answers 200 and "OK" with an empty network, reporting no issues even while a station is closed. Showing that false "all clear" would be worse than showing nothing.
Decision
Simulate from the official timetable, and say so, rather than show live data that lies.
export class ScheduleProvider { constructor(sim) { this._engine = sim; } /** Posiciones = f(hora oficial en America/Santiago). */ update(sec, day) { return this._engine.update(sec, day); } get trains() { return this._engine.trains; } get byKey() { return this._engine.byKey; } get byId() { return this._engine.byId; }- Today's only implementation is the timetable. Everything else consumes the contract and never learns where positions come from.
- Positions are a function of official time in America/Santiago.
Numbers
- 7
- 126
Architecture
- 01 DTPM GTFS feed
- leads to 02 scripts/build-data.js
- 02 scripts/build-data.js
- leads to 03 data/network.json
- 03 data/network.json
- leads to 04 Simulation: f(time, day type)
- 04 Simulation: f(time, day type)
- leads to 05 PositionProvider
- 05 PositionProvider
- leads to 06 Network · Trains · Cab · LED
- 06 Network · Trains · Cab · LED