DEV Community

Cover image for Nestjs🐺⚡ | The framework of Nodejs (Part-1) | Controllers, ExceptionFilters, Providers

Nestjs🐺⚡ | The framework of Nodejs (Part-1) | Controllers, ExceptionFilters, Providers

Kingkor Roy Tirtho on August 08, 2021

Nestjs is a server-side framework often confused with the term "Server-Side Angular" Even though Nest follows the pattern & design principals...
Collapse
 
buphmin profile image
buphmin

Also fun fact* NestJS with the fastify adapter is extremely fast! In my testing it was faster than express, koa, sails, and adonis.

We use NestJS at my work for a specific project and we have been quite satisfied. We made our decision based on it's flexibility combined with out of the box functionality which was perfect to get more junior developers building something fairly well structured without much oversight.

*testing on a local 1G ethernet network using one computer as a server and another as the stress tester

Collapse
 
markpieszak profile image
Mark Pieszak

That's great to hear! Do you have any applications in production from your organization? I'd love to take a look and share it with the Nest team! 🐈

Collapse
 
buphmin profile image
buphmin

Unfortunately we are still in stealth mode, but perhaps soon! We are using NestJS in production to good effect under relatively low load with closed beta users. Obviously a lot goes into response time, not just the framework, but we are routinely able to achieve sub 100ms API requests after the JIT has optimized the calls. Our frontend devs thought they were still using inline JS mock data because the response time was so low :3

Collapse
 
ninan_phillip profile image
Phillip Ninan

Great read! I'm a big fan of Angular and Spring Boot. This seems like best of both worlds.

Collapse
 
markpieszak profile image
Mark Pieszak

Give it a shot! You’ll love it 🐈

Collapse
 
zaimazhar profile image
zaimazhar

A good introduction to NestJS! Thanks.

I've worked with IBM's LoopBack and able to relate some terminologies in your article but it might sounds complete gibberish to some newcomers. Overall still a good introduction. 👍🏽

Collapse
 
krtirtho profile image
Kingkor Roy Tirtho

Thank you very much❤️

Collapse
 
akiraah profile image
akiraah • Edited

Annotations, a lot of boiler plate... Very similar to spring boot, no thanks.

Collapse
 
markpieszak profile image
Mark Pieszak

Wait until you see how much it boosts developer productivity! 🙌

Only shares some comparisons to Spring boot, but the difference is quick stark in most ways!

Collapse
 
akiraah profile image
akiraah

This defeats the purpose of using JavaScript to begin with. You don't need to use tools such a DI, DI was created especially for OOP languages. You can create a simple rest express app without these boilerplate code.

Thread Thread
 
markpieszak profile image
Mark Pieszak • Edited

DI helps separate a class from its dependencies.

Take Testing for example, with DI it takes 10x less effort to swap / mock / anything you need to do.
You could test things in isolation, provide alternative testing containers (with different databases), the number of benefits highly outweighs any cons. But it always depends on the team and projects, right!

As you said for a simple Rest application, you might not even need it (or Nest), but if you're dealing with a gigantic REST or GraphQL app, or monorepo with lots of apps + micro services, it becomes really advantageous!

Collapse
 
markpieszak profile image
Mark Pieszak

Great write up! 💯