A hobby project that uses the MTA's GTFS static and realtime feeds to get realtime transit info about public transit near our high school, The Bronx High School of Science.
Create a .env
file and add the following variables.
The MTA's BusTime feeds require an API key, which you can obtain here.
The configuration file is located in config.ts
. It is currently set to stops located near The Bronx High School of Science, but this file is meant to be edited to display any stop in the MTA network. Stops can be added (either subway or bus) with StopConfig
objects, which is explained in depth below.
Although each GTFS stop_id
refers to a single platform, we have anticipated for the need to combine platforms with built-in transfers. The first stop_id
is used to distinguish the stop_name
and as a key.
Although the Rust backend uses the MTA's GTFS realtime feeds to get information about when a vehicle is scheduled to arrive at a station, it may be unhelpful for the vehicle to arrive faster than someone would be able to "catch" it. walk_time
is used to remove vehicles from the React.js frontend that are deemed to be unlikely for someone to "catch" it.
Install the following dependencies.
The webpage can be found at http://localhost:3000/ after deploying.
Open 2 terminals and run the following commands.
cargo test
cargo run
npm install
npm run dev
Open 2 terminals and run the following commands.
Note:
start
is a command only found on Windows.
cargo test
cargo build --release
start .\target\release\transit-board.exe
npm install
npm run build
npm run start