Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

petterdaae/mynt-backend

Repository files navigation

Not maintained.


mynt-backend

Mynt is a web-application for personal finance. This repository contains the backend code that powers the frontend, mynt-frontend.

Setting up a development environment

Required environment variables

Authentication

  • We currently use google for authentication.
  • To authenticate a client:
    1. Redirect the client to /redirect (in this application)
    2. The client will be redirected to the google conscent page
    3. When the client has authenticated on the conscent page, google will redirect the client to /callback (in this application)
    4. After this, the /callback endpoint will redirect the client to whatever is in the REDIRECT_TO_FRONTEND environment variable.
    5. The endpoint also sets a cookie with a jwt-token that can be used to make authenticated requests to this application. The only thing you have to do in javascript is to set the credentials flag in fetch to include.
  • This flow was configured following these guides:

Database migration

  • We use sql-migrate for managing database updates.
  • To make a new database update, run sql-migrate new replace-with-a-description-of-the-update.
  • The application will make sure that all the migrations are up to date when starting (which means that you don't have to do these updates manually in other environments), but you can run them locally with sql-migrate up.
  • You can test that the down version of your migration works with sql-migrate redo.
  • Always be carefull with database migrations, we generally don't want to do anything else than creating new tables and new fields. But if you have to, consider doing these things manually instead.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published