Series: API with NestJS

JavaScript NestJS SQL TypeScript

API with NestJS #53. Implementing soft deletes with PostgreSQL and TypeORM

This entry is part 53 of 187 in the API with NestJS

In this series, we’ve implemented deleting functionalities for various entities. So far, it has always meant removing records permanently from our database. Instead, we can perform soft deletes. When we delete a record using a soft delete, we only mark it as deleted. You can find the code from this series in this repository. Soft […]

JavaScript NestJS TypeScript

API with NestJS #56. Authorization with roles and claims

This entry is part 56 of 187 in the API with NestJS

So far, in this series, we’ve implemented authentication. By doing that, we can confirm that the users are who they claim to be. In this series, we explain how to implement authentication with JWT tokens or with server-side sessions. We also add two-factor authentication. While authorization might at first glance seem similar to authentication, it serves […]

Uncategorized

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

This entry is part 57 of 187 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

API with NestJS #58. Using ETag to implement cache and save bandwidth

This entry is part 58 of 187 in the API with NestJS

We’ve introduced various ways of caching files on the server throughout this series. This article teaches how to help the browser perform caching on the client side. We use the entity tag (ETag) response header to do that. Imagine having a endpoint that responds with an image. The browser calls it every time we […]

NestJS

API with NestJS #60. The OpenAPI specification and Swagger

This entry is part 60 of 187 in the API with NestJS

Across this series, we emphasize code readability and maintainability. In part #52 of this course, we’ve gone through generating documentation with Compodoc and JSDoc. This time we look into the OpenAPI specification and the Swagger tool. You can check out an interactive demo prepared by the Swagger team. Introducing OpenAPI and Swagger With OpenAPI and […]