Skip to content

mbta/alerts_concierge

Repository files navigation

Alerts Concierge

a.k.a. T-Alerts. Enables MBTA riders to subscribe to notifications for service disruptions.

Setup

Requirements

  • MBTA API key (get one here)
    • Note: This key must have its version set to 2021-01-09
    • You may need to request an increased rate limit if you get errors during the first app startup; 2000 requests per minute should be enough
  • PostgreSQL 13 (using Homebrew: brew install postgresql@13)
    • You will need Postgres client tools in your PATH; if using Homebrew and you get an error about missing tools, use brew link postgresql@13
  • Google Chrome
  • Chromedriver (using Homebrew: brew install --cask chromedriver)
  • asdf with plugins: elixir, erlang, nodejs
  • direnv (optional, for auto-loading env vars)

Instructions

  1. asdf install
  2. mix deps.get
  3. npm install --prefix apps/concierge_site/assets
  4. cat .envrc.example | sed -e "s/__username__/$(logname)/g" > .envrc
  5. In .envrc: Fill in API_KEY= with the API key you obtained above
  6. direnv allow
  7. mix ecto.setup
  8. MIX_ENV=test mix ecto.setup

The above assumes you have a PostgreSQL user with the same name as your OS user (logname), which should be the default with a Homebrew install. Otherwise, you may need to adjust the username in .envrc.

If not using direnv, you can instead source .envrc to perform a one-time export of the environment variables into your current shell session.

Running tests

  • mix test

Running the application

Deployment

We run the app on AWS: see docs/aws.md for deployment guides.

Scrubbing the Production Database for Local Usage

See scripts/sanitize_db_dump/README.md