Each page
What every page shows, where its data comes from, and the changes people
make most often. Page files live in src/screens/. Every page handles loading, empty and error. Add ?empty=1 or
?error=1 to its address to see them.
Dashboards
Analytics: / · dashboards/analytics.tsx
Website traffic for a chosen period.
| Part | Data | Notes |
|---|---|---|
| Period menu + 7D / 30D / 90D / 12M | getTraffic(range) |
Both controls change the whole page |
| Visitors, Sessions, Conversion, Avg. session | traffic.totals vs previousTotals |
Each compares with the period just before |
| Traffic overview | traffic.current + previous |
Dashed line = previous period |
| Traffic sources | getBreakdowns().sources |
Shares × this period's visitors |
| Top pages | getBreakdowns().pages |
Shares × this period's page views |
| Visitors by country | getBreakdowns().countries |
|
| Live now | getLiveVisitors() |
Refreshes every 5 seconds (refetchInterval) |
| Export | downloadCsv() |
Daily rows for the chosen period |
Change the periods: edit RANGES at the top of the file. A period's
days must be one that getTraffic supports, or extend TrafficRange in
the API.
Change the live refresh rate: refetchInterval: 5000 in LiveNow.
Remove it for a static number.
Connect your analytics: replace getTraffic, getBreakdowns and
getLiveVisitors in data/api/analytics.ts with calls to your tool's API
(Plausible, PostHog, Google Analytics Data API…). Keep the return shapes.
eCommerce: /dashboards/ecommerce · dashboards/ecommerce.tsx
| Part | Data | Notes |
|---|---|---|
| Revenue, Orders, Avg. order, Refunds | getSalesSummary() |
This month so far vs the same days last month. Refunds: down is good |
| Revenue chart | getMonthlySales() |
Store vs marketplace, 12 months |
| Monthly target | getSalesSummary() + MONTHLY_TARGET |
|
| Recent orders | getRecentOrders(6) |
Newest first |
| Top products | getTopProducts(5) |
By units sold, last 30 days |
| Export | downloadCsv() |
Revenue by month |
Change the monthly goal: MONTHLY_TARGET at the top of the file. It's
in minor units: 100_000_00 = $100,000.
Order status colours: ORDER_TONE maps each status to a pill tone.
CRM: /dashboards/crm · dashboards/crm.tsx
| Part | Data | Notes |
|---|---|---|
| Open deals, Pipeline value, Win rate, Avg. deal cycle | getCrmSummary() |
Win rate and cycle compare the last 90 days with the 90 before |
| Sales pipeline | getPipeline() |
Count / Value switch; each stage counts deals that reached it |
| Activity | getTeamActivity() |
|
| Deals closing soon | getClosingDeals(6) |
Open deals past "lead", soonest close date first |
| Leads by source | getLeadSources() |
The top source is highlighted |
Rename stages: STAGE_LABEL. Stage colours: STAGE_COLOR (funnel)
and STAGE_TONE (pills). To add a stage, add it to DealStage in
data/types.ts and to PIPELINE_STAGES in data/api/crm.ts.
Projects: /dashboards/projects · dashboards/projects.tsx
| Part | Data | Notes |
|---|---|---|
| Project cards | getProjects() |
Progress = done ÷ all tasks |
| Tasks completed | getTaskWeeks(8) |
Completed vs created, per week |
| Upcoming deadlines | getUpcomingDeadlines(7) |
Open tasks due in the next 7 days |
| Team workload | getWorkload() |
Open tasks per person; bars turn amber, then red, as people get busier |
| Time tracked | getTimeTracked() |
Team / Me switch; today is highlighted |
Status labels: STATUS maps on_track, at_risk, planning and done
to a label and colour.
"Me" in Time tracked uses the signed-in user. Until you connect sign-in,
that's the sample user u_001 (Maya). Replace it with your auth user's id.
Pages
All of these live in pages/pages/. Text that you will want to rewrite
(plans, questions, milestones) is kept in data/content/, so you can edit
the words without touching the layout.
Settings: /settings · pages/settings.tsx
Nine tabs. The open tab is in the address (/settings?tab=billing), so you
can link straight to one. Each tab is its own file in pages/settings/.
Tab (?tab=) |
File | Data |
|---|---|---|
profile |
profile.tsx |
getProfile, saveProfile. Photo up to 5 MB |
account |
account.tsx |
Email, language, time zone, delete account |
notifications |
notifications.tsx |
getNotificationPrefs, saveNotificationPrefs (in-app, email, push) |
billing |
billing.tsx |
getBilling, setDefaultPaymentMethod, removePaymentMethod |
team |
team.tsx |
getTeam; "Manage members" opens the Users app |
appearance |
appearance.tsx |
The same controls as the theme drawer, saved in this browser |
security |
security.tsx |
getSecurity, changePassword, setTwoStep, endSessions |
api-keys |
api-keys.tsx |
getApiKeys, createApiKey (shows the secret once), revokeApiKey |
integrations |
integrations.tsx |
getIntegrations, setIntegration |
Forms show a "You have unsaved changes" bar with Cancel and Save, and a
toast when saved. Add a tab: write a component in pages/settings/ and
add { id, label, icon, render } to SETTINGS_TABS. Remove a tab:
delete its line. Try a wrong password: type wrong as the current
password to see the error.
Pricing: /pricing · pages/pricing.tsx
Everything on the page comes from data/content/pricing.ts:
| Export | What to edit |
|---|---|
PLANS |
name, description, monthly and yearly (per seat per month, in cents), features, cta, popular flag |
COMPARE |
One row per feature; values is keyed by plan id: true, false or text such as "50 GB" |
TRUST |
The short line of promises under the plans |
The "Save 20%" badge is worked out from the biggest monthly/yearly gap. The
page opens on Yearly; change useState(true) to false to open on Monthly.
Prices animate when you switch (off when motion is off).
FAQ: /faq · pages/faq.tsx
Questions and categories are in data/content/faq.ts: FAQ_CATEGORIES
(id, label, icon) and FAQ (category, q, a). Answers support
**bold** and [links](/settings?tab=billing). Search looks through
questions and answers. The "Still stuck?" card links to your docs at
siteConfig.url + "/docs".
Notifications: /notifications · pages/notifications.tsx
Uses getNotifications and markNotificationsRead(ids), the same data as
the bell in the top bar, so reading one here clears it there too. Tabs: All,
Unread, Mentions, Invites, System. Grouped by Today, Yesterday and date.
Invites can be accepted or declined in place. The gear opens
/settings?tab=notifications.
Search: /search?q=… · pages/search.tsx
Searches pages (from the sidebar), people, deals, invoices, mail, files and
tasks at once with searchAll(q) and shows up to 8 of each, with the match
highlighted. The sidebar filters by type. When nothing matches, it offers
the closest spelling ("Did you mean northwind?"). The command menu (⌘K)
opens this page from its "Search everything for …" item.
Connect real search: replace the body of searchAll in
data/api/search.ts with a call to your search service (Algolia, Typesense,
Meilisearch, Postgres full-text). Keep the return shape and the page works
unchanged.
Timeline: /timeline · pages/timeline.tsx
Milestones are in data/content/timeline.ts (date, kind release or
company, title, text, icon). They're grouped by month, newest first,
and fade in as you scroll.
Empty states: /empty-states · pages/empty-states.tsx
All eight empty-state pictures with the copy used across the apps, plus the small version for inside cards. Copy one into your page:
<EmptyState
illustration="orders" // orders, search, inbox, files, chart, error, people, calendar
title="No orders yet"
description="When customers buy from your store, their orders show up here."
action={<Button>Add a product</Button>}
compact // smaller, for inside a card
/>
You can also pass your own picture: illustration={<img src="…" alt="" />}.
Blank: /blank · pages/blank.tsx
A page with only the header and one card. Copy it to start a new page, then follow Add a page.
Errors
Full-screen pages with no sidebar. They share errors/frame.tsx (logo,
centred column, footer with status and support links).
404: any unknown URL · errors/not-found.tsx
Shown automatically for addresses that don't exist (and at /errors/404 so
you can look at it). It has a search box (goes to /search?q=…), "Go back",
"Dashboard" and a few popular links. Edit POPULAR at the top of the file to
point at your busiest pages.
500: /errors/500 · errors/server-error.tsx (screen in server-error-screen.tsx)
The same screen appears inside the app when a page crashes, with the sidebar still there and "Try again" re-rendering the page:
- Next.js:
app/(app)/error.tsx - Vite: the
errorElementinsrc/router.tsx
Both log the error with console.error. Send it to your error tracker
(Sentry, Bugsnag, …) there. The request ID is Next.js's error.digest when
there is one (it matches your server logs), otherwise a random ID people can
quote to support. "Contact support" emails siteConfig.support.email with
the ID in the subject.
Maintenance: /maintenance · errors/maintenance.tsx
Words and numbers come from site.config.ts:
maintenance: {
until: "2026-12-01T22:00:00Z", // countdown to this time; null hides it
task: "Database upgrade", // label above the progress bar
progress: 68, // 0–100; null hides the bar
},
"Notify me" shows a confirmation. Connect it to your mailing list or status
page subscribers in NotifyMe at the bottom of the file.
Send everyone to this page during maintenance (Next.js): add
proxy.ts (next to app/):
import { NextResponse, type NextRequest } from "next/server"
export function proxy(request: NextRequest) {
if (process.env.MAINTENANCE !== "1") return
if (request.nextUrl.pathname === "/maintenance") return
return NextResponse.rewrite(new URL("/maintenance", request.url))
}
export const config = { matcher: ["/((?!_next|favicon|icon|.*\\..*).*)"] }
Then set MAINTENANCE=1 in your host's environment variables and redeploy.
Remove it (or set it to 0) to come back. If you already have a proxy.ts
for sign-in, add the check at the top of that one. Vite: use your host's
redirect rules (for example _redirects on Netlify or vercel.json
rewrites) to send every path to /maintenance.