Skip to content

assertnotnull/nestjs-prisma

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ pnpm install

Setup

This repo comes with Prisma as the ORM layer and a database in Docker compose.

Create a .env file at the root of the project with:

DATABASE_URL=postgresql://postgres:postgres@localhost:5432/sample_dev?schema=public
# start database
$ docker-compose up -d

# generate prisma types from the schema.prisma
$ pnpm run prisma generate

# apply the changes from the schema.prisma to the database (dev)
$ pnpm run prisma db push

# seed some users from the prisma/seed.ts file
$ pnpm run prisma db seed

Running the app

# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod

Now you can visit http://localhost:3000/users

Test

# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm run test:cov

Migration

# the following will create a migration file for changes in the schema.prisma
$ pnpm run prisma migrate dev

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

About

Example of Nestjs + Prisma + Purify-ts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published