← Next.js learning path
Next.js · Module 2 of 10

App Router and file routing

Folders inside app/ become URLs.

📖 Key ideas

  1. app/page.tsx is the home page /.
  2. app/about/page.tsx becomes /about.
  3. layout.tsx wraps pages and keeps shared UI.
  4. Dynamic routes: app/blog/[slug]/page.tsx.
  5. Special files: loading.tsx, error.tsx, not-found.tsx.
💡 Real-life example: File routing is like folders in a cabinet: the folder name is the label people use to find it.
page.tsxMakes a route publicly accessible
layout.tsxShared UI wrapper
[slug]Dynamic route segment
not-found.tsxCustom 404 UI