Skip to main content

NestJS

NestJS is a progressive Node.js framework for building efficient, reliable and scalable server-side applications. It combines elements of Object-Oriented Programming (OOP), Functional Programming (FP) and Functional Reactive Programming (FRP). NestJS embraces TypeScript and uses Express.js under the hood, but also works with other libraries, providing flexibility for developers.

Nest versions

The template now support the following versions of Nest: >=9.4

May works with other versions, but not tested.

Nest installation

To use this template, you need to install Nest first. You can do it by following the official documentation

With NestJS CLI

dcmd toolbox start # in the parent of your project folder
npm install -g @nestjs/cli
nest new my_nest_project

With Git

dcmd toolbox start # at root of your project folder
git clone https://github.com/nestjs/typescript-starter.git .

Get the template

At root of your project (where the package.json folder is located), run the following command:

dcmd template get nestjs

Configure the template

  • Create and configure the environnement file by copying the .env.example file to .env
  • Set the name of your project in the docker-compose.yml file
  • Set the right name for your virtual host in .docker/etc/apache/httpd-vhosts.conf

More information here : project configuration

Initialize the project

At root of your project (where the package.json folder is located), run the following command:

dcmd up

Setup the environment

Setup your env files, and your settings for the right database credentials and other settings.

Default database credentials

Informationdefault value
hostdb
port3306
namedefault
usernameuser
passworduser

Start the project

At root of your project (where the package.json folder is located), run the following command:

dcmd nest
Website URL

You're good to go! You can now access your project at : http://${PROJECT_NAME}.dev.local Or : http://localhost:3800