App Router (app/)
Routes are directories containing a page.tsx/page.jsx/page.ts. Walk app/ recursively:
app/page.tsx→/app/billing/page.tsx→/billingapp/(group)/settings/page.tsx→/settings— route groups(name)add no path segmentapp/blog/[slug]/page.tsx→/blog/[slug]— dynamic segment; substitute a real sample value for the render (/blog/hello-world)app/@modal/…,app/…/layout.tsx,loading.tsx,error.tsx,template.tsx,default.tsx→ not routes;layout.tsxis shared chrome — include it understyles/componentsfor every child routeapp/api/,route.ts→ API endpoints, skip
export const metadata = { title } or generateMetadata in page.tsx/layout.tsx; fall back to the directory name.
Source: the page.tsx file verbatim, plus imported local components under components.
Pages Router (pages/)
pages/index.tsx→/,pages/about.tsx→/about,pages/blog/[slug].tsx→/blog/[slug]pages/api/→ skip,pages/_app.tsxandpages/_document.tsx→ shared chrome, include as styles/componentsgetServerSideProps/getStaticPropsdata fetching lives in the same file — source already captures it
Shared styles
Always includeapp/globals.css (or styles/globals.css), tailwind.config.*, app/layout.tsx, app/(group)/layout.tsx files covering the route, and any theme/design-token module.