Nest JS Tasks management API
A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.
Tasks CRUD API implemented in NestJS, with custom route guarding and authentication.
$ yarn
# development
$ yarn start | nest start
# watch mode
$ yarn start:dev
# production mode
$ yarn start:prod
yarn typeorm migration:run
yarn typeorm migration:revert
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
- Twitter - @UmarCloud
Nest is MIT licensed.
nest g module name
- generate a controller without tests spec
nest g controller name —no-spec
- generate a service without tests spec
nest g service name —no-spec
- (Data transfer Object)
dto/module.dto.ts
module.controller.ts
module.entity.ts
module.module.ts
module.repository.ts
module.service.ts
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, ManyToOne } from "typeorm";
@Entity()
export class Module extends BaseEntity {
}
import { Repository, EntityRepository } from "typeorm";
import { Logger, InternalServerErrorException } from "@nestjs/common";
@EntityRepository(T)
export class ModuleRepository extends Repository<T>{
}
- Create Postgres Database (pgadmin and postgres)
yarn add @nestjs/typeorm typeorm p
npx compodoc -p tsconfig.json -s
@UseGuards(RolesGuard)
@CanAccess(UserTypes.Admin)
yarn add @nestjs/jwt @nestjs/passport @nestjs/swagger @nestjs/typeorm typeorm passport passport-jwt pg bcrypt class-transformer class-validator config swagger-ui-express
yarn add -D @compodoc/compodoc @types/bcrypt @types/config