Course map
Stage 1: App Router Foundations
Stage 2: The Rendering Model
Stage 3: Data, Caching and Mutations
Stage 4: Full-Stack Next.js
Stage 5: Production and Specialization

Part 03 / Topic 7 of 7

Putting it together: the generated route types, again

Part 2 section 9 read AppRoutes once, after Apna Bazaar's first six routes existed. Re-reading it now, after this part's changes — a new layout, two scoped group layouts, a layout/template pair, and one new dynamic route — shows exactly what did and didn't change:

$ grep "^type AppRoutes" harness/.next/types/routes.d.ts
type AppRoutes = "/" | "/store" | "/store/about" | "/store/contact" | "/store/go/[id]" | "/store/products" | "/store/products/[id]" | "/store/search/[...terms]"

Every route from Part 2 is still listed, unchanged, even though every storefront page physically moved into (shop)/ — route groups are as invisible to this generated type as they are to the browser's URL bar. The one addition, /store/go/[id], is section 6's redirect route. Nothing about layout.tsx or template.tsx appears here at all — AppRoutes only ever lists page.tsx/route.ts locations, because only those files are reachable URLs; layouts and templates wrap routes, they are never routes themselves.

Done here? The practice set for Part 3 — including the solutions — is on the part page.

Search the guide