Warning
This is a work in progress. Some features are still missing/broken.
The best website to check the status of your train (and bus).
If you'd like to try a hosted version of the API, you can read the API Documentation. You can also host your own version using the prebuilt container images linked to this repository.
A realtime transit map is available at trainstat.us/map.
- Blazingly fast 😼😼😼😼
- Real-time alerts and arrivals for various transit agencies
- Works offline
- Installable as a PWA
- Shallow routing between modals so you never lose your place
- Shareable links for your trip
- Works on mobile and desktop
- No ads or tracking (your geolocation data never leaves your device)
- View transit data at a specific point in time
- Simple JSON API that you can use to develop your own applications.
- Automatic vector tile layers for spatial data using Martin.
| Agency | Status |
|---|---|
| MTA Subway | ✅ |
| MTA Bus | ✅ |
| NJT Bus | |
| NJT Rail | 🚧 |
| LIRR | 🚧 |
| MNR | 🚧 |
- ✅: Complete
⚠️ : Working on it- 🚧: Not started yet
Note
You might need to restart the martin container on the first run so it picks up the PostGIS tables generated by the sqlx migrations.
- Podman (Docker can be used, but mise tasks use podman)
- mise (Required for local development)
- BusTime API Key
- NJT Developer Account
- Review and set the required environment variables listed in
backend/README.mdandfrontend/README.md. - Geo styles are generated from
geo/styles/*.jsonduring the geo-assets image build. Unless you are usinghttp://localhost:5173, you will need to build your own image with the correct domain.- Set the
STYLE_BASE_URLSarg when buildinggeo/Dockerfile.assetsto include your host URL(s) (comma-separated). - Run
mise //geo:build:assetsto build the asset image.
- Set the
- See
demo.pod.ymlfor an example deployment with traefik. - Copy
demo.configmap.yml.exampletodemo.configmap.ymland fill in the required values. - In
demo.pod.yml, setmartin.yml -> styles.sources.dark-matterto the matching generated filename (for exampledark-matter.example-com.json). - Launch it with
mise demo.
- Clone the repository
- Run
mise ito ensure all tools are installed - Set the environment variables as listed in
backend/README.mdinside abackend/mise.local.tomlyou create.- Non-sensitive variables like the DB URLs are already set in the root
mise.toml.
- Non-sensitive variables like the DB URLs are already set in the root
- You can pull the geo data and assets from ghcr or build them locally with
mise //geo:build(it will take a while). - Run
mise //geo:exportto export the valhalla config. - Start the required services with
mise start-containers. - Once everything is up, start the backend and frontend with
mise dev.
To stop and clean up the local dev pod, run podman kube down dev.pod.yml. You can also run mise //backend:reset-db to remove volumes created by the dev.pod.yml.