Skip to content

Repository files navigation

BART Live 3D Atlas

A live map of Bay Area Rapid Transit — watch trains move in real time, flip between a 3D city view and a clean system diagram, and plan a trip without leaving the map.

Try it: bartatlas.com

Not affiliated with BART. Built on publicly available BART open data.


What you can do

  • See every active train on the network, updating live as BART publishes new predictions
  • Switch between a 3D map over the Bay Area and a classic schematic system map — same trains, same trip tools
  • Pick a train and ride along with it (chase camera) to follow its path through the system
  • Plan a trip from any station to any other, then watch the route light up on the map
  • When your train is already out there, the planner can highlight that live train for you
  • Use it on your phone — planner and live trains tuck into bottom sheets so the map stays usable

Stack

Layer Choice
App Next.js (App Router), React, Tailwind CSS
3D / map MapLibre GL, Three.js, React Three Fiber, react-three-map
State Zustand
Live data BART GTFS-RT → /api/bart-live
Trips BART Legacy Schedule API → /api/bart-trips (+ static GTFS for trip-id matching)

How live data works

BART GTFS-RT  ──►  /api/bart-live   ──►  Zustand  ──►  3D / 2D fleet
BART sched API ──►  /api/bart-trips  ──►  Trip planner UI
  • /api/bart-live fetches the public GTFS-RT trip-update feed, decodes it, and estimates each train’s progress along geographic track GeoJSON (estimatePositions.ts). The client dead-reckons smoothly until the next poll.
  • /api/bart-trips proxies BART’s schedule depart API with your BART_API_KEY, then enriches legs with static GTFS trip_ids when possible so a planned trip can highlight the matching live train.

Scripts

Command Purpose
npm run dev Local development server
npm run build / npm start Production build and serve
npm run lint ESLint
npm run test:estimate Live position estimation fixtures
npm run test:reckon Dead-reckoning / blending tests
npm run test:schematic Schematic layout / placement tests
npm run test:* Other focused unit tests (see package.json)

Optional offline data regenerators (not required to run the live map):

Command Purpose
npm run data:hoptimes Rebuild station-hop schedule seconds
npm run data:geo-tracks Rebuild geographic track assets

Project layout

src/
  app/api/          # bart-live, bart-trips
  components/map/   # GeoMap, SchematicMap, trip planner, panels
  components/3d/    # rails, stations, fleet, trip highlight
  lib/bart/         # estimation, motion, GTFS, schematic math
  store/            # Zustand atlas state
public/data/        # track & station GeoJSON
docs/               # design notes and implementation plans

License

MIT © 2026 Vinay Vinod

BART, station names, and related marks belong to their respective owners. Map tiles are subject to MapTiler / OpenStreetMap terms.

About

An interactive, low-poly 3D map of the SF Bay Area. Explore transit lines, track train fleets live, and ride the virtual rails of BART in real-time.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages