0
Challenge · 02Setup & the App Router Model
App Router & file-system routing
Routingused in ~100% of apps
There is no router config file in Next.js — your folder tree IS the router. Misread that one rule and you ship a folder you think is a page, hit it in the browser, and get a 404 you can't explain. Every Next.js interview starts here.
Core idea. In the App Router, folders inside `app/` define URL segments, but a segment is only reachable when it contains a `page.tsx`. `page.tsx` makes a route public; `layout.tsx` wraps the routes below it. A folder alone — or a folder with only a layout — renders nothing on its own.
poke it, drag it,
try to break it
try to break it
no slides here.
you drive.
you drive.
Playground, this isn't a screenshot
<Route path="/" element={<Home />} />
Home
Welcome to Pulse. The URL is / so the Home route matched and rendered here.
URL
/
component swaps
0
full page reloads
0
Click a link or type a path and press Go: the URL updates and the matched component swaps in — but the page never reloads. That is client-side routing.
↑ play a little first, then dig in