跳转到内容

Monorepo Structure

此内容尚不支持你的语言。

Product Factory uses a pnpm workspace monorepo with Turborepo for build orchestration.

Workspace Configuration

The workspace is defined in pnpm-workspace.yaml:

packages:
- "packages/*"
- "apps/*"

All packages use the @repo/<name> naming convention and are linked via workspace:* protocol.

Dependency Graph

apps/web ──────────┐
apps/admin ────────┤
apps/platform ─────┤
├── @repo/ui
├── @repo/app-utils ── @repo/shared-types
└── @repo/shared-types
apps/worker-gateway ── @repo/project-core
@repo/shared-types
apps/worker-auth ──── @repo/app-utils
@repo/db-schema
@repo/shared-types
apps/worker-billing ── @repo/billing-core ── @repo/db-schema
@repo/shared-types
apps/worker-ai ────── @repo/ai-core ────── @repo/db-schema
@repo/shared-types
apps/worker-content ── @repo/content-core ── @repo/db-schema
@repo/shared-types
apps/worker-support ── @repo/support-core ── @repo/db-schema
@repo/shared-types
apps/worker-admin ──── @repo/project-core ── @repo/db-schema
@repo/shared-types

Build Pipeline

Turborepo manages task dependencies in turbo.json:

TaskDependenciesOutputs
buildPackage build tasks first (^build)dist/**
devNone (persistent, uncached)
testPackage build tasks first
typecheckPackage build tasks first
lintNone

Package Conventions

  • Type-only packages (shared-types): Export TypeScript types and Zod schemas. No runtime code beyond schema definitions.
  • Core packages (billing-core, content-core, etc.): Export repository classes and domain logic. Take a AppDatabase instance from @repo/db-schema.
  • Legacy packages (auth-core): Kept only for historical tests/reference; runtime auth is implemented in worker-auth.
  • Utility packages (app-utils): Export middleware, helpers, and shared utilities.
  • UI package (ui): Export React components built on Radix UI primitives.