JH.
Blog & Articles

Thoughts on
Code & Craft

Deep dives, tutorials, and real-world lessons from building production applications.

🔍
⚙️
⭐ Featured12 min read
BackendApr 15, 2025👁 2.4k

Building a Production-Grade Auth System with NestJS — JWT, OTP, 2FA & Social OAuth

A complete walkthrough of building an enterprise-level authentication system from scratch. Covers JWT access/refresh token rotation, OTP with 5-minute expiry, 2FA, failed login lockout, and integrating 6 OAuth providers via Passport.js — exactly how I built it for Toolffy.

NestJSJWTOAuth 2.0Passport.js
JH
Junayed Hassan
Read Article
🗄️
Backend8 min read
BackendMar 28, 2025👁 1.1k

PostgreSQL Raw SQL Migrations vs Prisma ORM — When to Use What

Real production lessons from building 20+ database modules. When raw SQL gives you control and when Prisma saves you time — a practical comparison with real code examples.

PostgreSQLPrismaRaw SQLNestJS
JH
Junayed Hassan
Read
🐳
DevOps10 min read
DevOpsMar 10, 2025👁 890

Docker + Nginx + CI/CD: Deploying a NestJS App to Production

Step-by-step guide to containerizing a NestJS application, setting up Nginx reverse proxy, and automating deployment with a CI/CD pipeline using deploy.sh and ecosystem.config.js.

DockerNginxCI/CDNestJS
JH
Junayed Hassan
Read
Frontend7 min read
FrontendFeb 20, 2025👁 760

Next.js 14 App Router — Server vs Client Components Deep Dive

Practical guide to deciding when to use Server Components, Client Components, and how to structure your Next.js 14 application for maximum performance and developer experience.

Next.js 14App RouterReactTypeScript
JH
Junayed Hassan
Read
🤖
AI9 min read
AIFeb 5, 2025👁 1.3k

Integrating Google Gemini AI into a NestJS REST API

How I integrated Gemini AI for smart product recommendations in Toolffy — from API setup to streaming responses and caching results with Redis for optimal performance.

Gemini AINestJSRedisREST API
JH
Junayed Hassan
Read
🔐
Auth6 min read
AuthJan 18, 2025👁 640

RBAC in Node.js — Role-Based Access Control from Scratch

Building a flexible, scalable RBAC system without any library — middleware, role guards, and permission layers explained with real production code from the Toolffy platform.

RBACNode.jsNestJSMiddleware
JH
Junayed Hassan
Read
📬

Stay Updated

Get new articles on backend engineering, DevOps & AI straight to your inbox.

Popular Tags