Skip to content

eduardopc/nestjs-api

Repository files navigation

Description

Sample project using NestJS with Prisma

Postgres Container

$ docker run --name mydb -e POSTGRES_USER=root -e POSTGRES_PASSWORD=root -p 5440:5432 -d postgres

Installation

$ npm i -g @nestjs/cli

$ nest new nestjs-api

$ yarn add prisma

$ yarn prisma init

Miscellaneous

  1. Install the Prisma Plugin

  2. Go to VSCode Settings and add the snippet below:

"[prisma]": {
  "editor.defaultFormatter": "Prisma.prisma",
  "editor.formatOnSave": true
}
  1. Create the models and run the command to create all tables:
$ yarn prisma migrate dev
  1. (Optional) Prisma Studio (to see the DB using an IDE):
$ yarn prisma studio
  1. Generate the modules automatically:
$ nest g resource {module-name}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published