For the app to run successfully, you will need the correct environment variables in a .env file at the root of the project. The .env.template shows you which environment variables you will need.
By default, the app is run with OAuth which protects every endpoint. To disable this, set LOGIN_DISABLED=TRUE in your .env file.
The app must be linked to a Github OAuth app, this is done through the CLIENT_ID and CLIENT_SECRET env variables.
After logging in through Github, the app grants you different permissions based off of whether your Github username is associate with a "Writer" role (i.e. you have write privileges), or the default "Reader" role. Currently these roles are assigned to Github usernames through a hardcoded list in user.py.
Https is not used locally, set OAUTHLIB_INSECURE_TRANSPORT=1 in your .env.
To create create either a development or production image use below commands:
docker build --target development --tag todo-app:dev .
docker build --target production --tag todo-app:prod .
Docker run commands:
docker run --env-file ./.env -p8000:8000 --mount type=bind,source="$(pwd)"todo_app,target=/app/todo_app todo-app:prod
docker run --env-file ./.env -p5000:5000 --mount type=bind,source="$(pwd)"todo_app,target=/app/todo_app todo-app:dev
To run the tests in a Docker container, run docker build --target test --tag test .
to build the container and
docker run test tests/test_viewmodel.py
to run unit testdocker run test tests/test_integration.py
to run integration testdocker run --env-file .env test tests/test_e2e.py
to run end-to-end test
You should see output similar to the following:
* Serving Flask app "app" (lazy loading)
* Environment: development
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with fsevents reloader
* Debugger is active!
* Debugger PIN: 226-556-590
Now visit http://localhost:5000/
in your web browser to view the app.
The application is hosted on Azure, post request to Azure webhook pulls the latest container image from docker