Arc
Arc
CQRS application framework for ASP.NET Core
Arc is an opinionated CQRS application framework for ASP.NET Core with commands, queries, validation, authorization, and TypeScript proxy generation. Event sourcing is not required.
Start here
Section titled “Start here”When commands, queries, validation, authorization, frontend contracts, and persistence each grow their own conventions, Arc gives them one application boundary. Start with current-state persistence or application services. Add Chronicle only where event sourcing fits, and add Components only where its React compositions fit.
Add the Arc package and configure an ASP.NET Core host.
Commands and queriesExecute changes, expose reads, and generate the client contracts for both.
Frontend contractsUse the generated TypeScript runtime directly or compose it with React.
Persistence choicesKeep current state in application services, MongoDB, or EF Core, or add Chronicle.
Start an Arc host
Section titled “Start an Arc host”Use the .NET SDK declared by Arc’s current global.json.
-
Install the umbrella host package.
Terminal window dotnet add package Cratis.Arc -
Configure and run the host.
using Cratis.Arc;var builder = ArcApplication.CreateBuilder(args);builder.AddCratisArc();var app = builder.Build();app.UseCratisArc();await app.RunAsync(); -
Confirm the application starts on the selected SDK/package profile.
Starting the host verifies the setup path only. Commands, queries, generated proxies, persistence integrations, and frontend packages each have additional configuration and version requirements.
Commands and queries
Section titled “Commands and queries”Arc supports model-bound records and methods as well as controller-based endpoints. The command and query pipelines handle dependency injection, validation, authorization, filters, execution scopes, result conversion, and HTTP exposure.
Queries can return one result or use Arc’s observable-query APIs. The TypeScript generator creates clients for recognized commands, queries, referenced types, validation rules, and identity details. See the detailed product documentation for the exact transport, subscription, and lifecycle behavior.
Frontend contracts
Section titled “Frontend contracts”@cratis/arc supplies the TypeScript command, query, validation, identity, and
messaging runtime used by generated proxies. @cratis/arc.react adds hooks,
command forms, dialogs, identity composition, and query components. The optional
React/MVVM package adds view models, dependency injection, route parameters, and
browser abstractions.
Explore Arc’s frontend packages to choose the TypeScript, React, or React/MVVM path. Components is separate: applications may use Arc without Components, and may use the generated TypeScript clients without Arc’s React packages.
Identity and tenancy
Section titled “Identity and tenancy”Arc includes pluggable identity and access behavior, identity-detail providers, server-side authorization and role checks, and frontend identity context. Tenant resolution can use a header, query parameter, claim, subdomain, fixed value, or development setting before provider-specific database or namespace mapping.
Frontend visibility helpers do not replace server-side authorization. Tenant resolution also does not by itself establish isolation for an application or storage topology.
Persistence choices
Section titled “Persistence choices”Arc.Core does not depend on Chronicle. Commands and queries can use application services or current-state persistence without an event log.
Inspection, contracts, and testing
Section titled “Inspection, contracts, and testing”Arc can describe registered commands, queries, identity schemas, and OpenAPI operations at runtime. Repository packages also include analyzers, source generators, command-scenario testing, proxy-generation checks, Vite helpers, and Arc-specific ESLint rules.
- Inspect registered application contracts
- Generate OpenAPI descriptions
- Test command behavior
- Review analyzer rules
Continue
Section titled “Continue”Repository structure, package roles, contribution guidance, and current limits.
Arc packagesPublished .NET package metadata and versions.
ChronicleThe optional event-sourced runtime integration for Arc application behavior.
ComponentsOptional React components aligned with Arc application patterns.