AlertsViewer is an internal project helping us with myriad alert-related needs. It allows us to:
- explore alert data
- explore existing bus delay alerts
- experiment with determining when alerts should be created
AlertsViewer application architecture
- MBTA API key (get one here)
- 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
asdf
with plugins:elixir
,erlang
asdf install
mix deps.get
cp .env.example .env
- In
.env
: Fill inAPI_KEY=
with the API key you obtained above. Obtain theSWIFTLY_AUTHORIZATION_KEY
from the shared vault in 1password, and fill it in too. - Export the variables in
.env
, eg in bashset -a && . .env && set +a
mix ecto.setup
MIX_ENV=test mix ecto.setup
mix test
To start your Phoenix server:
- Start Phoenix endpoint with
mix phx.server
or inside IEx withiex -S mix phx.server
Now you can visit localhost:4000
from your browser.
This project uses the Laboratory library to manage user flags. These flags are per-user, saved in local browser storage, and expire every 30 days. To see what flags are available and set them for yourself, visit the /_flags
route (you may need to refresh the page to see a change). To add new flags, set them in the config file. They will automatically be available as assigns in both regular and live view pages.