/microCOVID

Estimating the COVID risk of ordinary activities

Primary LanguageTypeScriptMIT LicenseMIT

CI Netlify Status Translate on Weblate

microCOVID.org

Local Development

Requirements:

  • Node.js 12
  • Yarn

(See .tool-versions for specific and up-to-date versions).

  1. Install local depenendences
    $ yarn install
  2. Start local server
    $ yarn start
  3. Open http://localhost:3000

Prevalence updates

  1. Install venv to be able to run prevalence updates
    $ python3 -m venv .venv
    $ source .venv/bin/activate
    $ pip install -r requirements-manual.txt
  2. Install the GitHub CLI to be able to using the gh command with the prevalence_helper.sh script
    # using homebrew (see GitHub page for alternate install methods)
    $ brew install gh
  3. Get a COVIDActNow.org API key from here. (If you're on the microCOVID team, you can ask for our existing API key.)
  4. Then configure your API key as such:
    $ cp .secure-keys.template .secure-keys
    # Add your API key to the line in .secure-keys that is listed as CAN_API_KEY
  5. Run a prevalence update. Pick one of the three following examples:
    # Run the prevalence update on the auto-prevalence-update branch
    $ yarn prevalence
    # Run the prevalence update, commit changes, and submit auto-merge pull request
    $ yarn prevalence -c
    # Run the prevalence update without switching branches (useful when testing changes on a feature branch)
    $ yarn prevalence -b
    # Specify the COVIDActNow.org API key
    $ yarn prevalence -k 111aaa222bbb
    # Specify where your virtualenv lives (defaults to `.venv`)
    $ yarn prevalence -v .venv-custom

Linting

We use eslint to standardize our style across files. To check your files with the linter, run:

$ yarn lint

If you see warnings, you can attempt to auto-correct them with:

$ yarn fix

If there are errors it can't fix, please fix them manually before committing.