Skip to main content
reopt Handbook
reopt Handbook
Enterprise Project Architecture

Monorepo Foundation

Monorepo ArchitectureWorkspace DesignShared PackagesTurbo Pipeline

Apps and Delivery

Next.js PatternsVercel DeploymentCI/CD PipelineTesting Strategy

Agents and Operations

Agentic DevelopmentSkills EcosystemSecurity GovernanceMonitoring and Incident

Appendix

TemplatesReferencesUpdatesVerification
Handbook›Enterprise Project Architecture›Monorepo Architecture
한국어English

Monorepo Architecture

Design monorepo boundaries for apps, packages, tooling, and teams.

Key takeaways

  • A monorepo earns its value from easier coordination of shared contracts, builds, ownership, and release workflows, not from co-locating code.
  • The boundary model separates apps, packages, tooling, infrastructure, and docs by purpose.
  • Apps depend on packages, never the reverse; domain packages expose stable APIs rather than internal storage details.
  • An ownership matrix must name who owns each app, who can change shared packages, who approves deployment config, and who resolves cross-app breakage.
  • Watch for red flags: apps importing private files from other apps, shared packages turning into utility dumping grounds, and build scripts relying on local machine state.

A monorepo is not valuable because all code is in one place. It is valuable when shared contracts, builds, ownership, and release workflows become easier to coordinate.

Boundary Model

AreaPurposeTypical contents
AppsDeployable products or servicesWeb apps, docs, admin, workers
PackagesShared reusable codeUI, config, API clients, domain logic
ToolingBuild and developer automationScripts, lint rules, codegen
InfrastructureDeployment and environment definitionsCI config, platform config, IaC
DocsOperating knowledgeArchitecture decisions, runbooks, handbooks

Architecture Principles

  • Apps depend on packages; packages should not depend on apps.
  • Shared packages need owners and compatibility rules.
  • Domain packages should expose stable APIs, not internal storage details.
  • Tooling changes must be reviewed with the same seriousness as application code.
  • Repository structure should make the most common work path obvious.

Ownership Matrix

QuestionRequired answer
Who owns each app?Team or accountable lead
Who can change shared packages?Maintainer group and review rule
Who approves deployment config?Platform or operations owner
Who resolves cross-app breakage?Named escalation path

Red Flags

  • Every app imports private files from another app.
  • Shared packages become dumping grounds for unrelated utilities.
  • Build scripts rely on local machine state.
  • No one knows which team owns a failing package.

Related docs

Verification

A checklist for validating enterprise project architecture and operations.

Shared Packages

Govern reusable packages for UI, contracts, configuration, and domain logic.

Cmd. /apps

Codex Command Master · Browse apps and connectors, then insert app mentions into the prompt.

Scenario: Platform Team

Harness Engineering · Design a harness around invariants, impact analysis, shared modules, release gates, and migration discipline.

Team Workflow Change

Developer Unlearning · How division of labor, review, and communication change when AI participates like a teammate.

Enterprise Project Architecture

A handbook for designing and operating an enterprise Next.js and Turborepo project.

Workspace Design

Define a repository layout and naming system that stays understandable as the project grows.

On this page

Boundary ModelArchitecture PrinciplesOwnership MatrixRed Flags