This is a simple starter template for NestJS projects. It includes only basic configs, TypeORM, MySQL and PNPM.
Copy .env.example
file and rename as .env
. Then you can specify your configs.
pnpm install
# development
pnpm run start
# watch mode
pnpm run start:dev
# production mode
pnpm run start:prod
# unit tests
pnpm run test
# e2e tests
pnpm run test:e2e
# test coverage
pnpm run test:cov
Create a module
nest g mo app/modules/<module-name>
Create a controller
nest g co app/modules/<module-name>/<controller-name>
Create a service
nest g s app/modules/<module-name>/<service-name>
Create a pipe
nest g pi app/modules/<module-name>/<pipe-name>
Create a model
nest g cl app/shared/<model-name>
# create migration
npm run typeorm:direct migration:create src/database/migrations/Create<table-name>Table
# run migrations
npm run typeorm migration:run
# revert migrations
npm run typeorm migration:revert
# show status of migrations
npm run typeorm migration:show
# drop all migrations
npm run typeorm schema:drop