Skip to content

BaseForgeForge .NET microservices from a spec

An opinionated base library and a visual code generator for .NET 10. Describe your entities — get clean, production-ready services with CQRS, auth, gRPC, events and Docker already wired.

BaseForge
Spec in, service out

Describe it once. Get a service that builds, runs and scales.

Write a few lines of YAML — or click them together in the Designer. BaseForge generates plain, readable C# that uses the library, then builds it and starts it with Docker.

orders.yaml
service: orders
database: orders_db
auth: { protect: true }

entities:
  Order:
    props:
      Status: { type: enum, values: [Draft, Paid] }
      Total: decimal
      BuyerId: guid
    ownerField: BuyerId
    access:
      list: [Admin, owner]
    publishes: [created]

  OrderLine:
    relations:
      order: { kind: many-to-one, target: Order }
    externalRefs:
      product: { target: products/Product, via: grpc }
terminal
$ baseforge new-service --spec orders.yaml --yes
✓ spec validated · 2 entities · 1 external reference
✓ ER diagram → orders/er.drawio
✓ 38 files generated → ./orders
✓ gRPC client → products/Product (rich, 5 fields)
✓ dotnet build · 0 warnings · 0 errors
$ docker compose up --build -d --wait
● orders http://localhost:8080/scalar/v1 healthy

Three steps from idea to API

01

Design

Model entities, relations, access rules and Identity visually — with a live ER diagram — or in plain YAML.

02

Generate

Get controllers, CQRS handlers, EF Core entities, DTOs, validation, gRPC protos, events, Dockerfile and compose.

03

Run

One click builds and starts the whole stack. Iterate with baseforge update — your spec stays the source of truth.

Everything a production service needs — already wired

REST controllers + Scalar API docs
CQRS commands & queries on MediatR
EF Core entities, audit fields, soft delete
Dapper for heavy read queries
Role & ownership authorization
gRPC clients and servers between services
RabbitMQ events with transactional outbox
Inbox idempotency & dead-letter queues
Serilog + Grafana Loki, correlation ids
/health checks & Docker healthchecks
Multi-tenancy & append-only entities
Dockerfile + docker-compose per service

Built on the tools you already trust

.NET 10ASP.NET CoreEF Core 10DapperMediatRPostgreSQLgRPCRabbitMQOpenIddictYARPSerilogGrafana LokiDockerReact + Vite

Forge your first service in five minutes

Install the CLI, open the Designer, press Generate.

Released under the MIT License.