Skip to content

Simple React App that displays Metlink stop departures based on stop number.

Notifications You must be signed in to change notification settings

electrictangent/metlink_stops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metlink Stops

Simple react app that shows stop departures based on stop number/ID

App Screenshot

Created using create-react-app. Data for Metlink stop departures provided by the APIs avaliable at https://opendata.metlink.org.nz/

Try my app!

An example of this app in action can be found at https://ml.electrictangent.com

Configuration

Backend config

To use backend server, you'll need to create a JSON config file. An example config file is given below. You must name the file config.json and it must be in the same folder as app.py.

./backend/config.json:

{
    "baseURL" : "https://api.opendata.metlink.org.nz/v1/stop-predictions?stop_id=",
    "staticStopInfoURL" : "https://api.opendata.metlink.org.nz/v1/gtfs/routes?stop_id=",
    "apiKey" : "api-key-here"
}

To start backend API server, navigate to backend folder and use command flask run

Frontend config

In the ./frontend/ folder, create a .env file with the following key:

REACT_APP_BACKEND_ADDR=http://backendaddr:port/

The address must point to your backend server (include trailing / slash).

Credits

Icons provided by Font Awesome. CSS layout created using Bootstrap.

About

Simple React App that displays Metlink stop departures based on stop number.

Topics

Resources

Stars

Watchers

Forks