Skip to content

contract-kit

Ship Angular + backend APIs from one contract

Single-source contract workflow to generate typed clients, backend-safe wiring, and compatibility checks before release.

PROBLEM

Current pain point

Frontend and backend drift over time

Teams duplicate DTOs, clients, and endpoint assumptions in multiple layers.

SOLUTION

Recommended approach

Contract-first generation

Define endpoints once and generate artifacts to keep your stack aligned.

STATUS

Current project stage

Runnable MVP already available

Current release includes CLI init, generate, and compatibility check flow.

What You Get

CLI

Automation-ready commands

Commands to initialize projects, generate artifacts, and check breaking changes.

CORE

Deterministic contract engine

Strict schema validation and deterministic endpoint summary generation.

ROADMAP

Next delivery track

Angular generator and backend plugin layers under active development.

How It Works

From contract to release-safe integration in four practical steps.

Define your contract

Create endpoint definitions in contracts/*.contract.json with request and response shapes.

$pnpm ckit:init

Generate typed artifacts

Produce deterministic models and helper outputs from the contract source.

$pnpm ckit:generate

Wire Angular + backend

Connect generated outputs in Angular clients and backend handlers to keep both sides aligned.

Check compatibility before release

Run contract diff checks to detect breaking API changes early in CI.

$pnpm ckit:check
Input contract

Minimal contract example

Single source of truth: this file defines one endpoint and its typed response.

contracts/users.contract.json
json
{
  "service": "users",
  "endpoints": [{
    "path": "/users/:id",
    "method": "GET",
    "response": { "200": { "id": "string", "email": "string" } }
  }]
}

Release checklist

  • Schema stays valid and deterministic.
  • Generated outputs are in sync with the contract.
  • No breaking changes without intentional version bump.

Core commands

$pnpm ckit:init
$pnpm ckit:generate
$pnpm ckit:check

See it in action

Define one contract file. Run one command. Get typed Angular client, NestJS controller, and Zod schemas — all from a single source of truth.

Why this matters in real teams

  • Eliminates duplicated DTO and endpoint definitions across frontend/backend.
  • Reduces release risk by making API changes explicit and checkable.
  • Keeps generated artifacts deterministic so reviews and CI stay reliable.

What you actually get after generate

  • Core summary + canonical contract model from @fr4n0m/core.
  • TypeScript model output from @fr4n0m/generator-typescript.
  • Angular client from @fr4n0m/generator-angular-client.
  • NestJS scaffolding from @fr4n0m/plugin-nestjs.
  • Zod runtime schemas from @fr4n0m/validator-zod.
  • Deterministic mocks from @fr4n0m/mock-generator.
  • Compatibility diff report from @fr4n0m/contract-diff.
  • Executable end-to-end CLI workflow from @fr4n0m/contract-kit.
bash
$