Skip to content

Techno3d/TransitArrivalBoard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

247 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transit Board

A hobby project that retrives and displays realtime MTA subway and bus arrival information for any stop. It also tracks service alerts for subway.

Please follow this guide on how to setup and deploy this project on your device.

Tools

Required

Optional

We have provided a Makefile that helps automate development and deployment. To use it, please install Make and Git using the command that corresponds to your OS.

Windows

winget install Git.Git GnuWin32.Make

macOS

xcode-select --install

Environment Variables

Create a .env file in the backend directory and add the following variables.

Key Value
MTABUSKEY An API key for the MTA BusTime API. Request one here.

Configuration

Modify config.json in the root directory to customize your board to your liking. By default, it tracks stops near The Bronx High School of Science.

Root

Key Type Description
subway Array<Stop> The list of subway stops you want to track.
bus Array<Stop> The list of bus stops you want to track.
theme Theme The color theme for the components. Provide the colors in hex.
maintainers Array<Maintainer> The list of developers that should be credited.

Object: Array

You can find a detailed reference on the MDN Web Docs.

Object: Stop

Key Type Description
name string This allows you to set a nickname for the stop being tracked. If left blank, the stop_name of the first element in stop_ids will be used.
stop_ids Array<string> You can group all of the various stations you wish to track together by inserting its corresponding stop_id in the array. If you need help finding a station's stop_id, you can download the GTFS feeds provided by the MTA.
walk_time number It may be unhelpful to include vehicles that will depart faster than it would take someone to walk to the station. walk_time should be the average time it takes for someone to comfortably walk from the location of the board to the station. All vehicles that will arrive in less than half the walk_time will not be included.

Object: Theme

Key Type Description
primary_color string This color will be used for the stop name title bar.
text_color string This color will be used on the text inside the stop name title bar.
background_color string This color will be used on the background of the page.

Object: Maintainer

Key Type Description
name string The name of the maintainer. Can be a person or an organization.
github_id number Optional. The GitHub ID of the maintainer.

Deployment

Warning

Please install the optional tools to run make. Otherwise, you are able to manually run these commands by inspecting the Makefile.

Before you begin, run the following command to install the project dependencies.

make install

Development

To build amd run the project for development, run each command in seperate terminals.

cd backend && cargo run
cd frontend && npm run dev

You can view the webpage at http://localhost:5173.

Production

To build the project for production, run the following command.

make build

To run the project, run each command in seperate terminals.

cd backend && ./target/release/transit-board
cd frontend && npm run preview

You can view the webpage at http://localhost:4173.

About

Gets and displays public transit info around Bronx Science

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages