CodeZettaInterview Hub

Next.js · App Router · Senior · Architecture

As a tech lead, how do you structure a large App Router codebase?

Short Interview Answer

Domain-oriented route segments, shared UI in layouts, clear server/client boundaries, and co-located feature modules.

Detailed Explanation

Prefer feature folders with colocated components/actions/tests. Keep route files thin. Establish conventions for when to use route groups, parallel slots, and shared libraries. Document caching defaults and auth boundaries early — they dominate production incidents. Use `notFound()` plus `not-found.tsx` for expected misses.

Did you know this answer?