Enhancements to native behavior in todoist to improve motivation, focus, and flow.
Visit SwT homepage to enable this integration and read about the features that it enables.
- Install PostgreSQL locally
sudo apt update
sudo apt install postgresql postgresql-contrib
- Create a database using
sudo -u postgres createdb swt
- Install virtualenv and Heroku CLI
- Create a new Todoist account for testing purposes
- Create a new app in the Todoist app console:
- Create a new app called Streaks with Todoist LOCAL
- Add an OAuth redirect URL: https://ef164ac5.ngrok.io/auth/oauth_callback
- Click Save Settings
- Scroll down to the Webhooks section: Select Webhooks version 7
- Set Webhook callback URL to https://ef164ac5.ngrok.io/webhooks/webhook_callback
- Check the fields for item:added, item:complete, item:updated, reminder:fired
- Click Save webhook configurations
- Clone the repo:
git clone https://github.com/briankaemingk/streaks-with-todoist.git
- Create the virtualenv
$ virtualenv -p python3 venv $ source .venv/bin/activate
- Install the requirement packages:
$ pip3 install -r requirements.txt
- Initiate the database:
$ flask db init $ flask db migrate $ flask db upgrade
- Create an empty file called
.env
and copy and paste the example from the file.env-example
, changing the CLIENT_ID and CLIENT_SECRET:- Log into the Todoist app console to add the client id and client secret:
CLIENT_ID=...jfdk34s... CLIENT_SECRET=...343j...
- Start a tunnel using ngrok:
ngrok http 5000
- Start the redis server with:
rq worker swt-tasks
(don't forget to start ssh withsudo service ssh start
, postgresql withsudo service postgresql start
, and redis withsudo service redis-server start
) - Run the app locally using
flask run
- Create a heroku app for your staging app:
$ heroku create staging-appname
- Create a new todoist account for your staging app and copy the client id and client secret from the Todoist app console (like in local installation step #5) and set them as variables in your staging app:
$ heroku config:set CLIENT_ID=...jfdk34s... $ heroku config:set CLIENT_SECRET=...343j...
- In addition, set the APP_SETTINGS variable:
heroku config:set APP_SETTINGS=config.StagingConfig
- Add the database add-on in heroku:
heroku addons:add heroku-postgresql:hobby-dev
- Push the app:
git push heroku master
- Log into the Log into the Todoist app console:
- Change the OAuth redirect URL to your heroku app url: https://heroku_app_name.herokuapp.com/auth/oauth_callback
- Click Save Settings
- Scroll down to the Webhooks section and set the Webhook callback URL to your heroku app url: https://heroku_app_name.herokuapp.com/webhooks/webhook_callback
- Click Save webhook configurations
If you make any updates to the database, you need to upgrade the database in your local and staging environments like this:
- Local:
$ flask db upgrade
- Staging:
$ heroku run flask db upgrade
- Running a command:
heroku pg:psql -c "command"
You can access the database locally with the following commands:
- Running a command:
$ sudo -u postgres psql
$ \c swt
This project is licensed under the MIT License - see the LICENSE file for details