ArboreumDev / credit-union-frontend

Frontend in Next.js + Typescript + GraphQL
https://frontend-two-sandy.vercel.app
1 stars 0 forks source link

Credit Union as a Service

React + Typescript + Next.js

Frontend that allows borrowers to apply for loans from a pool of lenders, if they can bring one or more supporters willing to derisk the loan by lending at less favorable terms and taking the first loss in case of partial defaults Product Demo

output

Check out branch /algorandCore for our algorand-integration:

(DEPRECATED:)

Features

Architecture

overview

full diagram here diagram

Development

  1. Rename example.env.local to .env.local and fill in the necessary env vars. At least one authentication provider is needed.
  2. For local dev, edit hosts file
  3. yarn dev to start server

debugging

Modify package.json to debug: "dev": "NODE_OPTIONS='--inspect' next", Can't change source after debug has started.

Debugging test example:

node --inspect node_modules/.bin/jest "--testPathIgnorePatterns=[]" --watch --runInBand tests/src/scenarios/simple.integration.test.ts

With custom swarmai

docker-compose stop swarmai

and run the usual make dev-api

Add graphql queries

Testing

To use the swarmai docker, you will first need to login to github package repository as described here.

cat ~/TOKEN.txt | docker login https://docker.pkg.github.com -u USERNAME --password-stdin

Lint

Linting automatically happen during commits. We use husky and lint-staged to achieve that. Configuration in package.json

To run manually: yarn eslint .

For production

Check if there are any build errors:

yarn build

Migrations

If there are changes to migrations, make sure the down migration file works well.

Seeds

To automatically create seeds from the current db state: hasura seeds create user_seed --from-table user hasura seeds create loan_request_seeds --from-table loan_requests etc.

Deploy

Deployment Readme