How to start a new Next.js project (with the playbook)
Status: π© COMPLETE Last updated: 2026-06-19 Plain-English tagline: The full bootstrap procedure: from
npx create-next-appto first commit, first deploy, and the project hygiene basics. ~45 minutes.
Goal
A fresh Next.js project that:
- Uses TypeScript, App Router, Tailwind, shadcn/ui-ready
- Is in a Git repo, on GitHub
- Is deployed to Vercel at a
.vercel.appURL - Has
AGENT_GUIDE.md,PROGRESS.md, and aCLAUDE.mdfrom the first commit - Is connected to a Supabase project (if you need a backend)
This is the procedure recommended by the playbook for any new webapp.
Prerequisites
- Node.js 22+ (current LTS as of June 2026)
- Git installed and configured (
git config --global user.nameanduser.email) - GitHub account
- Vercel account linked to GitHub
- Supabase account (only if you need a backend)
- A name for the project
Steps
1. Confirm the stack with the playbook
Before scaffolding, the playbook recommends:
- Framework: Next.js (App Router)
- Language: TypeScript
- Styling: Tailwind CSS + shadcn/ui
- Backend: Supabase (if backend needed) β pinned to same region as Vercel
- Hosting: Vercel
- Linting: ESLint (built into create-next-app)
- Version control: Git + GitHub
Surface any area where youβd deviate (e.g. a different DB if your needs are unusual). For a typical webapp, the playbook defaults are right.
2. Scaffold the project
cd C:\Users\georg
npx create-next-app@latest my-projectPrompts (recommended answers in bold):
- β Would you like to use TypeScript? β Yes
- β Would you like to use ESLint? β Yes
- β Would you like to use Tailwind CSS? β Yes
- β Would you like your code inside a
src/directory? β No (keepsapp/at root for simpler imports) - β Would you like to use App Router? β Yes
- β Would you like to use Turbopack for
next dev? β Yes - β Would you like to customize the import alias (
@/*by default)? β No
The scaffold runs for ~30 seconds.
cd my-project3. Verify the dev server runs
npm run devOpen http://localhost:3000. See the default Next.js page. Kill the server (Ctrl+C).
4. Verify the production build runs
This is the playbookβs non-negotiable check.
npm run buildShould complete without errors. If it errors here on a fresh scaffold, somethingβs wrong with your Node/npm install.
5. Add the playbook files
Create three files at the project root:
CLAUDE.md
# {Project Name} β Claude Code Instructions
## Stack
- Next.js 16 (App Router) + TypeScript
- Tailwind CSS + shadcn/ui
- Supabase (Postgres + Auth + Storage) β region: {your region}
- Vercel hosting β functions pinned to {region}
## Standing rules
- Always run `npm run build` before pushing to main
- Never expose service_role keys to client code or NEXT_PUBLIC_* env vars
- Update PROGRESS.md when shipping a meaningful feature
## Where things live
- Routes: `app/**/page.tsx`
- Components: `components/**`
- Helpers: `lib/**`
- See AGENT_GUIDE.md for the full mapAGENT_GUIDE.md
# Agent Guide β {Project Name}
A map of the project for any AI agent (or human) working on it.
## Routes
| Route | File |
|---|---|
| `/` | `app/page.tsx` |
## Components
- (none yet)
## Database tables
- (none yet)
## Critical files
- `lib/supabase-client.ts` β browser-side Supabase client
- `lib/supabase-server.ts` β server-side Supabase client
- `middleware.ts` β session refresh
## Environment variables
- `NEXT_PUBLIC_SUPABASE_URL`
- `NEXT_PUBLIC_SUPABASE_ANON_KEY`
- `SUPABASE_SERVICE_ROLE_KEY` (server only)
## Common operations
- `npm run dev` β dev server
- `npm run build` β production build
- `npm run lint` β linterPROGRESS.md
# Progress β {Project Name}
Reverse-chronological log of shipped work. Newest at top.
## 2026-06-19 β Project scaffolded
- Created with create-next-app (TypeScript, App Router, Tailwind, ESLint)
- Initial commit
- Pushed to GitHub
- Connected to Vercel
- First deploy successful at {url}6. Initialize Git
Next.js auto-initializes a Git repo, but verify:
git status
# Should show all your filesIf not a repo:
git init
git add .
git commit -m "Initial commit: Next.js scaffold + playbook files"7. Create the GitHub repo
gh repo create my-project --private --source=. --remote=origin
git branch -M main
git push -u origin main(Or use the web UI: create empty repo, follow GitHubβs βpush existingβ instructions.)
8. Deploy to Vercel
- Go to vercel.com/new.
- Import your GitHub repo.
- Framework should auto-detect as Next.js. Defaults are correct.
- Click Deploy. Wait ~90 seconds.
- Live URL:
my-project.vercel.app.
9. Pin Vercel function region (if needed)
If youβll have a Supabase backend in a specific region, pin Vercel functions to match:
Create vercel.json at the project root:
{
"regions": ["syd1"]
}(Replace with your region. See Vercel for region codes.)
Commit and push. Next deploy uses the pin.
10. If you need a backend: set up Supabase
In Vercel Settings β Environment Variables, add:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEY
Redeploy.
11. Install shadcn/ui (optional but recommended)
npx shadcn@latest initChoose your style preferences. shadcn/ui scaffolds components/ui/ and a few utilities. Add components on demand:
npx shadcn@latest add button
npx shadcn@latest add card12. Wire up dark mode (optional)
See How-to: Set up dark mode. Even if you defer it, decide now (itβs much easier early than late).
13. Set up Claude Code memory
If this is a project Claude Code will help with often, consider:
- Adding a project-specific memory file:
~/.claude/.../memory/project_{slug}.md - Pointing it from
MEMORY.md - Saving the Live URL, GitHub repo, local path, hosting region as facts
This makes Claude productive from the next session forward.
14. Commit and push everything
git add .
git commit -m "Add playbook files, Vercel region pin, shadcn/ui"
git pushVerification
- β
npm run devworks - β
npm run buildsucceeds - β
Site is live at
your-project.vercel.app - β Git repo on GitHub
- β Vercel auto-deploys on push
- β
CLAUDE.md,AGENT_GUIDE.md,PROGRESS.mdcommitted
What youβve just built
A new Next.js project with:
- Production stack (TypeScript, Tailwind, App Router, Turbopack)
- Hosted, deployed, on a real URL
- Version control + CI/CD via git push
- Region pinning ready for low latency
- Project hygiene files (AGENT_GUIDE, PROGRESS, CLAUDE.md) from day 1
- Optional: shadcn/ui scaffolded, dark mode ready, Supabase wired up
You can start building features immediately. The next Claude Code session can ground itself in CLAUDE.md and AGENT_GUIDE.md with no re-onboarding.
See also
- Next.js π© π¦
- Vercel π© π¦
- Supabase π© π¦
- ui π₯
- How-to: Set up Supabase π©
- How-to: Connect a custom domain π©
- How-to: Set up dark mode π©
- How-to: Deploy a Next.js app to Vercel π©
- How-to: Set up Claude Code π₯