A live version of the tool is available at writefield.nextzen.org.
This repository has four core parts:
place/
: Business logic for the Flask-based web editor for Who's On First place gazetteer record properties with a Leaflet-based map viewer for assorted geometries.templates/
: Presentation logic using HTML templates for each web view, for the Flask app.auth/
: User account authentication is via Github to propose a Pull Request with the changes for human review by the Who's On First community.exportify/
: Bundled Python-based tools to validate changes and export as custom formatted Who's On First GeoJSON records that enable quick multi-line property diffs and single-line geometry diffs.git clone git@github.com:iandees/wof-editor.git
And move into that checkout:
cd wof-editor
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
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
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
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