HyperSaaS
FrontendRouting

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 NextAuthSesionProvider and SessionErrorHandler
  • Renders marketing Header + Footer

Pages:

RouteComponentDescription
/HomeHero, features, stack, CTA sections
/pricingPricing3-tier pricing with Stripe checkout
/featuresFeaturesProduct feature showcase
/aboutAboutCompany/product information
/faqFAQFrequently asked questions
/contact-usContactContact form (sends via SendGrid)
/blogBlogBlog listing from content-collections
/blog/[...slug]BlogPostMDX blog post rendering
/privacy-policyPrivacyPrivacy policy (static)
/terms-and-conditionsTermsTerms of service (static)
/cookie-policyCookiesCookie policy (static)

Subscription sub-group (subscriptions)/:

RouteDescription
/successStripe checkout success redirect
/cancelStripe checkout cancel redirect

(auth)

Minimal layout for authentication flows — no marketing header/footer.

Pages:

RouteComponentDescription
/loginUserLoginFormEmail + password login
/registerUserRegisterFormAccount creation
/reset-passwordPasswordResetFormRequest password reset
/confirm-password-reset/[uid]/[token]ConfirmPasswordResetFormSet new password
/reset-usernameUsernameResetFormRequest username reset
/confirm-username-reset/[uid]/[token]ConfirmUsernameResetFormSet new username
/user-activation/[uid]/[token]UserActivationFormEmail verification
/resend-activationResendActivationFormResend activation email

(dashboard)

Protected area requiring authentication. Contains the main application UI.

Layout: Minimal wrapper — auth enforcement happens in the workspace layout below.

Top-level pages:

RouteDescription
/dashboardWorkspace list (redirects if no workspaces)
/dashboard/profileUser profile settings
/dashboard/settingsAccount settings

Workspace Pages ([workspaceId]/)

The workspace layout enforces authentication and provides the sidebar shell.

RouteData FetchedDescription
.../[workspaceId]User, workspaces, metricsWorkspace home with stats
.../detailsUser, workspaces, invitations, permissionsWorkspace settings & members
.../chatUser, workspaceNew chat creation
.../chat/historyUser, workspace, sessionsChat session list
.../chat/[chatId]User, chat sessionActive chat with AI
.../documentsUser, workspace, documentsDocument list
.../documents/[docId]/viewUser, workspaceDocument viewer (PDF)
.../knowledge-basesUser, workspace, KBsKnowledge base list
.../knowledge-bases/[kbId]User, workspace, KB, documentsKB detail + documents
.../teamsUser, workspace, permissionsTeam list
.../teams/[teamId]User, workspace, team, permissionsTeam detail + members
.../settingsUser, workspace, subscriptionWorkspace subscription

(workspaces)

Standalone workspace list page at /workspaces.

(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.

On this page