Back to the homepage
NestJS

NestJS – Angular style backend framework

Angular

I assume most of the people who come across this article know Angular. You probably even like it and use it. What do we like Angular for?

We like it for the fact that we get many high-quality out-of-the-box solutions. We get dependency injection, testing tools, CLI, and many more.

Besides, Angular combines the best practices. It integrates them to solve programming challenges. It is built on several well-known design patterns that, when well applied to our applications, simplify the process of creating scalable and extensive systems. But most importantly, Angular gives the appropriate abstraction. Appropriate abstraction helps us organize our code and divide functionalities into logical units.

A very large part of these abstractions doesn’t only belong to the creation of the frontend part. It is also suitable for creating backend applications.

NestJS

Nest, like Angular, is a platform. Unlike Angular, it is focused on creating server applications. Nest is strongly inspired by Angular. Thanks to this, knowing and using both technologies, we can reap many benefits.

First, we can reuse our knowledge. Nest is based on almost the same set of rules as Angular, so you don’t have to learn everything from scratch. Modularity, dependency injection, segregation of responsibilities, decorators, TypeScript as a language. All of this can be also found in Nest.

Second – the reusability of experience. Nest has virtually identical APIs in many places. It doesn’t require learning a new API, new keywords, new syntax, or a new language.

Finally – apart from the developer’s experience, the reusability of the code is a very important point. We can reuse DTOs, interfaces, and even services, including base form f e.g. interceptors and guards.

The symbiosis between Angular and NestJS was also noticed (apart from us) by our colleagues from Nrwl, therefore the Nest + Angular full-stack application is available as one of the basic options when generating a monorepo project using Nx.

And what does the creator of Nest say about it? Let’s check it out!

Kamil Myśliwiec o NestJS

History

The concept sounds appealing, but you’re still not convinced? Wondering if NestJS is also mature enough to be compared to Angular?

So what do we know about NestJS?

Work on Nest began in November 2016. The first official release of NestJS was released in May 2017, a year after the Angular 2 premiere.

We recently had version 8, while the latest version of Angular is version 12.

Kamil Myśliwiec is the creator of NestJS. Kamil has the title of Google Developer Expert and is a co-founder of the Trilon organization.

He is still responsible for the development of the main modules. A multitude of contributors helps him, and people who showed above-average commitment create the “Core Team”.

Nest, like Angular, is divided into many separate libraries. The basic ones are similarly @nestjs/core and @nestjs/common. However, apart from that, the platform supports us on many different fronts, which is why we also receive libraries, among others for graphql, microservices, Swagger, configuration, CQRS, and even to SSR in Angular.

Popularity

Nest was released in 2017. In 2018, he had a 300% increase in the number of stars on Github.

In 2019, it has not yet appeared on the predefined list of stateofjs backend frameworks, but it has outclassed the competition among those entered manually.

 

That is why, in the statistics for 2020, we already have more data, e.g. that 87% of users are satisfied with NestJS.

 

 

 

 

 

 

 

 

 

 

 

Importantly, this is not the peak of interest in this framework, on the contrary it is growing rapidly all the time.

You can see the growing popularity of Nest in an interesting way by watching the materials prepared by statisticsanddata.org

In addition, a large group of companies such as Adidas, Decathlon, and many others admit the use of NestJS in production, which can be followed on the official website with the documentation and in a special issue on Github.

Summary

NestJS is a framework that relies heavily on good architecture and drew many of its concepts from Angular. Therefore, this is probably the fastest way for someone familiar with Angular to start writing their own backend. Nest already has a large group of fans and companies that use it, and yet its popularity is still growing rapidly. I think this is the best proposition that can be offered to Angular developers who want to create their own backend as well.

About the author

Maciej Sikorski

Maciej spends most of his time designing applications in Angular and Node.js, additionally he creates and supports libraries and other tools which he uses in his everyday work. He is heavily involved in the development of the NestJS technology and its community. He also runs a blog in English about NestJS and Angular.

Don’t miss anything! Subscribe to our newsletter. Stay up-to-date with the latest trends, tips, meetups, courses and be a part of a thriving community. The job market appreciates community members.

Leave a Reply

Your email address will not be published. Required fields are marked *