iandees / wof-editor

A simple Who's on First editor.
https://writefield.nextzen.org/
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Write Field

A live version of the tool is available at writefield.nextzen.org.

This repository has four core parts:

Development

  1. Clone this repository.
git clone git@github.com:iandees/wof-editor.git

And move into that checkout:

cd wof-editor
  1. Install dependencies:

Install pyenv to make sure Pipenv has access to the right version of Python:

brew install pyenv

Then also install pipenv for dependency management:

brew install pipenv
  1. Configure your Python environment:
pipenv install --dev

CAUTION: This step may complain about not having the required version of Python (3.11) and ask if you want to install it. Say yes. That'll take a while. You might get hung up on geos/shapely here, depending on which version of gdal you have installed.

Then setup pipenv to get into the Python virtual environment you just created with those dependencies:

pipenv shell
  1. Run the Flask app locally (dev):
FLASK_DEBUG=true FLASK_APP=service_wsgi.py flask run

The web app can be loaded in a web browser at:

If you're testing the Github user auth functionality, you can also run the Flask app with custom configs, like:

GITHUB_APP_ID=sample_app_id GITHUB_APP_SECRET=sample_app_secret FLASK_DEBUG=true FLASK_APP=service_wsgi.py flask run
  1. Production deploy

Uses serverless system and assumes access to organization secrets and AWS account access (for project admins only).

Create a file config.prod.yaml (reference config.sample.yaml), with contents like:

GITHUB_APP_ID: "sample_app_id"
GITHUB_APP_SECRET: "sample_app_secret"
SECRET_KEY: "sample_secret_key"
STRIP_STAGE_PATH: "true"

NOTE: Swap out "sample" values above with "secret" values.

Then run the app:

serverless deploy --stage="prod"

View logs:

serverless logs --stage="prod" --function="app" --tail

License