qetr1ck-op / transactions

Home Page:https://transactions-mu.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Payment transaction handler

project logo

Description

Handle transaction and save it into google spreadsheet

Tech stack

  • API layer - firebase cloud functions
  • Persistence layer - firestore
  • Presentation layer - google spreadsheets

Prerequisites

  1. Create a service account in Google Cloud Platform

    1.1. Create private keys as JSON (google-account-email and google-private-key)

  2. Config google spreadsheet

    2.1. Remember google-spread-id

    2.2. Share spreadsheet with google-account-email with editing permissions

  3. To work with google spreadsheet API the project uses google-spreadsheet npm package

    3.1. To authenticate service account credentials strategy is used

  4. Firebase is used as infrastructure layer

    4.1 Cloud Functions as API layer and pub-sub layer when database is updated

    4.2. Cloud Firestore as database

Installation

  1. Install the dependencies:
$ npm install
  1. Setup environment configuration

    2.1. The project is depend on the following env variables

Development

  1. Install firebase-tools globally
  2. Export environment configuration:
$ firebase functions:config:get > .runtimeconfig.json
  1. Use firebase emulator:
$ npm start
# will clean dist; build typescript with watch mode; start emulator
  1. Or use firebase shell
$ npm run start:shell
# will clean dist; build typescript with watch mode; start local shell

Deploy

  • Deploy all functions
$ npm run deploy
# will clean dist; lint and build typescript; deploy firebase functions
  • Deploy a specific function
$ npm firebase deploy --only functions:functionName1,functionName2

Test

TODO

About

https://transactions-mu.vercel.app


Languages

Language:TypeScript 91.3%Language:JavaScript 8.7%