docs: add GRAPH.md with unicode architecture diagrams, update CLAUDE.md
- Create GRAPH.md: package layers, metadata-driven endpoint flow - Add GRAPH.md maintenance rule to CLAUDE.md Co-Authored-By: Svrnty Inc. <eng@svrnty.com>
This commit is contained in:
parent
3df094b9e7
commit
9ed9400e4d
10
CLAUDE.md
10
CLAUDE.md
@ -411,3 +411,13 @@ The codebase currently compiles without warnings on C# 14.
|
||||
- Dynamic query endpoints: `Svrnty.CQRS.DynamicQuery.MinimalApi/EndpointRouteBuilderExtensions.cs`
|
||||
- gRPC support: `Svrnty.CQRS.Grpc/` runtime, `Svrnty.CQRS.Grpc.Generators/` source generators
|
||||
- Sample application: `Svrnty.Sample/` - demonstrates both HTTP and gRPC integration
|
||||
|
||||
## GRAPH.md Maintenance
|
||||
|
||||
This repo contains a `GRAPH.md` file with unicode cascade diagrams showing the
|
||||
architecture. **You MUST update GRAPH.md whenever you**:
|
||||
- Add, remove, or rename modules, directories, or major components
|
||||
- Change data flow, dependencies, or integration points
|
||||
- Modify the public API surface or protocol contracts
|
||||
|
||||
Keep the diagrams accurate. They are read by non-technical stakeholders.
|
||||
|
||||
57
GRAPH.md
Normal file
57
GRAPH.md
Normal file
@ -0,0 +1,57 @@
|
||||
╔══════════════════════════════════════════════════════════╗
|
||||
║ dotnet-cqrs Architecture ║
|
||||
╚══════════════════════════════════════════════════════════╝
|
||||
|
||||
PACKAGE LAYERS
|
||||
══════════════
|
||||
|
||||
┌─────────────────────────────────────────────────────┐
|
||||
│ Abstractions (Interfaces) │
|
||||
│ ICommandHandler<T> IQueryHandler<T,R> │
|
||||
│ ICommandDiscovery IQueryDiscovery │
|
||||
│ IDynamicQuery<S,D> IQueryableProvider<S> │
|
||||
└─────────────────────────┬───────────────────────────┘
|
||||
│ implements
|
||||
┌─────────────────────────▼───────────────────────────┐
|
||||
│ Core Implementation │
|
||||
│ CQRS (discovery + dispatch) │
|
||||
│ DynamicQuery (OData-like filter/sort/group) │
|
||||
│ FluentValidation (validators → RFC 7807 errors) │
|
||||
└─────────────────────────┬───────────────────────────┘
|
||||
│ exposes via
|
||||
┌─────────────────────────▼───────────────────────────┐
|
||||
│ Protocol / Transport │
|
||||
│ MinimalApi ─── HTTP endpoints (auto-mapped) │
|
||||
│ Grpc ───────── gRPC endpoints (source-generated) │
|
||||
│ Grpc.Generators ── compile-time codegen │
|
||||
└─────────────────────────┬───────────────────────────┘
|
||||
│ optional
|
||||
┌─────────────────────────▼───────────────────────────┐
|
||||
│ Extended Features │
|
||||
│ Events + Events.RabbitMQ ── event sourcing │
|
||||
│ Sagas + Sagas.RabbitMQ ─── long-running txns │
|
||||
│ DynamicQuery.EF ────────── Entity Framework │
|
||||
│ Notifications ──────────── real-time push │
|
||||
└─────────────────────────────────────────────────────┘
|
||||
|
||||
|
||||
METADATA-DRIVEN ENDPOINT FLOW
|
||||
══════════════════════════════
|
||||
|
||||
Developer writes handler:
|
||||
ICommandHandler<CreatePersonCommand, PersonResult>
|
||||
│
|
||||
▼
|
||||
DI registration (AddSvrntyCqrs)
|
||||
│
|
||||
▼
|
||||
Discovery auto-enumerates all handlers
|
||||
│
|
||||
▼
|
||||
┌────┴────────────────────┐
|
||||
│ │
|
||||
▼ ▼
|
||||
HTTP: MapSvrntyCommands() gRPC: Source Generator
|
||||
POST /api/command/ CommandServiceImpl
|
||||
createPerson QueryServiceImpl
|
||||
(compile-time generated)
|
||||
Loading…
Reference in New Issue
Block a user