How raphbag/webtrain works
WebTrain is a French rail-information site: users view stations and rail lines on a map, filter transport modes, and inspect station departures/arrivals and service disruptions. Its browser UI is backed by Astro API routes that proxy IDFM and SNCF data; additional routes support theoretical schedules and trip details. The README documents the major UI and API capabilities, while sampled source confirms selected proxy, enrichment, and rendering behavior. The client-to-route wiring and several route implementations were not shown, so those links are marked unverified or omitted.
Main entry points: stopMonitoring.ts Schedules and disruptions · index.astro Map page · formTheoreticalSchedule.astro Theoretical schedule form · horaires.json.ts IDFM live times
Components 21
Map and interface
- Map page
src/pages/index.astro - Mode filters
src/components/FilterPanel.astro - Site header
src/components/Header.astro - Schedules and disruptions
src/scripts/stopMonitoring.ts - Theoretical schedule form
src/components/formTheoreticalSchedule.astro - Theoretical schedules page
src/pages/horaires-theoriques.astro
IDFM services
- IDFM stations
src/pages/api/idfm/gares.json.ts - IDFM lines
src/pages/api/idfm/lignes.json.ts - IDFM live times
src/pages/api/idfm/horaires.json.ts - IDFM disruptions
src/pages/api/idfm/perturbations.json.ts - IDFM theoretical times
src/pages/api/idfm/theoriques.json.ts - IDFM trip details
src/pages/api/idfm/trajet.json.ts
SNCF services
- SNCF stations
src/pages/api/sncf/gares.json.ts - SNCF lines
src/pages/api/sncf/lignes.json.ts - SNCF live times
src/pages/api/sncf/horaires.json.ts - SNCF disruptions
src/pages/api/sncf/perturbations.json.ts
External data
- Google Maps
- IDFM PRIM
- SNCF Navitia
- SNCF SIRI Lite
Other components
- Traveler
Connections 21
- Traveler → Map page: views map
README.md - Map page → Google Maps: renders map
README.md - Map page → Mode filters: offers filters
README.md - Map page → Schedules and disruptions: shows live info
- Theoretical schedules page → Theoretical schedule form: presents form
- Theoretical schedule form → IDFM theoretical times: requests schedules
- Schedules and disruptions → IDFM live times: requests times
- Schedules and disruptions → IDFM disruptions: requests disruptions
- Schedules and disruptions → SNCF live times: requests times
- Schedules and disruptions → SNCF disruptions: requests disruptions
- Schedules and disruptions → IDFM trip details: requests trip details
- IDFM stations → IDFM PRIM: fetches stations
README.md - IDFM lines → IDFM PRIM: fetches lines
README.md - IDFM live times → IDFM PRIM: fetches live times
src/pages/api/idfm/horaires.json.ts - IDFM disruptions → IDFM PRIM: fetches reports
src/pages/api/idfm/perturbations.json.ts - IDFM theoretical times → IDFM PRIM: fetches schedules
src/pages/api/idfm/theoriques.json.ts - IDFM trip details → IDFM PRIM: fetches trip
src/pages/api/idfm/trajet.json.ts - SNCF stations → SNCF Navitia: fetches stations
README.md - SNCF lines → SNCF Navitia: fetches lines
README.md - SNCF disruptions → SNCF Navitia: fetches reports
src/pages/api/sncf/perturbations.json.ts - SNCF live times → SNCF SIRI Lite: fetches SIRI feed
src/pages/api/sncf/horaires.json.ts