Next.js cheat sheet
Each entry points at the file in this repo that demonstrates it.
App Router & special files
Folders are routes. Special file names define the UI for each segment.
Server vs Client Components
Components are Server Components by default. Opt in to the client only where you need interactivity.
Data fetching & streaming
Fetch in async Server Components, and wrap slow parts in Suspense so the rest of the page paints immediately.
Server Actions & mutations
Functions marked 'use server' that run on the server and can be passed straight to <form action>.
Parallel & intercepting routes
Render several pages in one layout via @slots, and intercept a navigation to show it in context (modals).
Route Handlers
route.ts files expose HTTP endpoints built on the Web Request/Response APIs.
proxy.ts (formerly middleware)
Code that runs before a request is matched to a route.
Metadata, OG images & SEO files
Co-located, typed metadata APIs and file conventions.
Caching in Next 16 (not enabled here)
Next 16 makes caching opt-in with Cache Components and the use cache directive.