← back to blog
1 min read
  • #books
  • #nextjs
  • #fullstack

Notes from "The Complete Developer" (Martin Krause)

Three ideas from the book that changed how I write Next.js apps.


I'm halfway through Krause's The Complete Developer. Three takeaways already worth writing down.

1. Render where the data lives. Server components don't need useEffect, don't need a fetch hook, don't need loading states. If your data lives in Postgres, render in a server component. Send rendered HTML over the wire. The client gets less JavaScript to parse.

I had been defaulting to "use client" everywhere because that's what I learned in plain React. Stopped doing that. My bundle dropped.

2. Validate at the trust boundary. The trust boundary is the edge of your process. Everything that crosses in (HTTP body, query string, headers, env vars at startup) gets validated once, with a schema, before it touches the rest of your code.

Krause uses Zod. I started using it on /api/contact and the next API route I wrote was 30% shorter because I didn't have to defensively check shapes everywhere.

3. Database schema is application code. Migrations live in version control. Every column has a purpose written in a comment. Foreign keys are enforced (not "we'll just be careful"). RLS policies sit next to the tables they protect.

The book treats Postgres like a first-class part of the codebase, not "the thing the API talks to." That mental shift is the most useful thing in the book so far.

Will write a longer review when I finish.