Чем больше сообщество вложится в мост, тем мощнее инструмент«DomainCraft» — рабочее название
DomainCraft

Русский перевод документации в работе — содержимое пока на английском.

Начало работы

Quick start · Документация — DomainCraft

Install DomainCraft, define your domain in domain.yaml and generate production-ready code in minutes.

DomainCraft compiles one domain.yaml into every layer of your product. The same model produces the API, its typed clients and the admin panel. There’s no boilerplate to keep in sync and no drift between layers.

1. Install the CLI

Prebuilt binary (no Go required):

Download from GitHub Releases

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

2. Create a project

By hand or in the visual editor (Studio):

project:
  name: MyShop
  version: 1.0.0
database: postgresql
auth:
  type: jwt
api_style: rest
entities:
  User:
    fields:
      id: uuid [primary]
      email: string [required, unique, email]
      name: string [required]
      password: string [required, hidden]

3. Define your domain

The compiler derives the rest:

entities:
  Product:
    features: [audit, soft_delete]
    fields:
      id: uuid [primary]
      title: string [required, min:3, max:200]
      price: decimal [required, gte:0]
    permissions:
      read: ["*"]
      create: [Admin]
      update: ["@Owner", Admin]
domaincraft validate --domain domain.yaml

4. Generate your backend

# C# API — core → domain → efcore → rest
domaincraft generate --domain domain.yaml --bridge csharp-rest
cd generated && dotnet run --project src/WebApi

Want a different database without copying 71 templates? Swap one layer:

domaincraft generate --domain domain.yaml --bridge csharp-rest --replace persistence=csharp-dapper

The same model also builds a typed frontend:

domaincraft generate --domain domain.yaml --bridge ts-core
domaincraft generate --domain domain.yaml --bridge react-rest   # ts-core + TanStack Query

Why this matters: types, validation, path:op:value queries, enum wire values, errors and permissions are all compiled from the same IR. Rename a field in domain.yaml and the API, the client and the admin panel update together — in one run.

Next: First project (relations + features), then the TypeScript client.

Редактировать эту страницу на GitHub