Codebase Overview
Monorepo architecture with dual Next.js apps, shared packages, and Convex backend.
The StarterApp codebase uses a monorepo architecture managed by Turborepo and pnpm workspaces. Applications, packages, and backend functions reside in a single repository with consistent tooling and type safety across boundaries.
AI-First Structure
The monorepo organization enables AI agents to access all code context simultaneously. File boundaries, import patterns, and template references remain visible within single repository context.
Repository Structure
The repository organizes code into distinct categories:
Core Applications
Marketing App
Public-facing site with static CSP, ISR support, and marketing routes on port 3000.
Dashboard App
Authenticated application with nonce-based CSP, real-time features on port 3001.
Documentation Site
Fumadocs-powered documentation with MDX support on port 3100.
Shared Packages
Workspace packages provide reusable functionality:
app-shell
Shared authentication, hooks, components, and test utilities for both applications.
auth
BetterAuth integration with Convex adapter and session management.
billing
UseAutumn integration with Stripe for subscriptions and feature gating.
ui
Radix UI components with Tailwind styling and design system tokens.
Convex Backend
Backend functions and schema definitions:
Import Patterns
Three import styles organize dependencies:
Development Workflow
Standard commands for monorepo development:
# Start all applications
pnpm dev
# Start specific app
pnpm --filter marketing dev
pnpm --filter dashboard dev
# Build all packages and apps
pnpm build
# Run validation pipeline
pnpm validate
Turborepo orchestrates builds with caching. Changes to shared packages trigger dependent application rebuilds automatically.