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-typesBuild Pipeline
Turborepo manages task dependencies in turbo.json:
| Task | Dependencies | Outputs |
|---|---|---|
build | Package build tasks first (^build) | dist/** |
dev | None (persistent, uncached) | — |
test | Package build tasks first | — |
typecheck | Package build tasks first | — |
lint | None | — |
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 aAppDatabaseinstance from@repo/db-schema. - Legacy packages (
auth-core): Kept only for historical tests/reference; runtime auth is implemented inworker-auth. - Utility packages (
app-utils): Export middleware, helpers, and shared utilities. - UI package (
ui): Export React components built on Radix UI primitives.