In recent years, numerous frontend frameworks have appeared in the JavaScript landscape. The best known are Vue.js, Angular, and React. These frameworks allow developers to create performant frontend web applications.
Since the arrival of Node.js, JavaScript is also used on the backend. However, the frameworks that have emerged around JavaScript and Node.js often do not enforce a very clear architecture, unlike what has been seen on the frontend. Nest, largely inspired by Angular, aims to fill this gap by allowing the creation of high-quality and highly scalable backend applications.
This article is not intended to teach you how to use Nest. For this, Nest's creator Kamil Mysliwiec has provided extensive documentation that will allow you to learn its every secret (
https://nestjs.com). What we will try to see together is why it is interesting for a web agency or even a freelance developer to use this framework.
Modular architecture
Nest is very strongly inspired by the Angular framework. A Nest application is thus, like Angular, divisible into modules. Each module independently manages all actions specific to a business part. In the case of REST APIs, a module allows defining an endpoint. For this, it consists of services and controllers. Controllers define the routing of endpoints, and services retrieve the data.
If we take the example from the Nest documentation, below we have a controller that defines the endpoint cats and which manages all routes corresponding to cats. Here the GET /api/cats route allows us to retrieve all cats.

Nest Controller for the cats endpoint
Once called, the route can, via the cats service, fetch the data corresponding to the endpoint.

Nest Service for the cats endpoint
This module isolation thus allows easier code reuse from one project to another, which can save you valuable time for business functions common to multiple projects.
Furthermore, to avoid reinventing the wheel with each project, Nest provides components that can boost your productivity. These components allow you to focus on the true value-added features for your clients.
For example, we find:
The pipes which allow you to transform or validate input data in the endpoint. This allows for easy validation of your arguments and queries.
The interceptors allow modifying incoming or outgoing requests from a controller to, for example, transform a returned exception.
The guards which are called at the application's entry and determine if the request is valid. If it isn't, the guard returns a 403 (Forbidden) error. This can be used, for example, to build your application's authentication system.
Again, if you want more details on how these components work and all the possibilities they offer, the framework's documentation is very well done:
https://nestjs.comApplications that last over time
As seen above in a simplified way, Nest has a modular architecture where each component has a specific role.

Nest Architecture for the cats project
This architecture might seem quite heavy, and unsuitable for a small project. The advantage is that the architecture can remain the same as the project evolves, allowing you to build on sound and sustainable foundations.
Furthermore, one of the main advantages of adopting Nest is that all Nest projects have largely the same architecture. This allows you to become operational more quickly on other Nest projects, or even to more easily pick up your own code several months after writing it.
Flexibility to adapt to all projects
Nest has a very rich environment. It is possible to use a multitude of different tools such as an ORM (typeORM), Websockets (socket.io), GraphQL (Apollo), or even implement microservices. This will allow you to meet all your client needs.
Finally, although Nest was primarily designed to be used with TypeScript (a superset of JavaScript that notably adds optional typing), it is also possible to use Nest by coding in plain JavaScript.
Conclusion
To conclude, if today Nest has almost 25,000 stars on Github, it's no coincidence! Thanks to its modular architecture, and the set of components and tools it offers, Nest allows for the creation of high-quality, scalable applications in minimal time.