Skip to content
C.W.K.
Stream
Lesson 02 of 08 · published

What Next.js Provides

~22 min · conventions, Turbopack, App Router, RSC

Level 0Curious
0 XP0/68 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

The convention list, in one place

Every problem React leaves open, Next.js answers with a convention. Memorize the table once and you stop rediscovering it later:

ProblemConvention
RoutingFile-system: a folder with page.tsx = a route
Layoutslayout.tsx per segment, persists across navigation
Loading stateloading.tsx, wired into Suspense automatically
Errorserror.tsx per segment, global-error.tsx at root
API endpointsroute.ts handlers (GET/POST/…)
Server dataasync Server Components, fetch directly
MutationsServer Actions ('use server')
BundlingTurbopack (Rust) — default since v16
Images / fonts / scriptsnext/image, next/font, next/script
Production servernext start — Node anywhere, or self-host edge

The shape of a starter

The CLI sets the defaults you'll inherit for everything else: TypeScript on, ESLint on, App Router on, Turbopack on, Tailwind optional, src/ optional, import alias @/*.

Why it's worth learning the table

Most Next.js confusion comes from skipping the convention list and reaching for a third-party package that already exists in the box. Look at the table first; if it's there, prefer the built-in.

Before adding a package, name the responsibility and check whether Next.js already owns it through a file convention or built-in API. Prefer the built-in path when it satisfies the requirement and shares the same routing, caching, and server-component assumptions.

Built in does not mean universally sufficient. A specialized requirement may justify another library, but that choice should identify the capability gained and the new upgrade, failure, and deployment contracts introduced. Choose one feature and implement or diagram both the built-in and external-package paths. Record where routing, loading, errors, caching, and deployment are configured, and explain why the extra contract is worth keeping.

Code

Bootstrap a current Next.js project·bash
npx create-next-app@latest cwk-app
cd cwk-app
# Pick: TypeScript yes, ESLint yes, Tailwind yes (or no), App Router yes,
# Turbopack yes, src/ no, import alias '@/*'.
npm run dev
# Dev server on http://localhost:3000 with Turbopack HMR
Inspect the install·bash
tree -L 2 -I node_modules
# .
# ├── app/
# │   ├── layout.tsx
# │   ├── page.tsx
# │   └── globals.css
# ├── public/
# ├── next.config.ts
# ├── package.json
# └── tsconfig.json

External links

Exercise

Run npx create-next-app@latest and produce a one-page summary: what files were created, which file is the entry route, and which file is the root layout. Note which prompts you accepted defaults for and why.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.