The more the community invests in a bridge, the more powerful the tool becomes“DomainCraft” is a working title
DomainCraft
Open source · Domain-driven code generator

Describe your domain once in YAML. Ship a production backend in any language.

DomainCraft turns a single domain.yaml into fully working code — CRUD, auth, permissions, migrations, admin. Deterministic output, compiles clean, safe to regenerate.

Download binaryWindows · macOS · Linux · ARM64
domaincraft generate
project:
  name: MyShop
database: postgresql

auth:
  type: jwt
  entity: User
  roles: [Admin, User]

entities:
  User:
    fields:
      id: uuid [primary]
      email: string [email, unique]
      password: string [hidden]
  Product:
    features: [audit, soft_delete]
    fields:
      id: uuid [primary]
      title: string [required, min:3]
      price: decimal [required, gte:0]
    permissions:
      read: ["*"]
      create: [Admin]

The stack it ships with

  • Go core
  • ASP.NET Core
  • EF Core
  • PostgreSQL
  • Dapr
  • Docker

The problem

Every project starts with the same boring boilerplate.

CRUD endpoints, repositories, DTOs, migrations, auth wiring, validation, permissions — days of repetitive work that is error-prone and tedious.

Traditional approach
With DomainCraft
×

Write 50+ files per entity by hand

Define 1 entity in ~10 lines of YAML

×

Repeat CRUD logic on every project

Generate it consistently every time

×

Fix the same boilerplate bugs everywhere

Fix bugs in templates, fixed everywhere

×

Switch language? Rewrite everything

Switch bridges, keep the same domain

×

Permissions scattered across the codebase

Declared beside entities, wired end-to-end

How it works

One model, whole pipeline.

Your domain.yaml flows through a deterministic compiler — not a black box.

  1. 01

    Describe the domain

    Entities, fields, relations, permissions, features and seed data live in one readable, diffable domain.yaml.

  2. 02

    DomainCraft validates & builds IR

    A strict parser, lexer and validator catch logic errors before anything is generated; an intermediate representation links every relation.

  3. 03

    Bridges render production code

    Pluggable bridge templates translate the IR into idiomatic code for your target stack — with a file manifest and migration snapshot.

domain.yamlParserValidatorIRRenderercode

Features

Everything a production backend needs, declared not written.

Each feature is a few declarative words in domain.yaml. The template does the rest — consistently, every single time.

Day-2 safety · Generation Gap

Custom code survives regeneration. Generated partials stay refreshed, your hooks stay yours — no wipe on regen.

RBAC + ABAC permissions

read: ["*"], update: ["@Owner", Admin] — public, role and ownership rules compiled to auth policies.

Schema migration engine

Snapshots, old_name renames, orphan cleanup and --prune — domain refactors land safely.

Pluggable bridges

Bridges are plain templates and a manifest — no Go code required. Add a language in an afternoon.

Admin panel from one flag

domaincraft generate --admin ships a CRUD admin panel for your API with zero extra config.

Infrastructure addons

Declare queue, cache, secrets and storage — wire Dapr, event_sourced and enterprise plumbing declaratively.

AI-native · Built for AI development

The whole AI loop, one session.

The agent describes the domain, DomainCraft generates 40+ production files, the agent drops business logic into hooks — then docker compose up runs it. Zero forgotten wiring, nothing hand-built.

01

Describe the domain

One file is the whole spec — entities, relations, permissions, features. Everything else the generator derives from it.

02

Generate the backend

domaincraft generate emits a full ASP.NET Core solution — controllers, DTOs, repositories, migrations, tests, Docker — deterministic on every run.

03

Drop in business logic

The agent implements hooks in Services/<Entity>Service.cs (overwrite: false) — the exact files the generator never touches.

04

Run and iterate

docker compose up boots API + Postgres. Change the model and regenerate — tables are renamed for you, your data survives.

One session, end to end

You → agent

You are building an online store with DomainCraft.

1. Draft the domain: Product + Category entities with
   relations, audit + soft_delete features and permissions
   (public read, Admin create/delete, @Owner update).
2. I'll run: domaincraft generate
3. Then I'll write the custom business logic in the hooks.
4. And deploy it: docker compose up

Output only a valid domain.yaml.

Agent → domain.yaml

entities:
  Product:
    features: [audit, soft_delete]
    fields:
      id: uuid [primary]
      title: string [required, min:3]
      price: decimal [required, gte:0]
      categoryId: relation(Category) [optional]
    permissions:
      read: ["*"]
      create: [Admin]
      update: ["@Owner"]
  Category:
    fields:
      id: uuid [primary]
      name: string [required, unique]

$ domaincraft generate

✓ Schema valid (2 entities)
✓ 42 files generated · compiles clean
  src/WebApi/Controllers/ProductsController.g.cs
  src/Application/Generated/ProductService.g.cs
  tests/ApiTests.g.cs

Agent → business hooks

// ProductService.cs — your file, overwrite: false
protected override async Task<HookResult> OnBeforeCreateAsync(
    Product entity, CancellationToken ct)
{
    if (entity.Price <= 0)
        return HookResult.Fail("Price must be positive");
    return HookResult.Success();
}

$ docker compose up

[+] Running 2/2
 ✔ Container postgres   Started
 ✔ Container api        Started
 ✓ API :8080 · Postgres · health ready

DomainCraft Studio

Design your domain visually.

Drag-and-drop entity diagrams, a permission matrix and a real-time YAML editor with WASM validation — everything you draw is a valid domain.yaml.

  • Graph + code, two-way sync
  • Instant WASM validation
  • Shared role registry & permission matrix
domaincraft-studio

Bridges

One domain, any stack.

Each bridge is a pluggable template pack. The core never knows a language — it ships the IR and constrains nothing.

csharp-restful

Ready

ASP.NET Core REST API · clean architecture · EF Core + PostgreSQL + JWT + Dapr addons.

java-spring

Planned

Spring Boot REST API for the JVM. On the roadmap.

typescript

Planned

TypeScript / Express / Prisma backend. On the roadmap.

Build your own bridge

Bridges are plain templates and a manifest. No Go code required — add a language in an afternoon.

Community

Open source, MIT, free forever.

Read the source, run it yourself, fork it — no account, no gate, no lock-in, ever.

MIT Licensed

Permissive license — keep your generated code, no strings attached.

Contribute

Clear contributing guides and a strict, tested core.

Public roadmap

More databases, more API styles, more addons — tracked publicly on the repo.

Star on GitHub

Momentum signals real adoption. A star helps other developers find DomainCraft.

Stop writing boilerplate. Start shipping your domain.

No Go required — download a binary and generate your first backend today.

or install with Go

go install github.com/DomainCraft/DomainCraft/cmd/domaincraft@latest