Skip to content

Latest commit

 

History

History
61 lines (48 loc) · 2.53 KB

getting_started.md

File metadata and controls

61 lines (48 loc) · 2.53 KB

Getting Started

Install tools

  1. Clone this repo
  2. Install asdf
  3. Install language build dependencies: brew install coreutils
  4. Add asdf plugins:
    1. asdf plugin-add erlang
    2. asdf plugin-add elixir
    3. asdf plugin-add nodejs
  5. Install versions specified in .tool-versions with asdf install

Set up environment

  1. Install direnv
  2. cp .envrc.template .envrc
  3. Fill in API_V3_KEY with a V3 API key
    • If you haven't already, create a V3 API account using your work email, and use the portal to create an API key.
  4. direnv allow

Copy configuration

  1. Run scripts/pull_configs.sh dev. This will save the current Screens and Signs-UI configuration stored on S3 to the priv directory, which is where the app expects to find this configuration when running locally.
    • This script uses the aws CLI, so it assumes you have this installed and configured with working credentials, and that your AWS account has Screens team permissions. If you don't have all this completely set up but do have S3 access through the AWS web console, you can get the files from there, referring to the script to see what to copy and where to save it. Or, ask the team if someone can send you their files!

Start the server

  1. mix deps.get
  2. npm install --prefix assets
  3. mix phx.server
  4. Visit http://localhost:4000/v2/screen/PRE-101 (one of our screens, chosen arbitrarily) to check that everything is working!

AWS credentials

In deployed environments, the app gets its configuration directly from S3, and the admin interface can write the configuration to S3 as well. To test or work on this functionality locally, you'll need an AWS access key.

The app will use a key stored in the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. These can be exported or saved in a .envrc as with the V3 API key above, but for security reasons it is recommended to only store them in 1Password. There are a few ways to make these available to the app using the 1Password CLI, but one way is using an export command like this (which works in .envrc):

export AWS_SECRET_ACCESS_KEY=$(op item get --vault VAULT_NAME ITEM_NAME --field FIELD_NAME)