Prisma Setup
Explore the step-by-step process to set up a Prisma backend with TypeScript and Node.js. Learn to install dependencies, configure PostgreSQL via Docker, define Prisma data models, run migrations, generate the Prisma client, and integrate it with an Express server to build a functional backend application.
We’ll walk through five basic steps in setting up a Prisma back-end server.
Note: Please ensure Git BASH, Yarn, Docker, and Node are installed.
Create an empty npm directory
We can easily create an empty folder or directory from the command line (or Git Bash on Microsoft Windows).
Next, initiate npm using the -y flag.
This should create a package.json file at the root directory.
Initialize git
For this step, we initialize git for our repo with the following command:
Setup a TypeScript Express project
- Install TypeScript dependencies using the following command:
- Create a
tsconfig.jsonfile using the following command:
This will create an empty tsconfig.json file. Add the below code:
Install the Prisma CLI
Working ...