Architecture tooling for TypeScript

Keep domain boundaries intact.

Catch invalid imports before they merge. Validate the contracts between your domains, without replacing your existing stack.

Boundra checks imports against layer rules, public entry points and the dependency manifest before a change merges.

Rust-powered CLI · TypeScript runtime · Node.js 20+

boundra check-boundaries
Source changeorder/client
domains/order/client/use-order.ts
import { orderService } from
  "@domains/order/server/internal";
order/domain.json"dependsOn": []
Boundary inspectorLayer boundaries
BR-001
BlockedBR-001
AllowedPASS
BR-001
Client cannot import server

Separate client and server code by moving contracts into shared.

Start with two domains.

Keep your existing project. Declare one dependency, then run the checker.

Install and check

The npm package includes a launcher for the native CLI. It downloads and verifies the matching platform binary on first use.

Terminal
pnpm add boundra zod
pnpm exec boundra init --name my-app
pnpm exec boundra create-domain order
pnpm exec boundra create-domain billing
pnpm exec boundra add-dependency billing/order
pnpm exec boundra check-boundaries
Installation and supported platforms

Declare the structure

The CLI generates a manifest and layer directories. Billing can use order's public API because the dependency is declared.

domains/
  order/
    client/
    server/
    shared/
      public.ts
  billing/
    client/
    server/
    shared/
Domain manifest reference

One contract. Both ends.

Define the shape of a request and its result once. Boundra validates both ends of a call using your schemas.

Keep your existing backend and routing. Connect the runtime to a local transport or your own HTTP adapter.

Walk through a working contract
domains/order/shared/contracts/get-order.ts
import { defineQuery } from "boundra";
import { z } from "zod";

export const getOrderQuery = defineQuery({
  name: "get-order",
  input: z.object({ orderId: z.string().min(1) }),
  result: z.object({ orderId: z.string(), status: z.string() }),
});

Make the boundary part of CI.

Add a boundary check to your CI. The CLI produces machine-readable violations and returns a nonzero exit code when checks fail. Keep your typecheck and tests, and require meaningful scan coverage.

CI configuration and exit codes
Terminal
pnpm exec boundra check-boundaries --format json

Documentation

Read the full guides and API references on this site.

View all documentation

Adopt it where boundaries matter.

Use it when domain APIs and dependency directions need to be explicit. It does not replace authorization, routing, persistence, a bundler, or application tests.

Compare adoption options and limitations