Real-time bus tracker that polls the UK BODS AVL feed and renders vehicle locations on a Leaflet map. Includes a local-only configuration UI, vehicle list, and movement-based trail coloring for quick at-a-glance status. Real-time bus location around Maidstone (and further afield).
- Live vehicle polling with adaptive backoff on errors.
- Leaflet map with colored markers and optional trails.
- Filterable table by route or vehicle ID.
- Operator name lookup via the Traveline NOC dataset.
- In-browser configuration panel for local tuning.
npm install
export BODS_API_KEY="your_key"
export BODS_BOUNDING_BOX="0.510,51.266,0.531,51.279"
npm run devOpen http://127.0.0.1:3000.
Environment variables:
PORT: server port (default3000)HOST: server host (default127.0.0.1)BODS_API_KEY: required API key for BODS AVL dataBODS_BOUNDING_BOX:minLon,minLat,maxLon,maxLatBODS_OPERATOR_REF: optional NOC operator codeBODS_LINE_REF: optional line ref (route)BODS_FORMAT:xml(default) orgtfs(GTFS-RT parsing is not implemented yet)BODS_POLL_INTERVAL_MS: minimum poll interval (default12000)BODS_POLL_MAX_INTERVAL_MS: max backoff interval (default60000)NOC_FORMAT:auto,json, orxml(defaultauto)NOC_TIMEOUT_MS: NOC fetch timeout (default20000)NOC_CACHE_TTL_MS: NOC cache TTL (default86400000)
The UI configuration panel updates the in-memory config on the server. It is intended for local use only.
GET /api/vehicles: latest vehicle snapshot plus polling statusGET /api/config: current configuration detailsPOST /api/config: update config (JSON body)GET /api/operators?codes=OP1,OP2: operator code to name map
- Requires Node.js 18+ for the built-in
fetch. - Frontend assets are served from
public/. - Server entrypoint is
src/server.js.
- BODS AVL datafeed: https://data.bus-data.dft.gov.uk/
- Traveline NOC dataset: https://www.travelinedata.org.uk/noc/