Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maidstone & Kent Bus Tracker

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).

Features

  • 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.

Quick start

npm install
export BODS_API_KEY="your_key"
export BODS_BOUNDING_BOX="0.510,51.266,0.531,51.279"
npm run dev

Open http://127.0.0.1:3000.

Configuration

Environment variables:

  • PORT: server port (default 3000)
  • HOST: server host (default 127.0.0.1)
  • BODS_API_KEY: required API key for BODS AVL data
  • BODS_BOUNDING_BOX: minLon,minLat,maxLon,maxLat
  • BODS_OPERATOR_REF: optional NOC operator code
  • BODS_LINE_REF: optional line ref (route)
  • BODS_FORMAT: xml (default) or gtfs (GTFS-RT parsing is not implemented yet)
  • BODS_POLL_INTERVAL_MS: minimum poll interval (default 12000)
  • BODS_POLL_MAX_INTERVAL_MS: max backoff interval (default 60000)
  • NOC_FORMAT: auto, json, or xml (default auto)
  • NOC_TIMEOUT_MS: NOC fetch timeout (default 20000)
  • NOC_CACHE_TTL_MS: NOC cache TTL (default 86400000)

The UI configuration panel updates the in-memory config on the server. It is intended for local use only.

API endpoints

  • GET /api/vehicles: latest vehicle snapshot plus polling status
  • GET /api/config: current configuration details
  • POST /api/config: update config (JSON body)
  • GET /api/operators?codes=OP1,OP2: operator code to name map

Development notes

  • Requires Node.js 18+ for the built-in fetch.
  • Frontend assets are served from public/.
  • Server entrypoint is src/server.js.

Data sources

About

Real-time bus location around Maidstone (and further afield).

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages