This repo contains all backend services for Gainy application and infrastructure.
Configure AWS credentials.
You need AWS credentials with access to CodeArtifact to build the project. Copy these parameters to .env.local
and fill with appropriate values.
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
make configure up
After the project is running:
Useful commands:
make hasura-console
will run Hasura development console at http://0.0.0.0:9695/. It's needed to persist schema and configuration changes and create migrations.make style-fix
to run style-check and change files in-place.make start-realtime
to run realtime listener.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:
Extractor
We have custom written taps for the extract
stage:
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
Transformer
At the end we use dbt transformer to normalize loaded data into models.
Our API is built using Hasura GraphQL server. It connects to our Postgres instance and generates GraphQL API on top of it.
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).
All the realtime data we collect is done in this module.
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.Flow:
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
.access token
is saved, a trigger on_plaid_access_token_created
is executed and pulls data from plaid.Execute this command to run tests:
make test
Coverage: