Deploy NYC Bus-Lane Corridors
Before/after bus speed, trip time & ridership for NYC bus-lane routes
nyc-bus-corridors
Just deployed
Deploy and Host NYC Bus-Lane Corridors on Railway
NYC Bus-Lane Corridors is an interactive CARTO + deck.gl map that shows, for Manhattan's 5 busiest bus-only-lane routes, how bus speed, trip time, and ridership changed before vs. after the lane. Ride each route end-to-end (a "before-lane" point races an "after-lane" point), scrub the trip, and read Apache ECharts panels — all streaming live from CARTO. Themed for the Spatial Data Science Conference (New York, Oct 20–21, 2026).
About Hosting NYC Bus-Lane Corridors
It's a static Vite + React single-page app. Railway builds it with npm run build and serves the compiled dist/ with vite preview on the injected $PORT (config in railway.json). There is no backend and no database — the app talks directly to the CARTO Maps + Widget APIs from the browser using a referer-locked public token, so hosting is just a small static web service. A public domain is generated automatically on deploy.
Why Deploy NYC Bus-Lane Corridors on Railway
Railway builds straight from the GitHub repo, injects the CARTO configuration as environment variables at build time (Vite inlines them), gives you a public HTTPS domain out of the box, and redeploys on every push. No Dockerfile or server code to maintain — set six variables and deploy.
Common Use Cases
- A conference / demo map showing the measurable impact of bus-priority lanes.
- A template for any CARTO + deck.gl before/after spatial story driven by warehouse tables.
- A reference for pulling CARTO tables into deck.gl with a public, referer-locked API access token.
Dependencies for NYC Bus-Lane Corridors
- A CARTO account with the three source tables (
*_routes,*_lanes,*_monthly) in your data warehouse. - A CARTO API Access Token — read-only, scoped (
sql,maps) to those tables, and referer-locked to your Railway domain. See CARTO's docs: API access tokens.
Deployment Dependencies
Set these service variables when deploying:
| Variable | What it is |
|---|---|
VITE_CARTO_API_BASE | Your CARTO region API base, e.g. https://gcp-us-east1.api.carto.com |
VITE_CARTO_CONNECTION | CARTO connection name, e.g. carto_dw |
VITE_CARTO_TOKEN | CARTO API Access Token (public, read-only, referer-locked to your Railway domain) |
VITE_ROUTES_TABLE | Route-shapes table (fully-qualified name) |
VITE_LANES_TABLE | Bus-lane table (fully-qualified name) |
VITE_MONTHLY_TABLE | Monthly-speed table (fully-qualified name) |
Create the token with your Railway domain as the referer, e.g.:
carto credentials create token --connection carto_dw \
--source \
--source \
--source \
--apis sql,maps --referers 'https://.up.railway.app*'
Source & docs: https://github.com/gabrielAHN/nyc-bus-corridors-app
Template Content
nyc-bus-corridors
gabrielAHN/nyc-bus-corridors-appVITE_CARTO_TOKEN
VITE_LANES_TABLE
VITE_ROUTES_TABLE
VITE_MONTHLY_TABLE
VITE_CARTO_API_BASE
VITE_CARTO_CONNECTION