DH

Tutorials

Learn to build SaaS.

Practical tutorials on building modern web applications.

13 min read
Managing Cost and Token Budgets for LLM APIs in Production: Caching, Batching, and Fallback Models
Treat LLM spend like database load. Build routing, caching, and cost controls into your request path from day one—not as an afterthought.
aiperformance
Read tutorial
10 min read
Setting Up a CLAUDE.md File on a Real Full-Stack Repo
Set up Claude Code context files that persist across sessions. Load architecture decisions, conventions, and polyglot rules once—then let AI assistants reference them automatically.
aiautomationtypescript
Read tutorial
12 min read
Deploying FastAPI and Next.js to AWS App Runner vs. ECS Fargate: When Managed Wins
Senior engineer's honest breakdown: App Runner for solopreneurs and small teams, ECS Fargate when you need control. Real tradeoffs, no hype.
awsfastapinextjs
Read tutorial
14 min read
The N+1 Query Problem: How to Spot It and Fix It in Django and SQLAlchemy
How the N+1 query problem silently tanks production performance, why it's invisible in dev, and concrete fixes for Django and SQLAlchemy.
djangoperformancepostgres
Read tutorial
13 min read
AWS Cost Optimization for a Dockerised Stack: Right-Sizing ECS, Fargate Spot, and Egress Traps
Right-size ECS, use Fargate Spot, avoid egress traps. Production checklist from 25+ years of SaaS infrastructure decisions.
awsdockerperformance
Read tutorial
10 min read
WebSockets in FastAPI and Next.js: Scaling Real-Time Connections Behind a Load Balancer
Build production WebSocket architectures that survive load balancers. Protocol fundamentals, connection management, authentication, and horizontal scaling without message loss.
fastapinextjsperformance
Read tutorial
13 min read
React Router v7 as a Framework: Migrating from Remix and Choosing It Over Next.js
Why React Router v7's three modes make it a genuine Next.js alternative. Architecture decisions from 25 years of production experience.
reactnodejstypescript
Read tutorial
10 min read
Health Checks, Graceful Shutdown, and SIGTERM Handling for FastAPI and Next.js Containers on ECS
Production patterns for health checks, SIGTERM handling, and graceful shutdown in containerised FastAPI and Next.js services on AWS ECS—edge cases included.
fastapinextjsaws
Read tutorial
11 min read
Streaming Structured Output from Anthropic and OpenAI APIs to a Next.js UI
Production pattern for streaming JSON schemas from LLM APIs into a Next.js UI, handling Anthropic and OpenAI differences without the blank-screen wait.
nextjsaitypescript
Read tutorial