Ch03 Build And Deploy
# Chapter 3 prompts — Empty Folder to Live App
**Hour block: hours 2-8** of the book's 48-hour build.
> **Access requirement:** every prompt below is pasted into an interactive Claude
> Code terminal session, and Claude Code requires Pro or higher — the free plan
> does not include it (ch03:31). This repository never runs any of these prompts,
> and neither does its CI. They are documentation, not executable code.
**The full pack, with every prompt transcribed verbatim: [`prompts/ch03-build-and-deploy.md`](../../prompts/ch03-build-and-deploy.md)**
The pack is the source of truth for exact prompt text; this page is the guide to
navigating it — what each prompt is for, in what order, and which two the book
leans on hardest.
## What this chapter's prompts do
This chapter takes an empty folder to a live, publicly reachable app. The prompts
scaffold a Next.js + Prisma + SQLite task tracker in one shot, add a first feature,
teach the reader to ask Claude to explain its own code instead of guessing, work
through the standard debugging pattern (describe expected vs. actual, let Claude
find the cause), add authentication, fix the most common security hole in
Claude-generated auth (the IDOR bug), write a CLAUDE.md, and deploy to Vercel with
a hosted Postgres database. By the end of the chapter the app is live, functional,
and ugly — which is the setup for Chapter 4.
## When you use them
This is the first build chapter — hours 2-8 of the 48-hour arc, right after
Chapter 2's Claude Code install and orientation. Nothing needs to exist before you
start except an empty project directory and a working `claude` command. Everything
else (the framework, the database, the auth) gets scaffolded by the prompts
themselves, in the order the pack lists them.
## Index of every prompt in the pack
| # | Prompt | Cite | What it does |
|---|---|---|---|
| 1 | The scaffold prompt | ch03:73-75 | Creates the whole Next.js + TypeScript + Tailwind + Prisma/SQLite project, the Task model, and the first migration, from one paste |
| 2 | Fixing the model | ch03:119 | Adds the missing `status` enum to the Task model when the scaffold came out wrong |
| 3 | The first feature | ch03:125-127 | Builds the task list page: list, create form, status-cycle button |
| 4 | Explain a function | ch03:171-173 | Asks Claude to explain `updateTaskStatus` step by step |
| 5 | Walk through a file | ch03:171-173 | Asks Claude to walk through a file line by line |
| 6 | Dev server won't start | ch03:179 | Reports the `Module not found: @prisma/client` error and lets Claude debug it |
| 7 | Tasks don't save | ch03:181 | Reports "form submits, no task appears, no console errors" |
| 8 | Raw JSON instead of a UI | ch03:183 | Reports the page rendering raw JSON and asks for the UI components |
| 9 | Prisma migration conflict | ch03:185 | Asks Claude to delete the SQLite file and re-run migrations from scratch |
| 10 | Fetch fails | ch03:141 | Reports a "Failed to fetch tasks" console error |
| 11 | Tasks vanish on reload | ch03:143 | Reports tasks disappearing after a page reload |
| 12 | Add authentication | ch03:195-197 | Adds NextAuth.js with a credentials provider, password hashing, per-user task scoping, login/signup pages |
| 13 | Generate `.env.local` | ch03:219 | Asks Claude to create `.env.local` with `DATABASE_URL`, `NEXTAUTH_SECRET`, `NEXTAUTH_URL` |
| 14 | Fix the infinite redirect loop | ch03:187 | Reports the login-bounce-login loop and asks Claude to fix the session configuration |
| 15 | ⭐ The IDOR fix | ch03:231 | Scopes every Prisma task query to the logged-in user's ID — the most important prompt in the chapter |
| 16 | Create CLAUDE.md | ch03:239-260 | Asks Claude to write a CLAUDE.md describing the project, stack, and rules so far |
| 17 | Deploy to Vercel | ch03:270-272 | Deploys the app, with manual steps (like connecting GitHub) called out separately |
| 18 | Switch to hosted Postgres | ch03:278 | Migrates the database off SQLite (which cloud platforms can't run) to hosted Postgres |
| 19 | Run the production migration | ch03:288 | Runs `npx prisma migrate deploy` against the production `DATABASE_URL` once it's set |
| 20 | Fix a failed Vercel build | ch03:305 | Pastes the TypeScript build error and lets Claude fix it |
20 prompts, matching the pack's own count ("Twenty prompts, from `mkdir` to a
public URL").
## The signature prompts
### The scaffold prompt (ch03:73-75)when to use it
Community prompt sourced from the open-source GitHub repo regardo911/claude-code-beginners (MIT). A "Ch03 Build And Deploy" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
roleplaycommunitygeneral
source
regardo911/claude-code-beginners · MIT