A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ yarn install
$ npm i -g @nestjs/cli
# development
$ yarn run start
# watch mode
$ yarn run start:dev
# production mode
$ yarn run start:prod
# unit tests
$ yarn run test
# e2e tests
$ yarn run test:e2e
# test coverage
$ yarn run test:cov
# module
$ nest g module [resource-name]
# controller
$ nest g controller [resource-name]
# service
$ nest g service [resource-name]
# OR all at once
$ nest g resource [resource-name]
- Create a Supabase account and a new project.
- Set up Prisma:
$ yarn add prisma -D
$ yarn dlx prisma init
- Initialise your
.env
andschema.prisma
to contain the database and direct URL from Supabase by following the steps here. - Model your data in the Prisma schema file,
schema.prisma
, following the steps here. - Create your first migration using the following statement:
$ yarn dlx prisma migrate dev --name init
dev
will ensure the migration history is saved in theprisma/migrations
folder in the repo.
- When you make changes to your schema, you must generate the Prisma client before migrating:
$ yarn dlx prisma generate
$ yarn dlx prisma migrate dev --name [MIGRATION_NAME]
- Create the database resource:
$ nest g resource database