Next.js › Next.js Project Setup & Configuration
How is the folder structure organized differently between the App Router and the Pages Router?
IntermediateAnswer
The App Router uses an app folder where each folder represents a route segment and special files like page.js, layout.js, and loading.js define behavior, while the Pages Router uses a pages folder where each file directly corresponds to a route, with special files like _app.js and _document.js controlling global behavior.
// App Router structure
// app/blog/[slug]/page.js
// Pages Router structure
// pages/blog/[slug].jsReal-world example A team migrating an older project carefully maps their existing pages folder structure to the new app folder conventions, understanding how routes and special files correspond between the two systems.