All Posts

Practical tutorials and guides on JavaScript, CSS, Git, SEO, and AI. Written for web developers who want clear, actionable explanations.

Friday 05/06/2026

· 10 min read

Hybrid Search That Actually Works: BM25 + Embeddings + Reranking in TypeScript

Pure vector search misses exact-match queries like SKUs and error codes. Fix retrieval with hybrid search in TypeScript: BM25 + embeddings, fused with RRF, then reranked.

AIJavaScriptTypeScript

Wednesday 03/06/2026

· 11 min read

PII Redaction Middleware: Strip Sensitive Data Before It Reaches the LLM

Build TypeScript middleware that redacts PII before it reaches the LLM, then re-hydrates the response - reversible redaction, audit logging, and a test suite.

AIJavaScriptTypeScript

Monday 01/06/2026

· 10 min read

Build an AI Eval Suite with Promptfoo: Catch Prompt Regressions Before Production

How to use Promptfoo to set up a TypeScript AI eval suite that catches prompt regressions in CI - deterministic asserts, LLM-as-judge, cost budgets, and a GitHub Actions workflow.

AIJavaScriptTypeScript

Friday 29/05/2026

· 11 min read

Why Your AI Feature Needs a Job Queue (And How to Add One with BullMQ)

Why synchronous LLM calls in Next.js API routes break under real load - and how to refactor to a BullMQ job queue with idempotency, priority lanes, SSE progress, and graceful shutdown.

AIJavaScriptTypeScript

Wednesday 27/05/2026

· 14 min read

Add AI Image Generation to Your Next.js App with Replicate, Fal, and Cloudflare R2

Add AI image generation to your Next.js app end-to-end - call Replicate or Fal with Flux, store outputs in Cloudflare R2, serve via signed URLs, handle webhooks, deduplicate, and budget cost per image.

AIJavaScriptTypeScript

Monday 25/05/2026

· 10 min read

Build Generative UI with Vercel AI SDK: Stream React Components from an LLM

Build generative UI with the Vercel AI SDK - stream real React components from an LLM tool call, render partial state during streaming, and gracefully fall back when a tool isn't registered.

AIJavaScriptTypeScript

Friday 22/05/2026

· 11 min read

Pinecone vs Turbopuffer vs pgvector: Which Vector Database for Production RAG in 2026

A real benchmark of Pinecone, Turbopuffer, and pgvector for production RAG in TypeScript. Latency, recall, and monthly cost at 1M, 10M, and 100M chunks.

AIJavaScriptTypeScript

Wednesday 20/05/2026

· 13 min read

Build a Text-to-SQL Feature: Let Users Query Your Database in Plain English

Build a production-safe text to SQL TypeScript feature with Postgres. Schema context, Zod validation, sandboxed roles, EXPLAIN gating, and a self-correction loop.

AIJavaScriptTypeScript

Monday 18/05/2026

· 9 min read

Cut Your Claude API Bill by 90% Using Prompt Caching in TypeScript

How to use Anthropic prompt caching in TypeScript to cut Claude API costs by up to 90%. Where to place cache_control breakpoints, TTL tradeoffs, and real RAG cost data.

AIJavaScriptTypeScript

Friday 15/05/2026

· 12 min read

When Your AI Feature Gets Gamed: Prompt Injection Defense for JavaScript Apps

Practical prompt injection defense for JavaScript web apps: input sanitization middleware, system prompt hardening, canary tokens, and output validation with a real attack test suite.

AIJavaScriptSecurity

Wednesday 13/05/2026

· 11 min read

How to Write an AI Feature Spec That Engineers Won't Push Back On

An AI feature spec template with the eight sections engineers actually want: success metrics, fallback behavior, latency budgets, edge cases, and eval sets. Real before/after example.

AIJavaScript

Monday 11/05/2026

· 12 min read

Build a Voice-Enabled AI Assistant in the Browser with TypeScript

Build a voice AI assistant in the browser with TypeScript using the Web Speech API, an LLM, and speech synthesis. Handle interruption, wake words, and mobile quirks - no backend needed for speech.

AIJavaScript

Friday 08/05/2026

· 14 min read

Add AI-Powered Citations and Source Attribution to Your RAG Chatbot

Upgrade your RAG chatbot with inline citations using Claude's Citations API and a React UI that renders clickable source markers. Full TypeScript walkthrough including hallucination detection.

