Architecture

1. Workspace Layout

apps/
  web/
  admin/

examples/
  order-billing/
    domains/
    src/

domains/
  [<group>/...]
    <domain>/
      domain.json
      client/
      server/
      shared/
      mcp/
      tests/

packages/
  runtime/
  ui/
  infra/
  config/
  tooling/

crates/
  core/
  parser/
  rules/
  cli/

apps/ contains deployable product entry points owned by the repository. examples/ contains self-contained learning and framework-verification projects. An example must keep its own Boundra config, TypeScript config, and domains so it can be checked through an explicit --root without treating the framework repository itself as an application.

Domain manifests are discovered recursively below paths.domains. Optional group directories organize the filesystem but do not become part of domain identity; the manifest name remains the stable identity. See ADR 0011.

2. Domain Layers

  • client/: UI, hooks, browser-side orchestration
  • server/: API handlers, business rules, data orchestration
  • shared/: schema, DTO, contract, pure utilities
  • mcp/: AI adapter layer (tool/resource/prompt)
  • tests/: 도메인 테스트 (unit/integration)

3. Dependency Direction

허용:

  • client -> shared
  • server -> shared
  • domain -> other-domain public API
  • domain -> declared dependency public API

금지:

  • client -> server
  • server -> client
  • shared -> policy-denied capability (기본 ui, database, runtime)
  • domain -> other-domain internal path
  • domain -> undeclared domain public API
  • cyclic domain dependency graphs

4. Runtime and Tooling

  • 사용자 레벨: TypeScript
  • 코어 엔진: Rust
  • 브릿지: NAPI-RS (future candidate)
  • 빌드/분석: Rust analyzer CLI first; TypeScript build integration later
  • 모노레포: pnpm (초기), Nx는 선택적 도입
  • 프레임워크 표면: docs/framework-surface.md를 따른다.

5. Core Crates Responsibility

  • core: project config, domain manifest, shared diagnostic/domain types
  • parser: workspace file scanning and import extraction
  • rules: boundary validation
  • cli: command parsing, execution, graph output, and code generation

6. Package Responsibility

  • packages/runtime: pure TypeScript helper types used by generated contracts
  • packages/ui: framework-neutral browser rendering for normalized Boundra diagnostics; published through the single boundra/ui npm subpath
  • packages/config: TypeScript authoring types for the currently supported Boundra project config; published through boundra/config while native config discovery remains boundra.config.json

7. Expansion Strategy

MCP는 v3 이후 domains/<domain>/mcp에서 확장하며, 코어 로직과 분리한다.

확장 DSL은 실제 dogfooding 이후 검토한다. 코어 확장은 Lua보다 Starlark를 우선 후보로 둔다.