-
Notifications
You must be signed in to change notification settings - Fork 1
Getting started
António Faneca edited this page Oct 16, 2023
·
6 revisions
- Upload this project into your server (using
git clone
is the recommended path) - Create a new mysql table (and corresponding user). Save those credentials for the next step
- 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`)
- Install the required dependencies:
npm install
- 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 install
- 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