AIJavaScript

Wednesday 06/05/2026

· 10 min read

How to Structure Your TypeScript Codebase So AI Coding Agents Work Better

Practical TypeScript codebase patterns that make Claude Code, Cursor, and Copilot dramatically more effective. CLAUDE.md, module boundaries, typed configs, and the file-size rule that fixed our agent's worst habits.

AIJavaScript

Monday 04/05/2026

· 12 min read

How to Migrate from OpenAI Assistants API to Responses API in TypeScript

Migrate your OpenAI Assistants API integration to the Responses API in TypeScript before the mid-2026 sunset. Concept-by-concept mapping, before/after code diffs, and the gotchas nobody mentions.

AIJavaScript

Friday 01/05/2026

· 12 min read

Streaming AI UX in React: Handle Partial Markdown, Citations, and Error States

Build a streaming AI UI in React that renders partial markdown without layout shifts, shows citations as they arrive, and recovers from mid-stream errors. Reusable components, no AI SDK required.

AIJavaScript

Wednesday 29/04/2026

· 11 min read

How to Route LLM Requests to Cheap vs Expensive Models Automatically in TypeScript

Build an LLM model router in TypeScript that sends simple queries to Haiku and only escalates complex ones to Opus. Real classification logic, fallback chains, and 50-70% cost savings.

AIJavaScript

Friday 24/04/2026

· 12 min read

Mastra vs VoltAgent: The Two New TypeScript Agent Frameworks Compared

Build the same AI agent in Mastra and VoltAgent - the two new TypeScript-native frameworks. Honest comparison of DX, memory, MCP support, observability, and bundle size.

AIJavaScript

Wednesday 22/04/2026

· 10 min read

Google Agent Development Kit for TypeScript: Build a Multi-Agent System from Scratch

Build a multi-agent research assistant with Google ADK for TypeScript. Supervisor agent coordinating three specialists - web researcher, data analyst, report writer - with tool definitions and local + Cloud Run deployment.

AIJavaScript

Monday 20/04/2026

· 9 min read

Build an MCP Client in TypeScript That Connects to Multiple Tool Servers

Build a TypeScript MCP client that connects to multiple servers simultaneously and lets an LLM use tools from all of them in one conversation - with capability discovery, namespacing, and error handling.

AIJavaScript

Friday 17/04/2026

· 12 min read

How to Add LLM Observability and Tracing to Your TypeScript AI App with Langfuse

Add LLM observability and tracing to your TypeScript AI app with Langfuse - trace every LLM call, tool invocation, and retrieval step, and build dashboards showing latency, token usage, and cost.

AIJavaScript

Monday 13/04/2026

· 13 min read

Should You Build or Buy AI Features for Your SaaS? A Decision Framework

A practical decision framework with real cost math to help you decide whether to build AI features with APIs or buy a third-party AI product for your SaaS.

AIJavaScript

Friday 10/04/2026

· 15 min read

Build a Multi-Agent Customer Support System with Handoffs in TypeScript

Build a multi-agent customer support system in TypeScript where a triage agent routes conversations to specialized billing, technical, and returns agents - with human escalation.

AIJavaScript

Monday 06/04/2026

· 9 min read

How to Measure If Your AI Feature Is Actually Working (A Guide for Product Teams)

Stop relying on vibes. Learn what metrics to track, how to set up A/B tests, and when to kill an AI feature that isn't delivering value.

AIJavaScript

Friday 03/04/2026

· 12 min read

Build an Agentic RAG Pipeline That Retries and Reformulates Queries

Upgrade your basic RAG pipeline to an agentic loop that evaluates retrieval quality, reformulates queries, and retries with alternative strategies - all in TypeScript.

AIJavaScript

Wednesday 01/04/2026

· 9 min read

Claude Code Source Leak: What the Exposed Code Reveals About AI Agent Architecture

Anthropic accidentally shipped source maps in their Claude Code npm package, exposing the full architecture. Here is what the leaked code teaches us about building production AI agents.

AIJavaScript

Wednesday 01/04/2026

· 11 min read

Claude Agent SDK vs OpenAI Agents SDK: Building AI Tools in TypeScript

Compare Claude Agent SDK and OpenAI Agents SDK by building the same coding assistant in both. Real TypeScript code, honest tradeoffs, and guidance on which to pick.

AIJavaScript

Monday 30/03/2026

· 13 min read

