Giter Club home page Giter Club logo

trello-budget's Introduction

Trello Budget

Quickly insert transactions in your budget spreadsheet by creating a Trello card.

Walkthrough

Check out the YouTube playlist for a complete walkthrough on building this project.

Installation & Configuration

Generate Auth Token for Spreadsheets

  1. Create a new Firebase project called budget.
  2. pip3 install --upgrade google-api-python-client oauth2client
  3. Follow quickstart guide step 1 to enable the Google Sheets API and download credentials for your Firebase budget project .
  4. Copy the credentials.json file in project directory and run the following to generate token.json:
    python3 createtoken.py

Set Up the Firebase CLI

  1. Install Node.js & npm
  2. npm install firebase-functions@latest firebase-admin@latest --save
  3. sudo npm install -g firebase-tools

Initialize Firebase SDK for Cloud Functions

  1. Run firebase login to authenticate the firebase tool.
  2. Make sure that your Firebase project name & ID are correctly configured in .firebaserc:
    {
        "projects": {
            "budget": "<project-ID>"
        }
    }
  • Run npm install from the functions directory.

Create a Trello Webhook

Set the following fields in webhook.sh & run it to create a Trello webhook:

  • APIToken
  • APIKey
  • CallbackURL
  • ModelID
./webhook.sh

Configure

  • Create a new collection called config in your Cloud Firestore and create a document called auth in it.
  • 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 inside functions directory and set the same username & password in it as well:
    {
        "admin": {
            "username": "utku",
            "password": "ilikebananas"
        }
    }
  • Finally make sure to set LOCAL_PORT correctly in post.py while serving functions locally.

Serve Locally or Deploy to Cloud

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

Invoke Functions

Local Endpoint

# set spreadsheet ID by URL
python3 post.py local setSheet <SPREADSHEET_URL>

# set auth token
python3 post.py local setToken token.json

# make a transaction request
python3 post.py local transaction trello.json

Remote Endpoint

# set spreadsheet ID by URL
python3 post.py remote setSheet <SPREADSHEET_URL>

# set auth token
python3 post.py remote setToken token.json

# make a transaction request
python3 post.py remote transaction trello.json

References

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.