gainy-app / gainy

MIT License
0 stars 0 forks source link

Gainy Backend

This repo contains all backend services for Gainy application and infrastructure.

Local environment

Prerequisites:

Running

make configure up

After the project is running:

Development

Useful commands:

Key parts of the app

  1. Data pipelines

    We use Meltano ELT framework to pull data from our data providers and transform it in a way the mobile app can cosume it. The whole pipeline consists of 3 steps:

    1. Extractor

      We have custom written taps for the extract stage:

    2. Loader

      We use standard target-postgres to load data into our Postgres instance as is. Basically it ends up in database as one giant json blob

    3. Transformer

    At the end we use dbt transformer to normalize loaded data into models.

  2. GraphQL API

    Our API is built using Hasura GraphQL server. It connects to our Postgres instance and generates GraphQL API on top of it.

  3. Lambda functions

    All the business logics we have is written in the form of lambda functions. They are triggered directly by Hasura, either via specific requests (actions), or when some data changes (triggers).

  4. Websockets

    All the realtime data we collect is done in this module.

  5. Terraform

    All our infrastructure is managed by terraform.

    We have two environments: production and test:

    • production environment deployment is triggered upon a push to the main repository.
    • test environment deployment is triggered manually here.

Key integrations

Portfolio

Flow:

  1. Plaid auth flow: app requests link token, exchanges it via a client library for a public token, sends it to backend and backend exchanges it for an eternal access token.
  2. When the access token is saved, a trigger on_plaid_access_token_created is executed and pulls data from plaid.
  3. dbt then calculates chart and gains here

Tests

Execute this command to run tests:

make test

Coverage: