This is an application that displays a dashboard showing when nearby buses and trains are expected and how many bikes are in nearby stations. It gets data from the following places:
I build this to give myself a quick dashboard to reference when thinking about how I want to get to work. The most essential questions it answers:
- Is there a nearby bus I can catch?
- Are there bikes in the bikeshare station?
- Are there trains running on time?
Setting up this app requires setting a few environment variables:
WMATA_API_KEY: The API key for the WMATA APIWMATA_BUS_STOP_IDS_HOME: The stop IDs for the bus stops near your homeWMATA_BUS_STOP_IDS_WORK: The stop IDs for the bus stops near your workMETRO_RAIL_STATION_CODES_HOME: The rails station codes for train stations new your homeMETRO_RAIL_STATION_CODES_WORK: The rails station codes for train stations new your workCABI_STATION_IDS_HOME: The station IDs for nearby CaBi stationsCABI_STATION_IDS_WORK: The station IDs for nearby CaBi stations
This app uses dotenv so you can set these in a .env file.
After the environment is setup you can start things up like this:
npm run build
npm start
There is also a development mode that will watch for changes and re-build in response:
npm run watch
When everything is running the app should be available on http://localhost:3000/