Nest Exception Filters: Navigating Error Realms with Finesse

Nest Exception Filters: Navigating Error Realms with Finesse Circus performers perform a variety of acts (which could be dangerous) intended to amaze, thrill, and engage audiences. In a circus, a safety net is placed below performers on a high wire or trapeze to catch them and prevent them from being injured if they fall off. If every act of the performance goes well, the safety net doesn’t get used, but if there is an unexpected failure, then the net comes to the rescue. ...

August 30, 2023

Nest Guards for Fortifying Routes and Nest Pipes for Data Validation and Transformation

In the previous article in this series, we learned about Providers, Custom Providers, and Controllers in Nest. In that article, we identified the issue of invalid data coming from the user. In this article, we will first learn about Nest Guards for protecting routes and then see how Nest Pipes can be used to validate data coming from users. Introduction to Guards in Nest NestJS guards are like vigilant gatekeepers of your application; they have only one responsibility: allow or deny access to routes based on predefined criteria (e.g. roles, permissions, ACLs, etc.) ...

August 30, 2023

A Deep Dive into Nest Providers and Controllers

In the preceding article of this series, we explored the underlying principles of NestJS, its Dependency Injection mechanism, Providers and Nest Module. In this second part, we will learn more about Nest Providers, Custom Providers, and Controllers. We will build out API endpoints that we can test with Postman. Shall we begin? Nest Providers: Empowering Application Logic The core idea of Nest Providers is that they can be injected as a dependency. Providers include services, repositories, factories, helpers, and so on that you can use to build your application logic. ...

August 30, 2023

Introduction to Nest Architecture, DI System and Nest Modules

In the fast-paced world of modern web development, crafting robust, scalable, and maintainable applications is of utmost importance. NestJS, a progressive Node.js framework, has emerged and proven itself as a powerful tool that equips developers with the means to achieve just that. The core of Nest’s strength is its architecture, which is meticulously designed to harness the power of TypeScript and bring a new level of structure and organization to Node.js server-side applications. ...

August 30, 2023

JavaScript Prototypes in Plain English

*Cover Image by Jozef Mikulcik from Pixabay * One of the concepts in JavaScript that beginners find hard to wrap their heads around is prototypes, especially for Programmers coming from a class-based programming language. You might ask “Doesn’t modern JavaScript have the class keyword?” Yes, it does, but it’s just ‘sugar’ over prototypes, and understanding how prototypes work can save you a lot of stress when debugging JavaScript code. JavaScript is weird but understanding it makes it less weird in my opinion (if you trust that my opinion matters :) ) ...

October 22, 2021

Understanding Mixins: From Ice Cream Stands to TypeScript

When Steve Herell opened his first Ice Cream store, instead of having pre-mixed flavors, he had his staff mix freshly made ice cream with candy or other confections based on the customer requests. Those candy additions were called mix-ins. Steve probably only wanted to beat the competition, he didn’t know that his mix-in would find its way into Computer Programming Languages years later, though not literally - we don’t conjure ice creams with code yet. Do we, is there something you people are hiding from me? ...

January 23, 2021

What Exactly is Node.js? (Keeping it awesomely simple)

Node.js has grown from it humble beginnings in 2009 to one of the most popular platforms for creating web applications. If you have been around web development for a while, you would have heard people say, ‘node is just javascript’. That’s true, to appreciate node.js, it would help to know what it came to solve and why it is used. Anatomy of a Web Application Image courtesy of Medium.com ...

January 4, 2020