Railway

Deploy NYC Bus-Lane Corridors

Before/after bus speed, trip time & ridership for NYC bus-lane routes

Deploy NYC Bus-Lane 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:

VariableWhat it is
VITE_CARTO_API_BASEYour CARTO region API base, e.g. https://gcp-us-east1.api.carto.com
VITE_CARTO_CONNECTIONCARTO connection name, e.g. carto_dw
VITE_CARTO_TOKENCARTO API Access Token (public, read-only, referer-locked to your Railway domain)
VITE_ROUTES_TABLERoute-shapes table (fully-qualified name)
VITE_LANES_TABLEBus-lane table (fully-qualified name)
VITE_MONTHLY_TABLEMonthly-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

More templates in this category

View Template
NEW
Betterlytics
Betterlytics is a cookieless analytics platform GDPR-compliant.

Anarchist Manifesto
27
View Template
NEW
Finance Tracker
Private multi-user household finance ledger with budgets and CSV import.

wotonews
0
View Template
Matomo Analytics + MariaDB
Privacy-friendly analytics with MariaDB and persistent volumes.

leodev
1