Documentation

Private page

Dashboard routes render inside a shared shell, enforce onboarding, and can opt into plan-gated components.

Create the route

Add a folder under `src/app/dashboard`. Each `page.tsx` uses server components so you can query Prisma directly before rendering charts or tables.

Relevant files

  • src/app/dashboard/analytics/page.tsx — Analytics route template

Use the dashboard shell

Wrap content with `DashboardShell` and `DashboardHeader` to inherit spacing, breadcrumbs, and responsive layout.

Relevant files

  • src/components/dashboard/dashboard-shell.tsx — Shell component

Lock it down

Middleware already blocks anonymous traffic and can optionally require a paid plan through `ENABLE_SUBSCRIPTION_ENFORCEMENT`. Use the `FeatureGate` component for fine-grained gating inside the page.

Relevant files

  • src/middleware.ts — Middleware
  • src/components/dashboard/feature-gate.tsx — Feature gate UI