/template-nestjs

Template Nestjs API Rest

Primary LanguageTypeScript

Nest Logo

Description

Template Nestjs.

Environments

# Environment template
.env.template

Installation

Use the package manager yarn to install dependencies.

yarn install

Running the app

# development
yarn run start

# watch mode
yarn run start:dev

# production mode
yarn run start:prod

# Production build
yarn build

# Start PostgreSQL and pgAdmin
docker-compose up -d

# Stop PostgresSQL and pgAdmin
docker-compose down -d

Test

# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov

Project structure

template-cms-nestjs/
|- .husky/
|  |─ pre-commit
|  └─ pre-push
|- src/
|  |- config/
|  |  |- env.config
|  |  └- joi.validation.ts
|  |- common/
|  |  |- exceptions/
|  |  |- filters/
|  |  |- guards/
|  |  |- interceptors/
|  |  |- helpers/
|  |  └─ validators/
|  |- modules/
|  |  └─ users/
|  |     |- dtos/
|  |     |- entities/
|  |     |- users.controller.spec.ts
|  |     |- users.controller.ts
|  |     |- users.module.ts
|  |     |- users.service.spec.ts
|  |     └─ users.service.ts
|  |─ app.module.ts
|  └─ main.ts
|- test/
|  |- modules
|  |  └- users.e2e-spec.ts
|  |─ app.e2e-spec.ts
|  └─ jest-e2e.json
|- .env
|- .env.template
|- .eslintrc.js
|- .gitignore
|- .lintstagedrc
|- .prettierrc
|- docker-compose.yml
|- nest-cli.json
|- package.json
|- README.md
|- tsconfig.build.json
|- tsconfig.json
└─ yarn.lock

Stay in touch

  • Author - Diego Buezo