Study guide

Curriculum

Follow the 5 stages in order. Stage 5 ends with Parts 17-18, then pick one specialization track.

Start learning

Stage 1 Stage 1: App Router Foundations

The App Router mental model, file-based routing, layouts, navigation, and metadata — no rendering-model or data-fetching concepts yet. · 4 parts
01Project setup and the App Router mental modelGoal: Scaffold a real Next.js 16 project with create-next-app, understand exactly what next dev, next build and next start each do, read the generated tsconfig.json and next.config.ts instead of guessing at them, and place the App Router against the (no-longer-taught) Pages Router in one paragraph.~4 h02File-based routingGoal: Turn folders into URLs — nested routes, dynamic segments ([id]), catch-all segments ([...slug]), route groups, colocation, and the programmatic notFound() — by building a small storefront route tree inside this course's harness, and know exactly how this differs from the client-side router (React Router) the prerequisite course taught.~5 h03Layouts, templates and navigationGoal: Wrap Apna Bazaar's routes in a shared, persistent layout; learn exactly where template.tsx differs from layout.tsx; reach for route groups a second time, now to scope a layout rather than just to organize files; navigate with next/link, build an active-link nav with usePathname, and know precisely when to reach for useRouter instead of redirect().~5 h04Metadata, fonts and static assetsGoal: Give Apna Bazaar a real <title>/description on every page with the static metadata export and generateMetadata, understand the font setup create-next-app already gave this harness and scope a second font to one section with next/font, serve a real static asset from public/, render it with next/image, and wire up a favicon and an Open Graph image.~4 h

Stage 2 Stage 2: The Rendering Model

Server Components by default, the Client Component boundary, streaming with Suspense, and Next.js's rendering philosophy — then the Recipe Box capstone. · 4 parts
05Server Components by defaultGoal: Understand the single biggest mental shift coming from a client-only React background: every component you write is a Server Component unless you say otherwise. Learn exactly what that buys you (direct, await-based data access, secrets that never leave the server) and exactly what it forbids (hooks, event handlers), by building a real internal "wholesale desk" page for Apna Bazaar that ships zero client-side JavaScript of its own.~5 h06Client Components and the boundaryGoal: Learn exactly how to opt a component into the browser — the "use client" directive — and the three rules that come with it: where the boundary should actually sit, what survives crossing it as a prop, and how a Server Component's own markup can still end up inside a Client Component without ever being imported by it. Built as a real, working mini-cart: an add-to-cart counter with its own quantity state, live inside an otherwise fully server-rendered product page.~6 h07Streaming and SuspenseGoal: Learn how the App Router sends a page before every part of it is ready — a static shell paints first, then slow sections stream in behind <Suspense> boundaries you place on purpose. Build a delivery-partner ops console, Saathi Ops Console, with a live "delayed orders" widget that is genuinely slow, and watch the HTML actually arrive in chunks, not just read about it.~6 h08Next.js's rendering philosophyGoal: Stop thinking of "static" and "dynamic" as a route-level either/or. Next.js draws that line at the component level, and this part proves it with a real IRCTC-style PNR status checker — build a diagrammed trace of exactly which parts of two real pages are static, which are dynamic, and why, backed by the build output and the actual bytes Next.js wrote to disk.~5 hPRecipe BoxStage project — build it after Part 8project

Stage 3 Stage 3: Data, Caching and Mutations

