Project structure
Where every application surface, shared package, migration, and operational boundary lives.
Every workspace owns one clear concern. Shared packages keep wire shapes, UI primitives, billing adapters, and email templates consistent across applications.
apps/
web/ React 19 product SPA (Vite+, React Router, TanStack Query)
server/ Bun + Hono API, SQL migrations, domains, and Better Auth
start/ TanStack Start full-stack edition (Cloudflare Workers + D1, optional)
mobile/ Expo SDK 58 native client (iOS & Android, optional)
site/ Static Astro 7 marketing site (Cloudflare Workers Static Assets)
docs/ Fumadocs + Next.js documentation site
packages/
contracts/ Shared Zod v4 schemas and inferred types
billing/ Provider-neutral billing contract and Polar, Stripe, Dodo, RevenueCat adapters
ui/ Shared design tokens, CSS Modules, and Zag.js React primitives
email/ React Email source templates and HTML export script
create-app/ Buyer scaffold, scope/brand rewrite, and environment generator
tsconfig/ Shared TypeScript 7 compiler policy
docs/ Canonical product docs, ADRs, and state machines
infra/ OpenTofu bootstrap, AWS/GCP modules, roots, locks, and mocked tests
scripts/ Deployment, release, image-proof, and toolchain verification scripts
.github/ CI, cloud deployment, and source release workflows
turbo.json Persistent root development-task lifecycle and database prerequisiteThe studio source checkout also contains a private internal/ directory (internal/landing/,
internal/operations/, internal/docs/, internal/delivery/, internal/release/). It is outside
the root workspace, excluded from generated buyer repositories, and never an application runtime
dependency.
Domain ownership
Each server domain follows the same routes.ts -> service.ts -> repository.ts path. Routes map
HTTP, session, and organization context, services own policy and transactions, and repositories own
parameterized SQL. Clients consume the shared contracts and typed Hono RPC client rather than
recreating API types by hand.
Use this structure as a map, not a restriction on product language. Add product-specific capability inside its own domain and module instead of folding it into generic files.
Keep the flow directional
Contracts describe the wire format. Routes map HTTP and tenancy context. Services own policy. Repositories own SQL. That separation makes ownership and failure behavior discoverable for people and coding agents.
Read Architecture for boundaries and production topology, or jump to First feature for the extension workflow.