Skip to content

Template for the Node.js applications based on the Nest.js framework for building efficient and scalable server-side applications.

License

Notifications You must be signed in to change notification settings

cyber-eternal/nestjs-template

Repository files navigation

Nest Logo

Template for the Node.js applications based on the Nest.js framework for building efficient and scalable server-side applications.

Status of Last Deployment:

Last Deployment

Description

The template is based on Nest.js(v9) and TypeScript. Also has an implementation for the TypeORM to work with the Database, and RabbitMQ for the messaging(the RabbitMQ implementation can be easily removed if you are not using it). The template dockerized as well

Configurations

The all configurations are in the ./config folder. The existing configs

  • app.ts - Application configs, like port, host, env and so one
  • database.ts - The database and TypeORM configurations
  • amqp.ts - RabbitMQ configuration
  • swagger.ts - Swagger configuration
  • cors.ts - Cors configuration

Dependencies installation

$ yarn

Environment variables configuration

$ cp .env.example .env

Perform migrations in your database using TypeORM

The command will run the all migrations from the ./migrations folder

$ yarn migration:run

Running the app

# development
$ yarn start:dev

# debug
$ yarn start:debug

# production mode
$ yarn start:prod

Test

# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

Run in Docker Container

$ docker-compose up

# OR, to run in background
$ docker-compose up -d

Adminer

to manage the MariaDB will be available on http://localhost:8081/

Swagger UI

http://localhost:3001/api/doc

Stay in touch

License

Nest is MIT licensed.