Step 3: Setup Backend
Installation For my backend, I’m going to use Prisma. This is my first time ever to use Prisma, so… any feedbacks are welcome. Anyway, let’s move to the first step. 1. Install Prisma npm install pr...

Source: DEV Community
Installation For my backend, I’m going to use Prisma. This is my first time ever to use Prisma, so… any feedbacks are welcome. Anyway, let’s move to the first step. 1. Install Prisma npm install prisma --save-dev npm install @prisma/client npm install @prisma/adapter-pg npm install pg 2. Init Prisma npx prisma init It will create something like this: prisma/ schema.prisma Inside the schema.prisma, it will look something like this: generator client { provider = "prisma-client" output = "../src/generated/prisma" } datasource db { provider = "postgresql" } 3. Setup Database Since I’m using PostgreSQL, in the .env file, I’m going to change it to something like this: DATABASE_URL="postgresql://USER:PASSWORD@localhost:5432/NAMA_DB" For example: DATABASE_URL="postgresql://postgres:123456@localhost:5432/mydb" Don’t forget to run PostgreSQL and create the database. For this project, I’m going to create the database by running: CREATE DATABASE note_taking_app; That line is going to create a data