DXHeroes / account-balance-to-google-spreadsheet

Download account balance and transaction history from a bank account and save to Google Spreadsheet.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Account Balance to Google Spreadsheet

Modular app to fetch transaction history and account balance from the bank API and write to Google Spreadsheet.

Written in Nest framework using TypeScript.

Currently supported banks:

Installation

$ npm install

Configuration

  • Create file .env.development in the root of repository

1. Google

  • Go to https://console.developers.google.com

  • Create new project called e.g. AccBalanceApp

  • Go to "Library" and add:

    • Google Drive API
    • Google Sheets API
  • Go to "Credentials"

    • Click to create new "Service account key"
    • In the dropdown Service account choose "New service account" and set the Name and Role ("Project > Viewer"). Key type has to be JSON.
    • Click to "Create" and download the JSON file
  • Encode the content of the file with Base64 and save it to the .env.development as GOOGLE_AUTH key

    GOOGLE_AUTH="YmFzZTY0IGVuY29kZWQgSlNPTiBmaWxlIGFzIGEgc3RyaW5nIGhlcmU="
  • Go to https://drive.google.com and create new empty Spreadsheet

  • Share the spreadsheet to the email in the Google Credentials JSON file (as client_email) with edit permissions.

  • Copy the ID of the Spreadsheet from the URL e.g.

    https://docs.google.com/spreadsheets/d/5BxICDTRQpIsPK_tcJJm4Ni9gjtPsDHErXE_m-dDQM4c/edit
    
    # id == "5BxICDTRQpIsPK_tcJJm4Ni9gjtPsDHErXE_m-dDQM4c" (YOUR ID DIFFERS!)
    
  • Save the ID to the .env.development file as GOOGLE_SHEET_ID key

    GOOGLE_SHEET_ID=5BxICDTRQpIsPK_tcJJm4Ni9gjtPsDHErXE_m-dDQM4c

2. Banks

3. App

🎉🎉🎉 That's all! Congrats! 🎉🎉🎉

Now run the app with yarn start:dev or npm start:dev and the CRON should run after 10 seconds.

Contribution

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Lincense

WTFPL-2.0

About

Download account balance and transaction history from a bank account and save to Google Spreadsheet.


Languages

Language:TypeScript 100.0%