Repository navigation
Add VIA Rail (Canada) coverage area - #3
Open
Kai-Goodall wants to merge 1 commit into
Open
Kai-Goodall wants to merge 1 commit into
Kai-Goodall wants to merge 1 commit into
Conversation
A self-contained service that serves live Canadian passenger rail in the exact Trainiac /v1 shape, built from VIA's open feeds (live tracker + GTFS). Lives entirely in via/; no existing files are touched. - All ten /v1 endpoints, same envelope and v1.d.ts types - Live tracker for actuals/positions/delays, GTFS for schedule/journeys - Multi-day trains and all six time zones materialised correctly - Zero runtime dependencies; runs on Node 22+ with no build step - 33 tests incl. strict validation against openapi.v1.json Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey! This adds VIA Rail (Canada) as a new coverage area that speaks the existing
/v1contract exactly — same envelope, samev1.d.tstypes, same endpoints — just pointed at Canadian passenger rail.It's completely isolated. Everything lives in a single new
via/folder. No existing files are touched (yourREADME.md,openapi.v1.json,v1.d.ts,MIGRATING.md,examples/are all untouched), and there are no new CI/workflows, so merging can't break anything already here.What it does
Serves all ten
/v1endpoints for VIA — departures, journey (direct + changes), train, stations, activity, delays, cancellations, summary, status, index — built from VIA's own open feeds:tsimobile.viarail.ca/data/allData.json) → actuals, positions, delays, activityviarail.zip) → the 387-station registry, forward timetable, journey planning, countsNotes
cd via && node src/server.ts.openapi.v1.json.npm --prefix via test.via/README.md):status.feedsis hard-coded to{trust, td, darwin}in the contract, so VIA's tracker maps ontotrustand the other two reportunknown; platforms are alwaysunknown(no VIA source); cancellations come from service alerts.via/vendors a copy ofv1.d.tsandopenapi.v1.jsonso the module is self-contained — happy to de-dupe against the repo root if you'd rather.Totally your call on placement
I wasn't sure if you'd prefer this as its own repo (e.g.
trainiac-hq/via) rather than living insidedocs. If so, say the word and I'll move it — this PR is just the easiest way to hand it over for review. No pressure to merge as-is.🤖 Generated with Claude Code