Table of Contents
This repo is the backeend part of an exam project at KEA, developed for CPH-Værkstedet.
It is a REST api developed with next, capable of handling authentication and crud operations through prisma to a PostgresQL database.
The technologies used to built this prototype are
Necessary packages include
To get a local copy of the project up and running, follow the steps below
This project requires Node.js to run
If you do not have Node.js installed, install it from their website.
This project uses Docker to run and connection to the database
If you do not have a way to run docker in your OS, we recommend installing Docker Desktop.
This project uses Yarn as a package manage. To run the project smoothly, we recommend using yarn instead of npm.
If you do not have yarn installed, we recommend installing yarn through NPM
If you do not have npm installed, we recommend following this guide.
- Install yarn globally through npm
npm install -g yarn
- Check the version of yarn after installation
yarn --version
-
Clone the repository through the terminal
git clone https://github.com/LasseStaus/CPHworkshop_backend.git
Alternatively you can download the zip file, and open it in your IDE.
-
Install packages used in the project
yarn install
-
Copy the contents of
.env.example
into a.env
file and either specify details or use the default settingsIf you wish to specify your own details, remember to update the database connection string in schema.prisma, located in the Prisma root folder.
-
Restart / Start the database, run migrations and seeds.
yarn db:dev:restart
-
View the database locally
yarn prisma studio
-
Run the application in production
yarn run build
yarn start:prod
-
Alternatively, run the application in development mode
yarn start:dev
-
Run run e2e tests locally
yarn test:e2e
To create and connect with an instance of our frontend, please go to the frontend repository and follow the steps in the Readme