NestJS, What the Fuss Is All About

nest.png

To begin with a bit of backstory, I am a backend developer who majorly uses Nodejs with the Express framework.

Recently, a recruiter reached out to me regarding my availability to work on a project. While it sounded fun, there was a clause saying they needed someone with Nestjs experience, I took it on the chin as one of those things I couldn't control yet, and I subsequently forgot about it.

The matter didn't arise again until an old colleague reached out to me about another project. This project also required using NestJS skills. With the framework recurring in my space for the second time, I decided to look at NestJS and see the fuss.

On its official website, NestJS, which was released in 2017, is a framework made with Typescript for building efficient, scalable Node.js server-side applications. It uses progressive javascript, fully supports it, and enables developers to code in pure javascript or typescript. The NestJS framework combines elements of Object-Oriented Programming, Functional Programming (FP), and Functional Reactive Programming (FRP).

It uses robust HTTP server frameworks like its default, Express, and can optionally be configured to use Fastify. The official website also offers a NEST JS FUNDAMENTALS course with over 5 hours of content which should be more than enough to get the average developer up to speed with the intricate details of working with NestJS.

Now is the moment you've been waiting for and probably why you decided to read this article.

What's all the fuss about?

After completing a detailed course, building a task-management app, a medium clone, and a take-home assessment, all with NestJS, I understood why the framework's popularity is rising rapidly.

Firstly, Nest provides an out-of-the-box application architecture that allows developers and teams to create highly testable, scalable, loosely coupled, and easily maintainable applications. It does this with the core components, which include:

Controllers: this is responsible for handling incoming requests and returning responses to the client.

Providers (or services): abstracts complexity and logic, which can then be injected into controllers.

Modules: are used to organize code and break it down into logical, reusable bits.

If architecture or code structure has always been a struggle for you, NestJS takes that hassle away. It ships with its own CLI that you can use for several things, from initializing your applications to scaffolding a project or building a well-structured application. You can generate a project and develop its schematics using the CLI. There is almost no room for mistakes in terms of the project structure.

Also, because it is built using Typescript and starts up a new project with eslint loaded up, many errors are seen in the code editor. This feature dramatically reduces the time spent on debugging code. NestJS allows you to easily integrate with popular concepts and technologies like TypeOrm, GraphQl, mongoose, validation, logging, web sockets, caching, etc. The documentation is quite expansive, and overall, it is smooth to learn and straightforward to apply.

If you have been considering learning NestJS or using it in your next project, this is the push you need to go ahead with this. It is a fast-rising framework built to help develop monoliths and microservices and construct large-scale applications. Hence, you don't have to worry about how large your app scales.

NestJS gives you a significant headstart and also assists you in progressing your project by appropriately organizing it, so why not try it out today?

And if you are already a NestJS developer, my hat's off to you.