BaseForge.CodeGen 0.6.5-beta

This is a prerelease version of BaseForge.CodeGen.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet tool install --global BaseForge.CodeGen --version 0.6.5-beta
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local BaseForge.CodeGen --version 0.6.5-beta
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=BaseForge.CodeGen&version=0.6.5-beta&prerelease
                    
nuke :add-package BaseForge.CodeGen --version 0.6.5-beta
                    

BaseForge

Forge .NET microservices from a spec.

NuGet .NET 10 Docs License: MIT

BaseForge is an opinionated base library and visual code generator for .NET 10 microservices. Describe your entities in YAML — or click them together in the browser-based Designer — and get clean, production-ready services with CQRS, authentication, gRPC, events, logging and Docker already wired.

📖 Documentation: https://dropdeart.github.io/BaseForge/ · 🇹🇷 Türkçe README


Why BaseForge?

Every microservice needs the same plumbing — layering, CQRS, repositories, audit fields, soft delete, error handling, auth, inter-service calls, messaging, logging, health checks, Docker files. BaseForge makes those decisions once, documents why, and ships them as:

  • A library — builder.Services.AddBaseForge(...) gives you all of it in one line. It's a library, not a framework: every behavior can be overridden.
  • A generator — the baseforge CLI and its Designer turn a spec into plain, readable C# (controllers, handlers, EF Core entities, DTOs, protos, Dockerfile) that you own.

Features

  • 🎨 Visual Designer — entities, relations, access rules and Identity in the browser, with a live ER diagram; generate, build and run with one click
  • 🧱 Clean Architecture + CQRS on MediatR, repositories, audit fields, soft delete
  • 🗄️ EF Core 10 + Dapper — LINQ for writes, raw SQL for heavy reads, one shared connection
  • 🔐 Central Identity (OpenIddict + ASP.NET Identity) — OAuth2/OIDC, social logins, roles, ownership rules, user profile fields
  • 🔌 gRPC between services with generated protos, clients and servers
  • 📨 RabbitMQ events with a transactional outbox, inbox idempotency and dead-letter queues
  • 🔭 Observability — Serilog + Grafana Loki, correlation ids across HTTP → gRPC → RabbitMQ, /health everywhere
  • 🏢 Multi-tenancy, append-only entities, enums, JSONB, list filters, YARP gateway

Quick start

# 1. Install the CLI
dotnet tool install -g BaseForge.CodeGen --prerelease

# 2. Open the Designer in a workspace folder
mkdir my-platform && cd my-platform
baseforge new orders

The Designer opens at http://localhost:3500. Add entities, press Generate + Build, then Run — your service is up at http://localhost:8080/scalar/v1.

Prefer YAML? Write a spec and generate from the terminal:

# orders.yaml
service: orders
database: orders_db
entities:
  Order:
    props:
      Status: { type: enum, values: [Draft, Paid], default: Draft }
      Total: decimal
      BuyerId: guid
    ownerField: BuyerId
    access:
      list: [Admin, owner]
    publishes: [created]
baseforge new-service --spec orders.yaml

Using the library directly

dotnet add package BaseForge.API --prerelease
builder.AddBaseForgeLogging("orders");
builder.Services.AddBaseForge(options =>
{
    options.UsePostgreSQL<OrdersDbContext>(connectionString);
    options.EnableCQRS(typeof(Program).Assembly);
    options.EnableAuditLog();
});

var app = builder.Build();
app.UseBaseForge();

Packages

Package Description
BaseForge.Core Interfaces and entity bases only (no external dependencies)
BaseForge.Infrastructure EF Core repositories, Dapper query helpers, DbContext base, RabbitMQ event bus, outbox/inbox
BaseForge.API Controller base, middleware, AddBaseForge() / UseBaseForge(), JWT, logging, health checks
BaseForge.Tools Developer tools: DBML ER diagram generation from an EF Core model
BaseForge.CodeGen The baseforge .NET tool — code generator + Designer

Tech stack

.NET 10 · ASP.NET Core · EF Core 10 · Dapper · MediatR · PostgreSQL · gRPC · RabbitMQ · OpenIddict · YARP · Serilog · Grafana Loki · Docker

Documentation

Getting Started Install, generate and run your first service
Designer A tour of the visual editor
Service Spec Every YAML option explained
Identity & Authorization Central auth, roles, ownership, profile fields
Deploying to Production Docker, reverse proxy, HTTPS, checklist
Architecture Decisions What was decided and why

Repository layout

src/
  BaseForge.Core/            → entity bases, interfaces, CQRS contracts, exceptions
  BaseForge.Infrastructure/  → EF Core repository, Dapper helpers, messaging, DI extensions
  BaseForge.API/             → BaseController, middleware, AddBaseForge()
  BaseForge.CodeGen/         → baseforge CLI: code generator + Designer host
  BaseForge.Designer.Web/    → Designer UI (React + Vite + TypeScript)
  BaseForge.Tools/           → DBML ER diagram generator
services/                    → Identity reference service + sample generated services
samples/                     → example specs (blog, orders, auth, …)
docs/                        → documentation site (VitePress, English + Turkish)
tests/

Development

dotnet build      # the whole solution
dotnet test       # tests

To refresh your globally installed baseforge tool from local source (this is not an official release):

.\scripts\update-cli.ps1                 # full build (including the Designer / Identity UIs)
.\scripts\update-cli.ps1 -SkipWebBuild   # CLI / codegen only

To work on the documentation site:

cd docs
npm install
npm run dev

Official releases are published to nuget.org by .github/workflows/publish.yml when a GitHub Release is created.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.6.6-beta 42 11/10/2026
0.6.5-beta 59 11/4/2026
0.6.4-beta 48 11/4/2026
0.6.3-beta 58 11/4/2026
0.6.2-beta 94 9/27/2026
0.6.0-beta 77 9/26/2026
0.4.1-beta 103 7/17/2026
0.4.0-beta 91 7/17/2026
0.3.2-beta 87 7/13/2026
0.2.3-alpha 93 7/5/2026
0.2.2-alpha 103 6/29/2026
0.2.1-alpha 99 6/26/2026
0.2.0-alpha 106 6/25/2026