-
Install the dependencies with
pip install -r requirements.txt
-
Put
config.json
andsecrets.json
in/instance
-
Initialise the database with
python -m flask init-db
-
Run the app with
python -m flask run
Set environment variable
OAUTHLIB_RELAX_TOKEN_SCOPE=1
and runpython -m flask run
If on HTTP, also set
OAUTHLIB_INSECURE_TRANSPORT=1
, optionally setFLASK_ENV=development
for debug mode- In PowerShell:
$env:OAUTHLIB_RELAX_TOKEN_SCOPE=1
- On Linux:
OAUTHLIB_RELAX_TOKEN_SCOPE=1 python -m flask run
- In PowerShell:
-
Set up Microsoft Forms with one only free-text question being the voter ID (for public forms, private forms will use username part of logged in email as voter ID (assuming only one "@" in those email addresses)), other questions can be rankings or choices.
-
In Power Automate (only supported on Work or School account), create a flow that triggers on new form responses, and get the response details, then send a POST request to
/api/ballot-form
with the body ofString(form_body)
, and the headers containingX-API-Key
with the value insecrets.json