Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mbta/alerts_viewer
https://github.com/mbta/alerts_viewer
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/mbta/alerts_viewer
- Owner: mbta
- License: mit
- Created: 2022-12-07T19:30:33.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-08T16:59:39.000Z (5 months ago)
- Last Synced: 2024-08-08T20:06:16.396Z (5 months ago)
- Language: Elixir
- Size: 541 KB
- Stars: 0
- Watchers: 11
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AlertsViewer
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## Architecture
[AlertsViewer application architecture](ARCHITECTURE.md)
## Setup
### Requirements
- MBTA API key (get one [here](https://api-dev.mbtace.com))
- 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`](https://asdf-vm.com/) with plugins: `elixir`, `erlang`### Instructions
1. `asdf install`
2. `mix deps.get`
4. `cp .env.example .env`
5. In `.env`: Fill in `API_KEY=` with the API key you obtained above. Obtain the `SWIFTLY_AUTHORIZATION_KEY` from the shared vault in 1password, and fill it in too.
6. Export the variables in `.env`, eg in bash `set -a && . .env && set +a`
7. `mix ecto.setup`
8. `MIX_ENV=test mix ecto.setup`### Running tests
- `mix test`
## Development
To start your Phoenix server:
- Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
## Flags
This project uses the [Laboratory](https://github.com/paulswartz/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.