Why Most AI Agent Architectures Are Overengineered (And What to Build Instead)

Most AI agent use cases don't need multi-agent frameworks. Learn how to replace overengineered agent architectures with a simple tool-calling loop in TypeScript.

AIJavaScript

Friday 27/03/2026

· 11 min read

How to Build an AI-Powered Autocomplete for Any Text Input

Build a reusable React component that streams AI autocomplete suggestions as ghost text in any textarea - with debouncing, cancellation, and keyboard shortcuts.

AIJavaScript

Wednesday 25/03/2026

· 11 min read

Run AI Models Directly in the Browser with WebLLM and WebGPU

Build a privacy-first note-taking app that summarizes and tags notes entirely in the browser using WebLLM and WebGPU - no API keys, no server, no data leaving the device.

AIJavaScript

Monday 23/03/2026

· 11 min read

Vercel AI SDK vs Mastra vs LangChain.js: Which TypeScript AI Framework Should You Use

Compare Vercel AI SDK, Mastra, and LangChain.js by building the same tool-calling agent in all three - with honest tradeoffs on DX, streaming, and production readiness.

AIJavaScript

Saturday 21/03/2026

· 11 min read

Build a Human-in-the-Loop AI Agent with Vercel AI SDK

Build a Next.js AI agent that asks for user approval before taking actions - using Vercel AI SDK's tool confirmation flow with streaming UI and approval dialogs.

AIJavaScript

Wednesday 18/03/2026

· 10 min read

Structured Output with Zod: Force Any LLM to Return Typed JSON

Stop parsing messy LLM text with regex. Learn how to use Zod schemas to get reliable, typed JSON from Claude, OpenAI, and Vercel AI SDK - with validation, error recovery, and nested schemas.

AIJavaScript

Wednesday 18/03/2026

· 12 min read

How to Build an MCP Server in TypeScript from Scratch

Learn how to build a Model Context Protocol (MCP) server in TypeScript that connects a PostgreSQL database to any LLM client - with tools, resources, and Streamable HTTP transport.

AIJavaScript

Wednesday 04/03/2026

· 14 min read

How to Test AI Features: Unit Testing LLM-Powered Code

Learn practical patterns for testing LLM-powered TypeScript code - mocking AI APIs, snapshot testing non-deterministic outputs, eval frameworks, and assertion strategies with Vitest.

AIJavaScript

Monday 02/03/2026

· 11 min read

Build a Slack Bot That Answers Questions About Your Codebase

Build an AI Slack bot that indexes your codebase and answers questions like 'where is the auth logic?' - with full TypeScript code using embeddings and Claude.

AIJavaScript

Friday 27/02/2026

· 12 min read

How to Cache AI Responses Without Breaking Your App

Learn how to cache AI API responses to cut costs and latency - exact match, semantic similarity, and prompt fingerprinting strategies with TypeScript and Redis.

AIJavaScript

Wednesday 25/02/2026

· 9 min read

The Real Cost of Running an AI Feature in Production (With Math)

Break down the real cost of AI API calls in production - token math for chatbots, RAG, and summarization, plus a TypeScript cost calculator and optimization tips.

AIJavaScript

Tuesday 24/02/2026

· 11 min read

How to Build an AI-Powered Form That Extracts Data from PDFs

Build a Next.js form that uploads a PDF, sends it to Claude for structured data extraction, and renders editable fields - full working code from upload to form.

AIJavaScript

Friday 20/02/2026

· 12 min read

Build a Multi-Step AI Agent with Tool Use in TypeScript

Build a TypeScript AI agent that calls tools, chains decisions, and solves multi-step tasks using Claude's tool_use API - full working agent loop included.

AIJavaScript

Wednesday 18/02/2026

· 12 min read

How to Handle AI API Rate Limits and Errors in Production (TypeScript)

Production-ready TypeScript patterns for handling AI API rate limits - exponential backoff, request queues, token budgets, and graceful degradation you can copy-paste.

AIJavaScript

Tuesday 17/02/2026

· 8 min read

Building an AI Code Review Bot with Claude and GitHub Actions

Build a GitHub Action that automatically reviews pull requests using Claude - complete working workflow YAML and TypeScript script you can add to any repo.

AIJavaScript

Friday 13/02/2026

· 8 min read

How to Add AI Search to Any Website with Embeddings and Supabase

