All posts.
Every EasySpawn article, newest first — deploying AI-built apps, Claude Code, databases, security, and the infrastructure underneath.
822 posts · page 14 of 34
OpenAI API vs Claude API: Which Should Your App Use?
Both APIs let your app send text (and images) to a model and get an answer back. How they differ in request shape, models, tool calling, structured output, caching and pricing — and why many apps keep the choice swappable instead of picking forever.
What Is an Open Redirect Vulnerability? (And How to Fix It)
An open redirect lets anyone use your domain to send people to any other site — perfect for phishing links that look trustworthy. How it happens with ?next= and ?returnTo= parameters, why it's worse with OAuth, and the safe ways to redirect after login.
ON DELETE CASCADE Explained (and When Not to Use It)
When you delete a row that other rows reference, the foreign key decides what happens: block the delete, cascade it, or set the reference to NULL. How CASCADE, RESTRICT, SET NULL and NO ACTION work, examples, the risks of cascading, and how to change an existing constraint.
"Objects Are Not Valid as a React Child": How to Fix It
React can render text, numbers and elements, but not plain objects. This error means you put an object, a Date, or a Promise inside JSX. How to find which value it is from the 'keys' in the message, and the fix for each common case.
TypeScript "Object Is Possibly Undefined" (or Null): How to Fix It
TypeScript warns that a value might be undefined or null before you use it — the exact situation that causes 'Cannot read properties of undefined' at runtime. The right fixes: optional chaining, nullish coalescing, early returns and narrowing, typed state and refs, and when the ! operator is acceptable.
OAuth PKCE Explained: Why Every OAuth Flow Should Use It
PKCE (Proof Key for Code Exchange) protects the OAuth authorization code flow from code interception. How code_verifier and code_challenge work step by step, why it's required for SPAs and mobile apps and recommended for everyone, the state parameter, and the mistakes to avoid.
NULL in SQL Explained: Why = NULL Never Works
NULL in SQL means 'unknown', not zero or an empty string — which is why WHERE column = NULL returns nothing. How IS NULL, COALESCE, NULLIF and IS DISTINCT FROM work, how NULL affects counts, sums, NOT IN and unique constraints, and when to use NOT NULL.
npm run dev vs npm run build vs npm start: What Each One Does
npm run dev starts a development server with hot reload; npm run build makes an optimised production version; npm start runs that production version. What each does, where the commands come from in package.json, and why you should never run dev mode in production.
npm run build Fails but npm run dev Works: Why and How to Fix It
Development mode is forgiving; production builds are strict. The common reasons a build fails when dev works — TypeScript and lint errors, case-sensitive imports, missing environment variables, server-only code in the browser, prerendering errors and memory — with the fix for each.
npm ERR! code ENOENT: What It Means and How to Fix It
ENOENT means 'no such file or directory'. In npm it usually means you're in the wrong folder, there's no package.json, a script points at a missing file, or node_modules is broken. How to read the error and fix each cause.
npm EACCES: Permission Denied — Fix It Without sudo
EACCES means npm tried to write somewhere your user isn't allowed to — usually the global packages folder after Node was installed with sudo or a system package. Why sudo npm is the wrong fix, and the right ones: a Node version manager or a user-owned global prefix.
"fatal: not a git repository": What It Means and How to Fix It
Git can't find a .git folder in the current directory or any parent. The usual causes — wrong folder, never ran git init, a deleted or broken .git, Docker builds and CI without Git history, safe.directory ownership checks — and the fix for each.
What Is node_modules? (And When to Delete It)
node_modules is the folder where npm installs your project's dependencies. Why it's so big, why it must never go into Git, when deleting it and reinstalling fixes things, the right commands on Mac, Linux and Windows, and how to reclaim disk space across old projects.
Node.js Event Loop Lag: Finding What Blocks Your Server
When one request's CPU work blocks the event loop, every other request waits. How to measure event loop delay and utilisation with perf_hooks, the usual culprits (big JSON, sync crypto, regex backtracking, sync fs), profiling with --cpu-prof, the libuv threadpool, and fixes from chunking to worker threads.
"No Space Left on Device": Finding and Freeing Disk Space on a Server
When a server's disk fills up, databases stop writing, deploys fail and apps crash with ENOSPC. How to find what's using space with df and du, the usual culprits (logs, Docker, journald, old releases, deleted-but-open files), inode exhaustion, and how to stop it happening again.
Nginx Reverse Proxy Configuration: A Production-Ready Example
A complete Nginx reverse proxy config for a Node.js or Python app, explained line by line: proxy_pass, forwarding headers, WebSockets, timeouts, upload limits, HTTPS redirect, gzip, static files, multiple apps by domain, and how to test and reload safely.
Next.js Server Actions: Forms and Mutations Without API Routes
Server Actions (Server Functions) let a form or button call a function that runs on the server, without writing an API route. How 'use server' works, forms with useActionState, validation with Zod, revalidating data, pending states — and why every action is a public endpoint that needs its own auth checks.
Next.js Middleware Is Now Proxy: proxy.ts Explained
In Next.js 16, middleware.ts was renamed to proxy.ts and now runs on Node.js by default. What proxy does, the matcher config, common uses (auth redirects, rewrites, headers, CORS), the codemod to migrate, and why you must still check authorization inside every Server Function and route.
Next.js App Router vs Pages Router: Differences and Whether to Migrate
Next.js has two routers: the older pages/ directory and the newer app/ directory built on React Server Components. How routing, data fetching, layouts and API routes differ, which one new projects should use, and a sensible incremental migration path.
"new row violates row-level security policy" in Supabase: How to Fix It
Supabase (Postgres) blocked an insert or update because no RLS policy allows it. Why it happens, how to write an INSERT policy with WITH CHECK, the user_id default trick, the hidden SELECT-after-insert problem, storage uploads, and why you must never 'fix' it by disabling RLS.
Neon vs Supabase: Which Postgres Platform Should You Use?
Neon is serverless Postgres with branching and scale-to-zero; Supabase is Postgres plus auth, storage, realtime and APIs. How they differ, free tier limits, pricing, cold starts and pausing, and which fits an AI-built app.
Mutual TLS (mTLS) Explained: When the Server Checks You Too
In normal TLS only the server proves its identity. With mutual TLS the client presents a certificate too. How the mTLS handshake works, running a private CA, issuing and rotating short-lived client certificates, configuring Nginx and Node, mTLS in service meshes and webhooks, and the operational traps.
Message Queues Explained: When You Need One and Which to Use
A message queue lets one part of your system hand work to another without waiting. Queues vs pub/sub vs event streams, delivery guarantees, dead-letter queues, and an honest comparison of Postgres, Redis, RabbitMQ, SQS and Kafka for a small team.
MCP vs API: What's the Difference, and Do You Need Both?
An API is how programs talk to a service. MCP (Model Context Protocol) is a standard way for AI tools to discover and use those services. How they relate, why MCP servers usually wrap APIs, when to use each, and what MCP adds and costs.