bdaniel7 / skate

Gliding on wheels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Skate

Skate is a web-based dispatch tool for bus inspectors, built by the MBTA. Imagine an app that helps you track the one bus you want to catch, but instead it’s helping us track all the buses that everyone wants to catch! It has the rich location data driving our mbta.com and rider apps, but also info that matters for keeping things running smoothly (operator names, bus numbers, shift schedules). For background, read our “Skate: Building a better bus dispatch app (and how it will improve your ride)” blog post.

Animated Skate screenshot

Community

The MBTA Customer Technology Department supports a shared Slack channel that transit agencies and partners adapting the Skate code can use to collaborate and ask questions. To be invited to the Slack channel, email developer@mbta.com.

Setup

Doing development on Skate requires Elixir, Erlang, and node, as dsecribed in .tool-versions. Most developers use asdf to help manage the required versions, but that isn't required.

Quick setup:

  1. Install languange dependencies with asdf install
  2. Install Elixir dependencies with mix deps.get
  3. Install Node.js dependencies with cd assets && npm install

Running the application

  • Start Phoenix endpoint with env `cat .env` mix phx.server (for bash. For fish use: env (cat .env) mix phx.server)
  • Visit localhost:4000 from your browser.

Running tests

  • Run Elixir tests with env `cat .env` mix test (for bash. For fish use: env (cat .env) mix test)
  • Run Javascript tests with cd assets && npm test

Configuring to run in a new environment

There are a number of configuration details defined in environment variables. These define where data sources live, as well as authentication and CDN details. See .env.example for naming and syntax.

  • BUSLOC_URL: Source of GTFS-realtime enhanced VehiclePositions json data file
  • SWIFTLY_REALTIME_VEHICLES_URL and SWIFTLY_AUTHORIZATION_KEY: Source of Swiftly vehicle data
  • SKATE_HASTUS_URL: Source of extended schedule data
  • TRIP_UPDATES_URL: Source of GTFS-realtime enhanced TripUpdates json data file (optional)
  • SECRET_KEY_BASE Used for writing encrypted cookies. Generate a value using mix phx.gen.secret (only required in production)
  • ERLANG_COOKIE Used by Erlang (only required in production)
  • COGNITO_DOMAIN, COGNITO_CLIENT_ID, COGNITO_CLIENT_SECRET, COGNITO_USER_POOL_ID, COGNITO_AWS_REGION, and GUARDIAN_SECRET_KEY: Authentication/authorization details (only required in production)
  • STATIC_SCHEME, STATIC_HOST, STATIC_PATH, and STATIC_PORT: CDN details (only required in production)

About

Gliding on wheels

License:GNU Affero General Public License v3.0


Languages

Language:TypeScript 60.5%Language:Elixir 36.2%Language:CSS 2.6%Language:HTML 0.4%Language:Shell 0.2%Language:JavaScript 0.1%Language:Dockerfile 0.1%