Skip to content

Getting started

António Faneca edited this page Oct 16, 2023 · 6 revisions

Initial Setup

  1. Upload this project into your server (using git clone is the recommended path)
  2. Create a new mysql table (and corresponding user). Save those credentials for the next step
  3. Create .env file in the root directory with the following structure (you can use .env.example as a starting point):
DB_TABLE="XYZ"
DB_USER="XYZ"
DB_PW="XYZ"
DB_PORT="XYZ"
DATABASE_URL="mysql://${DB_USER}:${DB_PW}@localhost:${DB_PORT}/${DB_TABLE}?schema=public"
LOGGING="false" # THINK TWICE ABOUT ENABLING IN PROD
BYPASS_SESSION_CHECK="false" # DO NOT ENABLE IN PROD
ENABLE_USER_SIGNUP="false"
PORT=3001 # optional; defines the port where the app will be running (defaults to `3001`)
  1. Install the required dependencies:
npm install
  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 install
  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