Route Groups
Separate layouts for marketing, auth, and dashboard areas.
Route groups in Next.js use parenthesized folder names (group) to organize routes without affecting the URL path.
(marketing)
Public-facing pages with a marketing header and footer.
Layout:
- Fetches session via
auth()for optional user context - Wraps children with
NextAuthSesionProviderandSessionErrorHandler - Renders marketing
Header+Footer
Pages:
| Route | Component | Description |
|---|---|---|
/ | Home | Hero, features, stack, CTA sections |
/pricing | Pricing | The paid plans, monthly or yearly; buttons go to the workspace's Billing page (signed in) or sign-up |
/features | Features | Product feature showcase |
/about | About | Company/product information |
/faq | FAQ | Frequently asked questions |
/contact-us | Contact | Contact form (sends via SendGrid) |
/blog | Blog | Blog listing from content-collections |
/blog/[...slug] | BlogPost | MDX blog post rendering |
/privacy-policy | Privacy | Privacy policy (static) |
/terms-and-conditions | Terms | Terms of service (static) |
/cookie-policy | Cookies | Cookie policy (static) |
(auth)
Minimal layout for authentication flows — no marketing header/footer.
Pages:
| Route | Component | Description |
|---|---|---|
/login | UserLoginForm | Email + password login |
/register | UserRegisterForm | Account creation |
/reset-password | PasswordResetForm | Request password reset |
/confirm-password-reset/[uid]/[token] | ConfirmPasswordResetForm | Set new password |
/reset-username | UsernameResetForm | Request an email change |
/confirm-username-reset/[uid]/[token] | ConfirmUsernameResetForm | Choose the new email; a link is sent to it |
/confirm-email-change/[token] | ConfirmEmailChangeForm | Opened from the new address; makes the change |
/user-activation/[uid]/[token] | UserActivationForm | Email verification |
/resend-activation | ResendActivationForm | Resend activation email |
(dashboard)
Protected area requiring authentication. proxy.ts sends signed-out visits to /login, and the layouts check the session again.
Top-level routes:
| Route | Description |
|---|---|
/dashboard | Opens the workspace used last (a last_workspace cookie), else the first; with none, a page to create one |
/dashboard/billing, /dashboard/profile, /dashboard/settings | Redirect to that settings page in the workspace used last, for links that don't name a workspace |
Workspace Pages (workspaces/[workspaceId]/)
The workspace layout loads the user, their workspaces and the workspace's plan once per request (lib/workspaces/shell.ts, wrapped in React's cache()), and gives them to every page and the sidebar through WorkspaceProvider (useWorkspace()).
| Route | Description |
|---|---|
.../[workspaceId] | Workspace home: members, teams, chats and documents, recent chats, knowledge bases |
.../chat | New chat |
.../chat/history | Chat list |
.../chat/[chatId] | A chat |
.../documents, .../documents/[docId]/view | Documents and the viewer |
.../knowledge-bases, .../knowledge-bases/[kbId] | Knowledge bases |
.../teams, .../teams/[teamId] | Teams |
Settings ([workspaceId]/settings/)
Opening any settings page switches the sidebar to the settings menu. /settings itself redirects to General.
| Route | Section | Description |
|---|---|---|
.../settings/profile | Account | Your name; changing your email |
.../settings/security | Account | Changing your password; deleting your account |
.../settings/general | Workspace | Name and details; archive, transfer ownership, leave, delete |
.../settings/members | Workspace | Invite people, roles, removing members, pending invitations |
.../settings/billing | Workspace | Plan, usage and credit, upgrading, the billing portal. See Billing |
Account pages sit under a workspace's URL so the sidebar and its "Back to" link keep their place; they're the same whichever workspace you open them from.
Older URLs (/workspaces, /dashboard/workspaces, .../details, /success, /cancel) redirect to their new place in next.config.ts.
(invitations)
Invitation acceptance at /invitations/accept/[invitationId].
Shows login form if unauthenticated, or invitation details if authenticated.
(chats)
Public shareable chat sessions at /chats/[workspaceId]/[shareableLink].
No authentication required — fetches the shared session via public API.