Getting started

Project structure

Where code lives, and why every feature looks the same.

01Layout

The top-level folders of a fresh project:

boilerplate/22 folders · 8 files
  • app/
    • (auth)/
    • (dashboard)/
    • (marketing)/
    • admin/
    • api/
  • features/
    • billing/
      • components/
      • server/
      • pages/
      • config.ts
    • …
  • config/
    • brand.ts
    • fonts.ts
    • modules.ts
    • plans.ts
  • db/
    • migrations/
    • schema.ts
  • emails/
  • lib/
  • scripts/
  • tests/
    • e2e/
    • unit/
  • .agents/
    • skills/
  • AGENTS.md
  • PRODUCT.md
FolderPurpose
appRoutes only. Pages render components from features/*/pages
featuresOne folder per part of the product: components, server code, pages, config
configBrand, fonts, plans and modules: what you change to make it yours
dbschema.ts, the only schema file, and generated migrations
emailsReact Email templates
libValidated env, logger, rate limiting, email sending
scriptssetup, seed, new-feature, db-query, brand-check, sync-agents, e2e-local
testsUnit tests (Vitest) and end-to-end tests (Playwright)
.agents/skillsAgent skills, synced into each tool's folder
AGENTS.mdThe rules your agent reads first
PRODUCT.mdYour product brief: name, voice, pricing, facts agents may state

02Feature folders

Each folder in features/ owns one part of the product: account, admin, ai, analytics, api, audit, auth, billing, flags, jobs, marketing, storage, teams and workspaces.

Files that touch the database, secrets or provider SDKs live in server/ and start with import "server-only". Client components import only browser-safe modules and server actions.

03Personal and team routes

Every page that belongs to a workspace exists twice: app/(dashboard)/dashboard/(personal)/x and app/(dashboard)/dashboard/[team]/x. Both render the same component, which calls workspaceFromParams(params) to know which workspace it is in.