Clean REST API with NestJS and CQRS

Clean REST API with NestJS and CQRS

Today I would like to present a simple example of a clean REST API for managing books. Let me show you how beautifully organized it is with a little help from the CQRS module from NestJS.

Nowadays APIs are everywhere, whether you like it or not, and if you are a software engineer, you cannot avoid REST API, that’s how incredibly common it is.

If you decide to create another API in Node.js you might be faced with a dilemma… which HTTP framework should I use? There are plenty of options including the most popular choices like express, koa, loopback… and NestJS.

NestJS is a framework for building  Node.js server-side applications. It comes out of the box with tons of great tools, lots of which were inspired by Angular like modules, services, dependency injection, CLI, pipes, and many more. By default, it uses TypeScript however you can use VanillaJS if you wish.

Today I would like to present a simple example of a clean REST API for managing books. Let me show you how beautifully organized it is with a little help from the  CQRS module from NestJS.

Click here for the Github repository.

First, we will take a look at the general structure, then we will analyze it step by step.

nestjs nodejs javascript api

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Top 10 API Security Threats Every API Team Should Know

Learn what are the most important API security threats engineering leaders should be aware of and steps you can take to prevent them

Public ASX100 APIs: The Essential List

The method used for this initial research was to obtain a list of the ASX100 (as of 18 September 2020). Then work through each company looking at the following

What Are Good Traits That Make Great API Product Managers

What is API product management and what can you be doing to be a better API product manager — get aligned with SaaS and enterprise software requirements. This guide lays out what is API product management and some of the things you should be doing to be a good product manager.

54% of Developers Cite Lack of Documentation as the Top Obstacle to Consuming APIs

APIs are perceived as reliable—more than half of respondents stated that APIs do not break, stop working, or materially change specification often enough to matter.

Consume Web API Post method in ASP NET MVC | Calling Web API | Rest API Bangla Tutorial

LIKE | COMMENT | SHARE | SUBSCRIBE In this tutorial, I will discussed about how to consume Web API Get method and display records in the ASP.NET View. Here, ...