Create a notion integration.
Create a google cloud oauth2 client credentials with redirect to http://localhost:8080. Download the credentials, move the JSON file to the repo, and rename it credentials.json.
Create the following databases and share them with the integration:
- Bodyweight:
sql_id(number),Date(date),Value(number) - Exercises:
sql_id(number),Name(title) - Strength:
sql_id(number),Exercise(relation toExercises),Date(date),Weight(number),Reps(number) - Cardio:
sql_id(number),Exercise(relation toExercises),Date(date),Duration(number),Distance(number)
Create a .env file:
SLS_ORG=
NOTION_API_KEY=secret...
NOTION_BODYWEIGHT_DATABASE_ID=
NOTION_EXERCISE_DATABASE_ID=
NOTION_STRENGTH_DATABASE_ID=
NOTION_CARDIO_DATABASE_ID=
Install requirements with python 3.13:
python -m venv .venv
. venv/bin/activate
pip install -r requirements.txtInstall serverless deps:
npm iRun python db_sync.py for the first time locally in order to complete the browser oauth2 flow allowing access to google drive. After this you can deploy.
Deploy with serverless:
sls deploy