Implementing the Strategy Pattern in NestJS

Implementing the Strategy Pattern in NestJS

Writing Clean, Decoupled Code with the Strategy Pattern One of the biggest signs of a mature backend developer is understanding how to decouple high-level business logic from low-level implementation details. That’s exactly what the Dependency Inversion Principle...
Implementing Idempotency in NestJS with an Interceptor

Implementing Idempotency in NestJS with an Interceptor

When building APIs, especially for payments or operations that modify state, you want to avoid executing the same request multiple times if the client retries. Stripe popularized the concept of idempotency keys: clients attach a unique key to a request, and the server...
How to Integrate Better-Auth with NestJS + tRPC

How to Integrate Better-Auth with NestJS + tRPC

When you’re building a modern API with NestJS and tRPC, authentication is usually one of the first hurdles. Instead of rolling your own, you can use Better Auth, a lightweight authentication service that integrates seamlessly with NestJS. In this post, I’ll show you...
Add SSL to Drizzle + NestJS for AWS RDS (Postgres)

Add SSL to Drizzle + NestJS for AWS RDS (Postgres)

Encrypting database traffic isn’t optional—especially if you’re handling user data or building anything that might one day need audits or certifications. Fortunately, enabling SSL/TLS for Postgres on AWS RDS with Drizzle ORM (node-postgres) in a NestJS app is...
Building a NestJS App with SWC: A Step-by-Step Guide

Building a NestJS App with SWC: A Step-by-Step Guide

NestJS is a powerful TypeScript framework, but its default compilation (using the TypeScript compiler, tsc) can become a bottleneck as projects grow. SWC (Speedy Web Compiler) is a Rust-based compiler that promises significantly faster build times (up to ~20× faster...
Express vs Fastify: A Performance Benchmark Comparison

Express vs Fastify: A Performance Benchmark Comparison

Introduction: Why Benchmark Express vs Fastify Express has been the de facto web framework for Node.js since its launch in 2010, known for its simplicity and huge ecosystem of middleware and plugins (Express vs Fastify: A Performace Comparison | by Chetan Jain |...