CoachnestCoachnest
Sign InGet Started
Back to course

Next.js 16: The Complete Developer Guide

…
—
Contents
1

What's New in Next.js 16

Reading14mFree
2

Installation, CLI & Your First Project

Reading12mFree
3

Project Structure & Conventions Deep Dive

Reading16m
4

Turbopack — The New Default Bundler

Video18m
5

Configuring TypeScript, ESLint & next.config.ts

Reading14m
6

Chapter 1 — Quiz

Quiz10m
7

App Router Fundamentals

Reading16m
8

Dynamic Routes, Catch-Alls & Type-Safe Params

Reading14m

Route Groups & Parallel Routes

Reading16m
10

Intercepting Routes & Modal Patterns

Reading12m
11

Loading, Error & Not-Found UI

Reading12m
12

Chapter 2 — Routing Quiz

Quiz12m
13

Understanding the Server/Client Boundary

Reading18m
14

Choosing When to use "use client"

Reading14m
15

Composing Server & Client Components

Reading14m
16

server-only, client-only & Code Splitting

Reading12m
17

Chapter 3 — Quiz

Quiz10m
18

Fetching Data in Server Components

Reading14m
19

The Next.js 16 Cache Model

Reading16m
20

Revalidation: revalidateTag, revalidatePath & On-Demand

Reading12m
21

Cache Components — Building Reusable Cached Functions

Reading14m
22

Search Params, Cookies & Dynamic APIs

Reading12m
23

Chapter 4 — Quiz

Quiz12m
24

Server Actions From First Principles

Reading16m
25

Forms with useActionState & Progressive Enhancement

Reading14m
26

Optimistic UI with useOptimistic

Reading12m
27

Validation with Zod + Server Actions

Reading12m
28

Chapter 5 — Quiz

Quiz10m
29

Static vs Dynamic vs Streaming

Reading14m
30

generateStaticParams & Pre-Rendering Dynamic Routes

Reading12m
31

Incremental Static Regeneration (ISR)

Reading12m
32

Partial Prerendering (PPR)

Reading16m
33

Edge Runtime vs Node.js Runtime

Reading12m
34

Rendering Strategies Deep Dive

Video22m
35

Chapter 6 — Quiz

Quiz12m
36

Tailwind CSS v4 with Next.js 16

Reading14m
37

CSS Modules, Global Styles & Scoped CSS

Reading10m
38

next/image — Smart, Fast Images

Reading14m
39

Fonts, Icons & Metadata

Reading12m
40

Chapter 7 — Quiz

Quiz10m
41

Middleware Fundamentals

Reading14m
42

Sessions, JWTs & Cookies

Reading16m
43

Protecting Server Components & Server Actions

Reading12m
44

Chapter 8 — Quiz

Quiz10m
45

Prisma with Next.js — The Production Setup

Reading14m
46

Mutations: Server Actions + Database Writes

Reading12m
47

Route Handlers & REST APIs

Reading12m
48

Chapter 9 — Quiz

Quiz10m
49

Unit & Component Testing with Vitest

Reading12m
50

End-to-End Testing with Playwright

Reading14m
51

Deploying to Vercel

Reading12m
52

Self-Hosting with Docker

Reading14m
53

Production Performance Checklist

Reading12m
54

Final Assessment — Next.js 16 Mastery

Quiz20m
←→navigate lessons
Chapter 2 of 10·Chapter 2 — Routing & Navigation with the App Router
Lesson 9 of 54Reading16 min

Route Groups & Parallel Routes

#Route Groups & Parallel Routes¶

Route Groups — Folders Without URLs¶

Wrap a folder name in parentheses: (name). The folder organizes files but does not appear in the URL.

app/ (marketing)/ layout.tsx ← marketing-specific layout page.tsx → / pricing/page.tsx → /pricing blog/page.tsx → /blog (app)/ layout.tsx ← authed layout, separate chrome dashboard/page.tsx → /dashboard settings/page.tsx → /settings

Use cases:

  1. 1Multiple root layouts. Marketing pages vs. authed app — different chrome, different fonts, different metadata.
  2. 2Co-locate by feature. Group (checkout)/cart, (checkout)/payment, (checkout)/confirm.
  3. 3Apply different middleware. Combined with matcher rules in middleware.ts.

Multiple Root Layouts¶

Place layout.tsx directly inside each group and remove the global app/layout.tsx from a top-level role:

tsx
15 lines
1// app/(marketing)/layout.tsx
2import "./globals.css";
3export default function MarketingLayout({ children }: { children: React.ReactNode }) {
4  return (
5    <html lang="en"><body className="font-sans">{children}</body></html>
6  );
7}
8
9// app/(app)/layout.tsx
10import "./globals.css";
11export default function AppLayout({ children }: { children: React.ReactNode }) {
12  return (
13    <html lang="en" className="dark"><body className="font-mono bg-gray-950 text-gray-50">{children}</body></html>
14  );
15}

Each root layout must render <html> and <body> — they are independent.

Parallel Routes — Multiple Pages in One Layout¶

Parallel routes let one layout render multiple slots that navigate independently.

Folder Convention¶

@ prefixes a parallel slot. The layout receives it as a prop.

app/dashboard/ layout.tsx page.tsx @analytics/page.tsx @team/page.tsx
tsx
18 lines
1// app/dashboard/layout.tsx
2export default function DashboardLayout({
3  children,
4  analytics,
5  team,
6}: {
7  children: React.ReactNode;
8  analytics: React.ReactNode;
9  team: React.ReactNode;
10}) {
11  return (
12    <div className="grid grid-cols-3 gap-4">
13      <section>{children}</section>
14      <section>{analytics}</section>
15      <section>{team}</section>
16    </div>
17  );
18}

Why It's Powerful¶

  • Each slot can have its own loading.tsx and error.tsx.
  • The URL stays the same — /dashboard — while slots can be navigated independently.
  • Combine with intercepting routes to build modals.

Default & Conditional Slots¶

If a slot has no matching segment for a URL, Next renders its default.tsx (or null if absent):

tsx
4 lines
1// app/dashboard/@analytics/default.tsx
2export default function Default() {
3  return null;   // no analytics for this URL
4}

Conditional Rendering by User Role¶

tsx
9 lines
1export default async function DashboardLayout({ children, admin, user }) {
2  const me = await getSession();
3  return (
4    <>
5      {children}
6      {me?.role === "ADMIN" ? admin : user}
7    </>
8  );
9}

The unused slot isn't fetched — Next code-splits per slot.

Common Mistakes¶

  • Forgetting default.tsx → the slot 404s on direct URL visits.
  • Using parallel routes when a regular nested layout would do — adds complexity for no benefit.
  • Confusing route groups (name) with parallel routes @name — the first is organizational; the second renders multiple pages.

Previous

Dynamic Routes, Catch-Alls & Type-Safe Params

Next

Intercepting Routes & Modal Patterns

Use ← → arrow keys to navigate between lessons