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:
- Česká Spořitelna a.s. (https://csas.cz)
$ npm install
- Create file
.env.development
in the root of repository
-
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
asGOOGLE_AUTH
keyGOOGLE_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 asGOOGLE_SHEET_ID
keyGOOGLE_SHEET_ID=5BxICDTRQpIsPK_tcJJm4Ni9gjtPsDHErXE_m-dDQM4c
🎉🎉🎉 That's all! Congrats! 🎉🎉🎉
Now run the app with yarn start:dev
or npm start:dev
and the CRON should run after 10 seconds.
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov