A sample NestJs app built using NodeJs/TypeScript, the Nest framework, a Sequelize ORM Integration package called @nestjs/sequelize
, and MySQL RDBMS. Includes Jest unit tests with sequelize-mock
and e2e integration tests via SuperTest.
- Uses the
openapi-express-validator
and@nestjs/swagger
modules to validate request/response DTOs rather than theclass-validator
which only handles validation on requests - The swagger document is available in both JSON and YAML, and the YAML document is written to the repo for source control/maintenance.
- Uses the
@nestjs/swagger
plugin to avoid having to add@ApiProperty()
in every DTO - Uses
Sequelize
ORM and the@nestjs/sequelize
TypeScript wrapper to utilize aDatabaseModule
and custom components for aMySQL
database. - Uses
sequelize-mock
for Jest mock unit testing - Uses node config
npm i config
to configure the application settings
When the app is running, you can view the swagger documentation:
- Install NodeJs and NestJs Framework
- Install MySQL
- Obtain the default configuration settings file
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Nest is MIT licensed.