Quickly insert transactions in your budget spreadsheet by creating a Trello card.
Check out the YouTube playlist for a complete walkthrough on building this project.
- Create a new Firebase project called
budget. pip3 install --upgrade google-api-python-client oauth2client- Follow quickstart guide step 1 to enable the Google Sheets API and download credentials for your Firebase budget project.
- Copy the
credentials.jsonfile in project directory and run the following to generatetoken.json:python3 createtoken.py
- Install Node.js & npm
npm install firebase-functions@latest firebase-admin@latest --savesudo npm install -g firebase-tools
- Run
firebase loginto authenticate the firebase tool. - Make sure that your Firebase project name & ID are correctly configured in
.firebaserc:{ "projects": { "budget": "<project-ID>" } }
- Run
npm installfrom thefunctionsdirectory.
- Create a new board and 12 lists inside it for each month (Jan, Feb, Mar, ...)
- Set the following fields in
webhook.sh& run it to create a Trello webhook for your budget board:APITokenAPIKeyCallbackURLModelID
./webhook.sh
- Create 12 monthly budget spreadsheets to keep track of each month and take note of corresponding spreadsheet IDs.
- Create a new collection called
configin your Cloud Firestore and create a document calledspreadsheetin it. - Add 12 fields inside the
spreadsheetdocument for each spreadsheet ID as follows:
- Set your username, password & trello secret in your environment configuration:
# set admin username & password firebase functions:config:set admin.username="utku" admin.password="ilikebananas" # set trello secret firebase functions:config:set trello.secret="<YOUR_TRELLO_SECRET>"
- Also create an
.runtimeconfig.jsonfile insidefunctionsdirectory and set the same username & password in it as well:{ "admin": { "username": "utku", "password": "ilikebananas" } } - Finally make sure to set
LOCAL_PORTcorrectly inpost.pywhile serving functions locally.
Serve functions locally without deploying functions to cloud:
# default port is 5000
sudo firebase serve --only functions --port=5123Deploy functions to cloud:
firebase deploy --only functions# set auth token
python3 post.py local setToken token.json
# make a transaction request
python3 post.py local transaction trello.json# set auth token
python3 post.py remote setToken token.json
# make a transaction request
python3 post.py remote transaction trello.json