Setting up
- Setup python env
- Install python 3.9.X
pip install pipenv
pipenv install --dev
- Run local db
- Install Docker Desktop with WSL2
- Run db
.\scripts\run_db.ps1
- (Optional) Run local db admin
- Run db admin
.\scripts\run_db_admin.ps1
- Open db admin
- Run db admin
- Add secrets
- Copy and rename
.\scripts\env_secrets_example.ps1
toenv_secrets.ps1
- Get values from André and set them in the file
- Copy and rename
- Run
.\scripts\run_web.ps1
- (Verify) Open page
- (Verify) Open api
- (Verify) Run tests
pytest .
- Take note tests may randomly fail, probably because of the local datastore returning stale values in integration tests, or because of a bug in the db context yielding
- (Optional) Setup pre-commit:
cp pre-commit.sh .git/hooks/pre-commit
Import prod data to local db
- Run
.\scripts\populate.ps1
Verifying user
For a user to be able to make changes to the data it needs to be verified
- Have the user log in and select a name
- Go to the database admin, find the User and set activated to true
- Install gcloud cli, and authenticate yourself
- Run
.\scripts\deploy.ps1
Backup
- Cloud Scheduler
- Pushes a message to a Pub/Sub topic
- Which trigger a Cloud Function
Relevant links
- Backend
- Gcloud OAuth Credentials
- Web framework: https://fastapi.tiangolo.com/
- Database framework: https://googleapis.dev/python/python-ndb/latest/index.html
- Datastore admin: https://github.com/remko/dsadmin
- Frontend
- Framework: https://angularjs.org/
- UI components: https://material.angularjs.org/latest/
- Icons: http://google.github.io/material-design-icons/