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.json
file 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 --save
sudo npm install -g firebase-tools
- Run
firebase login
to authenticate the firebase tool. - Make sure that your Firebase project name & ID are correctly configured in
.firebaserc:
{ "projects": { "budget": "<project-ID>" } }
- Run
npm install
from thefunctions
directory.
- 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:APIToken
APIKey
CallbackURL
ModelID
./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
config
in your Cloud Firestore and create a document calledspreadsheet
in it. - Add 12 fields inside the
spreadsheet
document 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.json
file insidefunctions
directory and set the same username & password in it as well:{ "admin": { "username": "utku", "password": "ilikebananas" } }
- Finally make sure to set
LOCAL_PORT
correctly inpost.py
while serving functions locally.
Serve functions locally without deploying functions to cloud:
# default port is 5000
sudo firebase serve --only functions --port=5123
Deploy 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