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

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
9

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 1 of 10·Chapter 1 — Getting Started with Next.js 16
Lesson 3 of 54Reading16 min

Project Structure & Conventions Deep Dive

#Project Structure & Conventions Deep Dive¶

Next.js is convention over configuration. Knowing the conventions saves you from reading docs every time you add a feature.

Top-Level Folders¶

FolderPurpose
app/App Router routes, layouts, pages, server logic
public/Static assets served at the URL root
components/(You create) shared React components
lib/(You create) helpers, db clients, server utilities
styles/(You create) CSS files if not co-located

Special Files in app/¶

These file names have superpowers. Every other file is just a regular module.

FilePurposeRuns On
page.tsxRenders the URLServer (default)
layout.tsxWraps a route segment + its childrenServer (default)
template.tsxLike layout but re-mounts on navigationServer
loading.tsxSuspense fallback for the segmentServer
error.tsxError boundary for the segmentClient
global-error.tsxCatches errors in the root layoutClient
not-found.tsxRenders for notFound() callsServer
route.tsHTTP endpoint (GET/POST/...)Server
middleware.tsEdge middleware (project root)Edge runtime

Routing Conventions¶

PatternURLNotes
app/about/page.tsx/aboutStatic segment
app/blog/[slug]/page.tsx/blog/:slugDynamic segment
app/shop/[...path]/page.tsx/shop/*Catch-all
app/shop/[[...path]]/page.tsx/shop & /shop/*Optional catch-all
app/(marketing)/page.tsx/Route group (no URL effect)
app/@modal/page.tsx—Parallel route slot
app/(.)photo/[id]/page.tsxIntercepts /photo/:idIntercepting route
app/_internal/util.ts(none)Underscored → private, never routed

Component Conventions¶

A page.tsx must default-export a React component:

tsx
4 lines
1// app/about/page.tsx
2export default function AboutPage() {
3  return <h1>About</h1>;
4}

A layout.tsx must accept { children }:

tsx
9 lines
1// app/blog/layout.tsx
2export default function BlogLayout({ children }: { children: React.ReactNode }) {
3  return (
4    <div className="grid grid-cols-[200px_1fr]">
5      <Sidebar />
6      <main>{children}</main>
7    </div>
8  );
9}

A route.ts exports HTTP verbs:

ts
4 lines
1// app/api/health/route.ts
2export async function GET() {
3  return Response.json({ status: "ok" });
4}

File Co-location¶

You can place any non-special file inside app/ — components, tests, hooks, CSS. Only files with reserved names participate in routing.

app/ blog/ page.tsx PostCard.tsx ← regular component PostCard.test.tsx ← test (never routed) post-card.module.css

Metadata Files¶

FileResult
favicon.ico (root of app/)Site favicon
opengraph-image.pngOG image for the segment
robots.txt / robots.tsGenerated robots rules
sitemap.xml / sitemap.tsGenerated sitemap
manifest.json / manifest.tsPWA manifest

Drop the file in the right place — Next does the wiring.

A Realistic Folder for a Mid-Size App¶

app/ (marketing)/ layout.tsx page.tsx pricing/page.tsx (app)/ layout.tsx ← requires auth dashboard/ page.tsx loading.tsx courses/ [slug]/ page.tsx @reviews/page.tsx api/ auth/[...nextauth]/route.ts webhooks/stripe/route.ts layout.tsx ← root layout globals.css components/ ui/ ← primitives (button, input, dialog) feature/ ← domain components lib/ auth.ts db.ts validations/ middleware.ts

This structure scales from prototype to 200 KLOC apps without restructuring.

Previous

Installation, CLI & Your First Project

Next

Turbopack — The New Default Bundler

Use ← → arrow keys to navigate between lessons