Skip to content

Getting started

António Faneca edited this page Feb 13, 2025 · 14 revisions

You can get started using MyFin in one of 2 ways:

  • Through Docker or Docker Compose
  • Manually installing the api and frontend in your web server/machine

Docker

We provide the following docker images:

We also maintain a docker-compose config you can use to bootstrap the whole platform (api + web) by simply running:

docker compose up

Manual installation

Initial Setup

  1. Upload this project into your server (using git clone is the recommended path)
git clone https://github.com/afaneca/myfin-api
  1. Create .env file in the root directory with the following structure (you can use .env.example as a starting point):
# DB
DB_NAME=XYZ # a new DB will be created with this name if it doesn't exist already
DB_USER=XYZ
DB_PW=XYZ
DB_HOST=localhost
DB_PORT=1234
DATABASE_URL="mysql://${DB_USER}:${DB_PW}@${DB_HOST}:${DB_PORT}/${DB_NAME}?schema=public"

# EMAIL (Optional, used for the password recovery flow)
SMTP_HOST="XYZ"
SMTP_PORT=465
SMTP_SECURE=true
SMTP_USER="XYZ"
SMTP_PASSWORD="XYZ"
SMTP_FROM="[email protected]"

# CUSTOM OPTIONS
LOGGING="false" # THINK TWICE ABOUT ENABLING IN PROD
BYPASS_SESSION_CHECK="false" # DO NOT ENABLE IN PROD
ENABLE_USER_SIGNUP=true
PORT=3001 # optional; defines the port where the app will be running (defaults to `3001`)
  1. Install the required dependencies:
npm ci
  1. Generate the DB schema:
npm run db:deploy
  1. Run the NodeJS project:
npm run start

You can also run the project through tools like pm2, using /dist/server.js (after compiling the code) as the entry point for the app.

Now, you're ready to setup and connect your api instance to the frontend of your choosing (you can find the android app here and the web app here)!

Updating

  1. Replace the old version of the project files withe the updates ones:
git pull
  1. Update the dependencies
npm ci
  1. Update the DB schema:
npm run db:deploy
  1. Restart/reload the app

Troubleshooting

Migrating from 4.8.0 and earlier

If you're migrating from a pre-5.0.0 version of the platform, you can keep all your data, by reusing the same DB schema. All you got to do is replace the command in step 5) with this two:

npx prisma db push --accept-data-loss
npx prisma migrate resolve --applied 0_init
Clone this wiki locally