Backend for InstruGo, an application for connecting students and tutors.
This repository contains just the backend of InstruGo. To run the frontend go see README.md in the frontend repository.
You will need Node.js >= 16, yarn and Docker with docker compose installed on your machine.
$ yarnBefore running the actual application, you will need to run a PostgreSQL instance. The easiest way to do it is to use docker compose like this while in the app root dir:
$ docker compose up -dRunning the app for the first time will also seed the database with initial data. You can find this data in src/seed module. Subsequent runs will not run the seeding service unless you delete all subjects and users from db (not recommended, if you want to reset the db look at the last section "Starting from scratch").
# development mode
$ yarn start
# development watch mode
$ yarn start:dev
# production mode
$ yarn build
$ yarn start:prodIf you don't want to seed the db for some reason, you can set the SEED_DB environment variable in .env to 0 manually before running the app.
If you contaminated the db or just want to start from scratch with initial seeded data, do it like this:
$ docker container stop instrugo-database
$ docker container rm instrugo-database
$ docker compose up -d
$ yarn start