An overhaul of the STUA's countdown clock in react
- Static GTFS feeds (subway, supplemented subway, LIRR) are fetched and parsed by the cron-triggered API route
/api/admin/refresh-static-gtfsevery 12 hours (seevercel.json). - Results (raw zip + parsed JSON bundle) are written to Vercel Blob under
gtfs/<mode>.zipandgtfs/<mode>.json. - The consumer endpoint
/api/mta/static/[mode]reads exclusively from Blob (no local filesystem copies). - Realtime feeds handled in
src/utils/mta/realtime.tsusinggtfs-realtime-bindings(no protobuf.js needed). - Feed URL constants are in
src/utils/mta/feeds.ts.
Required enviornment variables:
BLOB_BASE_URL(public blob base, e.g.https://example.public.blob.vercel-storage.com)BLOB_READ_WRITE_TOKEN(read/write bearer token used by refresh route uploads)
/api/mta/realtime/[feed]- Subway realtime protobuf feed decoded and serialized.
/api/mta/static/[mode]- Static GTFS JSON bundle for "subway", "subway_supplemented", "lirr".
/api/mta/bus/stops?lat=40.7178&lon=-74.0131&radius=400- Nearby bus stops (defaults to Stuyvesant HS coordinates if omitted).
/api/mta/bus/arrivals/[stopId]- SIRI Stop Monitoring (version 2, minimum detail) arrivals for given stop ID.
Bus API env variable (optional, fallback to public key if missing):
BUSTIME_KEY(MTA Bustime api key)
- Implement bus API (nearby stops + arrivals)
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.