Q11: What are Route Groups and how are parentheses folders used?

Route Groups use parenthesized folder names like (marketing) or (auth). They allow organizing route files without affecting the URL path structure. Useful for splitting application sub-trees to use different layout wrappers.

Multiple Root Layouts with Route Groups
app/
├── (marketing)/
│   ├── layout.js   # Marketing Layout (with public Header/Footer)
│   └── page.js     # URL: '/'
└── (dashboard)/
    ├── layout.js   # Dashboard Layout (with Sidebar/Auth Check)
    └── page.js     # URL: '/dashboard'
💡 Routes are accessed via / and /dashboard without exposing (marketing) or (dashboard) in URLs.
Key Takeaways
  • Parentheses (group) omit folder names from the final browser URL path.
  • Allows multiple root layouts across separate route groups inside the app folder.
Knowledge Check

What is the resolved URL path for a page located at app/(marketing)/about/page.js?