2022 : Why NestJS is the best backend framework

nuke
2 min readSep 24, 2021

There are many solutions to develop backend: laravel, java, .NET, django and even Node.js.

  • PERFORMANCE: As far as server side performance is concerned, NestJS based on Node.js has nothing to envy to other platforms like java or php.
    Apparently, NestJS takes the performance advantage when it comes to handling multiple requests and does less well when there are computationally heavy tasks to do on the server side.
  • OPINIONATED: NestJs imposes a structure, we group the functionalities by module.
    This way, all your NestJS projects and those elsewhere will be written with the same structure and ordered by features.
    It’s a time and money saver!
  • CHOICE: NestJS runs on express and optional Fastify.
    So you can use all the Node.js libraries you want, it’s open source. You want to add passport.js to manage authentication ? no problem.
  • TypeScript: based on TypeScript to take advantage of typing and error detection at compile time and to take advantage of new features in advance (no need to wait for an update of ES6). Believe me, once you will make strong typing to protect your code against errors, you will not be able to do without TypeScript.
  • DECORATORS: offers many decorators to perform all kinds of tasks with very little code, it is a wonder.
  • TESTING: testing is greatly facilitated by dependency injection and testing is very important for a company.

Example :

At a glance, you can see the purpose of this piece of code.

Example NestJS VS Express :

Conclusion :

With clean code and as little code as possible on the screen, a clear structure, organization by module (features) and easy testing.

NestJS is the backend framework that will save your company time and money.

documentation

a very good tutorial :

API with NestJS #1. Controllers, routing and the module structure (wanago.io)

--

--