Data fetching in Server Components, caching with Cache Components, revalidation, and Server Actions and forms. · 4 parts
09Data fetching in Server ComponentsGoal: Fetch data the way an async Server Component actually wants it fetched: in parallel instead of a waterfall, deduplicated within one render pass when two parts of a page need the same thing, and with a clean "not found" path — all against a local, simulated-latency data source (never a real network call), so every timing number in this part is reproducible. Built against Mandi Fresh, a Pune-based online grocery marketplace, and its product detail page.~6 h10Caching with Cache ComponentsGoal: Learn Next.js's caching model exactly as this installed version actually behaves, not as an older tutorial describes it — the "use cache" directive, cacheLife profiles, cacheTag, and the sharp line between what gets baked into the static shell and what stays a request-time read. Built on Mandi Fresh's daily stats, an aggregation query standing in for a real "sum today's orders" SQL query that is genuinely expensive to repeat on every request.~7 h11RevalidationGoal: Stop waiting for a cache entry's own cacheLife window and invalidate it on demand instead — revalidatePath for an entire route, revalidateTag for every cache entry carrying a specific tag, and updateTag for the "the user must see their own change right now" case. Built on Udupi Grande, a Koramangala darshini whose menu price and review list are both real, mutable data Part 10 only ever tagged, never invalidated.~6 h12Server Actions and formsGoal: Mutate data the Next.js way — a 'use server' function invoked directly from a <form action={...}>, with no hand-written fetch, no client-side API route, and no JavaScript required for the basic case to work at all. Built on Udupi Grande's review form and its menu's stock toggle — the same running example Part 11 used to invalidate a cache; this part is where the mutation that triggers that invalidation actually gets written.~7 h

Stage 4 Stage 4: Full-Stack Next.js

Route Handlers, middleware and the request pipeline, an auth pattern, and database integration — then the QuickCart capstone. · 4 parts
13Route HandlersGoal: Write a route.ts file under app/api/... and answer, with real requests and real framework behavior (not a guess), the question every full-stack Next.js route eventually asks: is this a Route Handler or a Server Action? Built on the PNR-status universe Parts 8–9 already taught (app/status/[pnr]/page.tsx, app/status/lib/pnr.ts) — this part gives that same lookup a JSON twin, plus a webhook endpoint no browser form ever calls, which is exactly the shape that makes a Route Handler the right tool instead of a Server Action.~6 h14Middleware and the request pipelineGoal: Run code before a request ever reaches a page, scoped to exactly the routes that need it, and use that position to redirect, rewrite, and set cookies/headers upstream of everything Parts 1–13 already built — on the PNR-status universe from Parts 8/9/13, which already has a cookie-reading component (PreferredLanguage) with nothing anywhere setting that cookie. This part is where it finally gets set.~6 h15An auth patternGoal: Build a real, working session-cookie login (not a sketch), protect a route group's layout with it, and prove — with a real reproduced gap, not a warning taken on faith — why the protection has to live in the page itself, not just its layout's nav. Built as a new app/account/ universe: a login form (Part 12's Server Action pattern), a protected (protected)/dashboard route group, and proxy.ts (Part 14) extended with an optimistic check.~6 h16Database integrationGoal: Replace an in-memory JavaScript array with a real, persistent SQLite database, through a small data-access layer the rest of the app never bypasses — called from a Server Component, a Server Action, and a Route Handler alike, and still there after the server itself restarts. Built as Mandi Fresh's guestbook: a better-sqlite3-backed note board visitors can read and post to.~7 hPQuickCartStage project — build it after Part 16project

Stage 5 Stage 5: Production and Specialization

Testing and quality, then deployment and observability — then pick one specialization track. · 2 parts
17Testing and qualityGoal: Install a real Vitest + React Testing Library suite into this harness, test a Server Action and a data-access function for real against the QuickCart capstone's own code, and — just as importantly — hit and honestly document the places this toolchain genuinely cannot reach (an async Server Component, and a module that only works inside Next's own request runtime). Finish by wiring lint, type-check, and test into one local "is this safe to merge" command.~6 h18Deployment and observabilityGoal: Build and run a real production bundle of this harness entirely on this machine — next build, output: "standalone", node .next/standalone/server.js, instrumentation.ts — and be explicit, line by line, about which claims below were actually observed running locally versus documented from the installed Next.js docs without ever deploying anywhere. This part does not deploy to any platform, create any account, or touch any external service — that restriction is deliberate, stated by the person running this content wave, not a limitation this part works around quietly.~6 h

Search the guide