You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build a centralised NestJS module for calling the Metrolinx Open Data API. This is a prerequisite for all real-time features: coach check-in (#67), schedule change detection (#163), and service alerts (#187).
Why a shared module
Without it, every contributor implementing a real-time feature has to independently handle:
API key injection from environment variables
Server-side response caching (required by Metrolinx ToS §6 — never call per-user-request)
HTTP client setup and error handling
Rate limit awareness
Requirements
API key — read from METROLINX_API_KEY env var; fail loudly on startup if missing when real-time features are enabled
Caching — all responses cached server-side with appropriate TTLs:
Fleet Consist: 1 service day (consists are stable within a day)
TripUpdates / Alerts: 30 seconds (feeds refresh on a fixed interval)
VehiclePosition: 15 seconds
Base URL — configurable via env (default: https://api.openmetrolinx.com/OpenDataAPI)
Summary
Build a centralised NestJS module for calling the Metrolinx Open Data API. This is a prerequisite for all real-time features: coach check-in (#67), schedule change detection (#163), and service alerts (#187).
Why a shared module
Without it, every contributor implementing a real-time feature has to independently handle:
Requirements
METROLINX_API_KEYenv var; fail loudly on startup if missing when real-time features are enabledhttps://api.openmetrolinx.com/OpenDataAPI)API key registration
Registration is at https://api.openmetrolinx.com/OpenDataAPI/Help/Registration/en (free, takes up to 10 business days). A key has been requested — coordinate with project maintainers for access.
References
docs/metrolinx-open-data.md