Automatic gRPC contract generation for Cratis Arc backends — generates
protobuf-net-compatible C# service interfaces directly
from your commands and queries, and exposes them automatically at runtime. No hand-written .proto files,
no manual service wiring.
This repository is an exploration; APIs and conventions may change.
- Generator — CLI tool that scans an assembly for types marked
[Command],[Query], or[ObservableQuery], groups them into services by[BelongsTo], and generates gRPC service interfaces. UnwrapsConceptAs<>, supportsOneOf<>,DateTimeOffset, and observable queries as streams. - Generator.Build — MSBuild integration that runs the generator automatically as part of the build.
- Server — ASP.NET Core host that discovers generated service contracts at runtime and routes calls to the right command or query through Arc's command and query pipelines, with gRPC reflection enabled.
- Backend / Interfaces / Client — a small sample backend, its generated contracts, and a console client used to exercise the whole flow end to end.
This project is part of Cratis — free, MIT-licensed tools for building event-sourced and CQRS applications:
- Arc — opinionated CQRS framework for ASP.NET Core with commands, queries, validation, authorization, and TypeScript proxy generation. Docs
- Chronicle — event-sourcing database and processing runtime with a first-class .NET SDK. Docs
- Fundamentals — shared building blocks, including the concepts used by this generator.