Skip to content

Repository files navigation

slow-zone-web

Mobile-friendly CTA arrival data. Browse nearby stations, jump back to recents and favorites, and follow a specific train as it moves down the line.

Arrival and run data via slow-zone, which wraps the CTA's Train Tracker API.

Station data (names, locations, lines, accessibility) are sourced from the Chicago Data Portal. The app's cache of station information is updated weekly by a scheduled GitHub Action when something changes in the physical world.

Development

Install Node 24, cp .env.example .env, and set at least CTA_API_KEY. Then:

pnpm run dev

Environment variables

See .env.example for the full list. Of those:

  • CTA_API_KEY — key for the CTA Train Tracker API. Required at runtime. Passed through to slow-zone.
  • GOOGLE_MAPS_STATIC_API_KEY — key for the Google Maps Static API. Used to render station map thumbnails. The maps won't show up without it, but the rest of the app works.
  • CHICAGO_DATA_PORTAL_APP_TOKEN — app token for the Chicago Data Portal. Only needed if you run pnpm run update-stations locally.
  • SLOW_ZONE_APP_SECRET — bearer token for API access from the iOS app.

API for the iOS app

Resource routes under /api/v1/, tested with pnpm test:

  • GET /api/v1/stations — the bundled station data, with an ETag. Public.
  • GET /api/v1/stations/:stationId/arrivals — slow-zone's arrivals for the station plus fetchedAt. Needs Authorization: Bearer <SLOW_ZONE_APP_SECRET>.
  • GET /api/v1/runs/:runNumber — the followed train's remaining stops plus fetchedAt. :runNumber is route.run as the CTA spells it, leading zeros included. Same auth.

Errors are {"error": {"code", "message"}}.

Deployment

Automatically deployed via Vercel's Git Integration. Errors are reported to Sentry.

About

Mobile-friendly CTA arrival data. We expect to be moving shortly.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages