Konzisite is a web application for the students of Budapest University of Technology and Economic Faculty of Electrical Engineering and Informatics to organise consultations, study sessions where students help each other. This repository contains the backend REST API for that application, built with TypeScript, NestJS and Prisma. See the frontend repository here. The application was developed by Kir-Dev. For more information about the project, see our project page or our blogpost, both in Hungarian.
First, start a PostgreSQL server locally on your machine.
Then create an OAuth client at AuthSCH with the following redirect address: http://localhost:3300/auth/callback
Finally, copy the contents of .env.example
to a new file named .env
. Replace the database credentials with the credentials required to connect to your local database and the AuthSCH credentials with ID and secret that AuthSCH generated for your client.
# Install the dependencies
npm install
# Then apply the migrations
npx prisma migrate dev
# Optionally seed the databse with mock data
npm run seed
# development
npm run start
# watch mode
npm run dev
# production mode
npm run start:prod
# running prisma studio, easy way to explore and manipulate the db
npx prisma studio
If you want to use Postman for testing the endpoints, you can import postman_collection.json
from the root of the project into Postman. This will create a collection with some of the endpoints of the app already defined. To use it, create two new variables in the Environments -> Globals tab:
baseUrl
: the value should be the URL where the backend is running, so most likelyhttp://localhost:3300
token
: the value should be your JWT token. You can get this by running both the backend and frontend apps. After logging in, you can copy the token from theJWT_TOKEN
cookie.
If you add new endpoints to the collection that you think the others could use, please overwrite the postman_collection.json
file with the export of the modified collection, and commit it.
Edit the .env file accordingly, set the exposed port to your liking.
docker-compose up --build [-d]