Skip to main content

NestJs

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications on top of TypeScript & JavaScript (ES6, ES7, ES8)

NestJs is a framework built with Node.js, It is used for building efficient, scalable Node.js server-side applications. Nest uses progressive JavaScript and is written with TypeScript. Being built with TypeScript means that Nest comes with strong typing and combines elements of OOP(Object Oriented Programming), FP(Functional Programming) and FRP(Functional Reactive Programming).

Nest also makes use of Express, It provides an out of the box application architecture which allows for the effortless creation of highly testable, scalable, loosely coupled, and easily maintainable applications.

Nest CLI can be used to generate nest.js applications with a lot of features out of the box.

Nest is inspired by Angular

  • Controllers
  • Providers
  • Imports
  • Exports

src

app.controller.tsBasic controller sample with a single route
app.module.tsThe root module of the application
main.tsThe entry file of the application which uses the core functionNestFactoryto create a Nest application instance

https://docs.nestjs.com/first-steps

https://www.merixstudio.com/blog/nestjs-how-and-why-use-it

https://www.freecodecamp.org/news/learn-nestjs-by-building-a-crud-api

Commands

npm i -g @nestjs/cli

nest new project-world

select package manager - npm

cd project-world

npm run start (http://localhost:3000)

npm run start:dev # watch mode