Add AI-powered semantic search to your website using OpenAI embeddings and Supabase pgvector - full working TypeScript example with a React frontend.

AIJavaScript

Wednesday 11/02/2026

· 11 min read

Claude vs OpenAI API: A Practical Comparison for JavaScript Developers

A side-by-side code comparison of the Claude API vs OpenAI API for JavaScript developers - streaming, tool use, vision, and pricing math with real TypeScript examples.

AIJavaScript

Monday 09/02/2026

· 8 min read

How to Stream Claude API Responses in a Next.js App (With Full Code)

Learn how to stream Claude API responses token-by-token in a Next.js app using the Anthropic TypeScript SDK and Server-Sent Events. Full working code included.

AIJavaScript

Monday 09/02/2026

· 9 min read

Build a RAG Chatbot in 100 Lines of TypeScript

Build a RAG chatbot in TypeScript that answers questions about your own documents using the Anthropic SDK and a vector database - no LangChain, no bloated frameworks.

AIJavaScript

Tuesday 09/08/2022

· 5 min read

How to remove element from array

Six ways to remove elements from a JavaScript array - filter, splice, pop, shift, length, and delete - with code, gotchas, and which to use when.

JavaScript

Monday 08/08/2022

· 6 min read

Cons of using React context

The downsides of React Context - every consumer re-renders on every value change. Three patterns to fix it: split contexts, useMemo on the value, and the selector pattern.

JavaScript

Sunday 07/08/2022

· 5 min read

What are JS data types

JavaScript has 8 data types - 7 primitives (string, number, bigint, boolean, undefined, null, symbol) and one object type. How typeof handles each, with examples.

JavaScript

Saturday 06/08/2022

· 5 min read

Access to element with ID

HTML element IDs are auto-bound to JavaScript globals - handy but a foot-gun. Why it happens, the bugs it causes, and the modern alternatives you should use instead.

JavaScript

Tuesday 02/08/2022

· 5 min read

How to return tuple in typescript

Three ways to return a tuple from a TypeScript function - `as const`, explicit tuple type, and named tuples - with type inference behavior and when each is right.

JavaScript

Monday 01/08/2022

· 6 min read

Simple object validation

Validate JavaScript objects at runtime using Proxy - set and get traps, throwing on bad writes, and three patterns from simple value checks to schema-based validation.

JavaScript

Sunday 31/07/2022

· 5 min read

Why to use pnpm

Why pnpm beats npm and Yarn - content-addressable storage saves disk, strict node_modules prevents phantom dependencies, and warm installs are 3–4× faster.

JavaScript

Wednesday 27/07/2022

· 5 min read

How to implement map function

Implement Array.prototype.map from scratch in JavaScript - three versions covering the interview answer, full callback signature, and a spec-compliant polyfill.

JavaScript

Tuesday 26/07/2022

· 6 min read

Meta tags for SEO

The HTML meta tags that actually move SEO - title, description, canonical, robots, viewport, OpenGraph, and Twitter Cards. Which to include, which to skip, what they do.

SEO

Monday 25/07/2022

· 4 min read

How to center a div

Five ways to center a div in CSS - flexbox, grid, absolute positioning, margin auto, and transform - with working code, browser support notes, and when to pick each.

CSS

Sunday 24/07/2022

· 5 min read

Implement isPalindrome in JS

Three ways to check if a string is a palindrome in JavaScript - reverse comparison, two-pointer scan, and recursion - with performance notes and edge cases.

JavaScript

Saturday 23/07/2022

· 5 min read

Connect google analytics to Next.js App

Connect Google Analytics (GA4) to a Next.js app with the Script component, dev/prod handling, route-change tracking, and consent-aware loading.

JavaScript

Saturday 23/07/2022

· 5 min read

Git restore to remote version

Reset a Git branch to match its remote - `git reset --hard origin/branch`, with safer alternatives, how to recover after a mistake, and when to use each.

GIT

Friday 22/07/2022

· 5 min read

Serve app on port 80 using Nginx

Set up Nginx as a reverse proxy for a Node app on Ubuntu - site config, symlinks, restart, HTTPS upgrade with certbot, and the 502/504 gotchas.

JavaScript

Friday 22/07/2022

· 6 min read

Create-nextjs-pwa

Turn a Next.js app into a Progressive Web App with next-pwa - manifest config, service worker, offline support, installation prompt, and the platform gotchas.

JavaScript