Skip to content

Nest & Prisma backend for the new Konzisite, an app for students to organize and sign up for consultations.

Notifications You must be signed in to change notification settings

kir-dev/konzisite-api

Folders and files

NameName
Last commit message
Last commit date
Nov 18, 2023
Dec 8, 2023
Feb 26, 2023
Aug 20, 2022
May 10, 2024
Aug 15, 2024
Sep 8, 2023
Jan 15, 2023
Sep 8, 2023
Sep 26, 2022
Apr 28, 2022
Sep 8, 2023
Apr 28, 2022
Aug 2, 2023
Nov 18, 2023
Apr 8, 2023
Feb 13, 2024
Aug 20, 2022
Apr 4, 2023
Aug 15, 2024
Aug 15, 2024
Aug 2, 2023
Aug 14, 2024
Sep 26, 2022
Apr 20, 2022

Repository files navigation

Konzisite header

Description

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 TypeScript, NestJS NestJS and Prisma Prisma. See the frontend repository here. The application was developed by Kir-Dev Kir-Dev. For more information about the project, see our project page or our blogpost, both in Hungarian.

Preperation

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.

Installation

# Install the dependencies
npm install
# Then apply the migrations
npx prisma migrate dev
# Optionally seed the databse with mock data
npm run seed

Running the app

# 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

Setting up a Postman collection

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 likely http://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 the JWT_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.

Docker deployment

Edit the .env file accordingly, set the exposed port to your liking.

docker-compose up --build [-d]