-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
We provide the following docker images:
- myfin-api - docker image for the API, hosted by ghcr.io
- myfin - docker image for the web frontend, hosted by ghcr.io
We also maintain a docker-compose config you can use to bootstrap the whole platform (api + web) by simply running:
docker compose up
- Upload this project into your server (using
git clone
is the recommended path)
git clone https://github.com/afaneca/myfin-api
- 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`)
- Install the required dependencies:
npm ci
- Generate the DB schema:
npm run db:deploy
- 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)!
- Replace the old version of the project files withe the updates ones:
git pull
- Update the dependencies
npm ci
- Update the DB schema:
npm run db:deploy
- Restart/reload the app
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