Category: Uncategorized

Uncategorized

API with NestJS #168. Integration tests with the Drizzle ORM

This entry is part 168 of 168 in the API with NestJS

Writing tests for our application helps ensure it works as intended and is reliable. So far, we have written unit tests for our NestJS application that uses the Drizzle ORM. Unit tests help us check if a particular class of a single function functions properly on its own. While unit tests are important, they are […]

Uncategorized

API with NestJS #57. Composing classes with the mixin pattern

This entry is part 57 of 168 in the API with NestJS

Inheritance is one of the four pillars of object-oriented programming. JavaScript has the prototype-based inheritance, and with it, one object can acquire properties of another object. Even though JavaScript has the class keyword, it still uses prototypes under the hood. If you want to know to know more about prototypes, check out this article I wrote […]

JavaScript NestJS TypeScript Uncategorized

API with NestJS #19. Using RabbitMQ to communicate with microservices

This entry is part 19 of 168 in the API with NestJS

NestJS subscribes to the idea that a microservice is an application that uses a different transport layer than HTTP. Therefore, in the previous part of this series, we’ve used TCP. However, with NestJS, we have a broad selection of transporters that transmit messages across microservices. Each one of them is different, and it is worth exploring […]

JavaScript TypeScript Uncategorized

More advanced types with TypeScript generics

Previously, we’ve discussed the basics of TypeScript Generics. This time, we take them to a higher level. In this article, we learn about index types. To do so, we also explore union types, the keyof keyword, and string literal types. Today we also learn mapped types and use them with conditional types. Index types Generics are very useful in many situations. […]

Uncategorized

TypeScript Generics. Discussing naming conventions

We can find the concept of generic types across many languages such as Java, C#. Naturally, they found their way into TypeScript. In this article, we discuss their purpose and provide various examples. We also discuss naming conventions for generics that we can stumble upon. Introducing TypeScript Generics One of the qualities that we strive […]

Uncategorized

Introduction to WebSockets. Creating a Node.js server and using WebSocket API in the browser

WebSocket is a protocol that makes two-way communication in real-time between the user and the server possible. A common use cases are chats and online multiplayer games. Today we cover implementing it both on frontend and backend. Let’s go! Explaining WebSockets WebSocket is a different protocol than HTTP. Despite that, to establish a connection, the client sends […]