What is Next.js and how does its file-based routing system work in the App Router?
expand_more
app/ directory automatically becomes a URL path segment. Special files are used: page.tsx defines the UI at that route, layout.tsx defines a shared persistent wrapper, loading.tsx defines a fallback UI using Suspense, and error.tsx acts as an error boundary. Dynamic routes use brackets: app/blog/[id]/page.tsx maps to /blog/123, passing the parameter to page props.