# yuebo119/palddd architecture

> Architecture diagram of the GitHub repository yuebo119/palddd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yuebo119/palddd
- Repository: https://github.com/yuebo119/palddd

## Overview

Pal.DDD is a modular .NET DDD/CQRS and event-sourcing infrastructure framework. Its principal workflow is command dispatch to a handler, which updates domain state and commits through a unit of work; transactional outbox processing publishes messages, and inbox processing supports idempotent consumption. Distinct capabilities include saga orchestration, event logging and projection replay, serialization evolution, and compile-time domain diagnostics. The README documents the end-to-end workflow and capabilities; source excerpts and the SOURCE INDEX substantiate selected internal links. Unsampled implementations are represented only where documented, and uncertain links are omitted.

Main entry points: [`src/PalDDD.Dapper/DapperOutboxStore.cs`](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Dapper/DapperOutboxStore.cs) (Outbox store), [`src/PalDDD.Messaging/MessageBroker.cs`](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Messaging/MessageBroker.cs) (Message broker), [`src/PalDDD.Transactions/Saga/Saga.cs`](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Transactions/Saga/Saga.cs) (Saga orchestration), [`src/PalDDD.Transactions/Outbox/OutboxProcessor.cs`](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Transactions/Outbox/OutboxProcessor.cs) (Outbox processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_domain["Domain foundation"]
  node_domain_model["Domain model<br/>[AggregateRoot.cs]"]
  node_analyzers["DDD analyzers"]
end

subgraph group_application["Application flow"]
  node_dispatcher["CQRS dispatcher<br/>[Dispatcher.cs]"]
  node_pipeline["Request pipeline"]
  node_di["Handler registration"]
  node_uow["Unit of work<br/>[IUnitOfWork.cs]"]
end

subgraph group_transactions["Reliable messaging"]
  node_outbox["Outbox processor<br/>[OutboxProcessor.cs]"]
  node_outbox_store[("Outbox store")]
  node_inbox["Inbox processor<br/>[InboxProcessor.cs]"]
  node_inbox_store[("Inbox store")]
  node_broker["Message broker<br/>[MessageBroker.cs]"]
  node_saga["Saga orchestration<br/>[Saga.cs]"]
  node_saga_state["Saga state<br/>[SagaState.cs]"]
end

subgraph group_events["Events and projections"]
  node_event_log[("Event log<br/>[IEventLog.cs]")]
  node_projection["Projection replay"]
  node_serialization["Message serialization"]
  node_evolution["Contract evolution"]
end

subgraph group_adapters["Persistence and integration"]
  node_dapper["Dapper adapters"]
  node_ef_transactions["EF transaction adapters"]
  node_palorm["PalORM adapters"]
  node_kafka["Kafka broker<br/>[KafkaBroker.cs]"]
  node_rabbitmq["RabbitMQ broker<br/>[RabbitMqBroker.cs]"]
end

node_developer(("Application code"))

node_developer -->|"sends command"| node_dispatcher
node_dispatcher -.->|"runs pipeline"| node_pipeline
node_di -->|"registers handlers"| node_dispatcher
node_pipeline -.->|"returns result"| node_developer
node_developer -->|"uses domain types"| node_domain_model
node_developer -->|"commits changes"| node_uow
node_uow -->|"writes transactionally"| node_outbox_store
node_outbox -.->|"claims messages"| node_outbox_store
node_outbox -->|"publishes messages"| node_broker
node_broker -.->|"delivers messages"| node_inbox
node_inbox -.->|"records processing"| node_inbox_store
node_developer -->|"defines workflow"| node_saga
node_saga -->|"updates state"| node_saga_state
node_saga -->|"supports batch processing"| node_outbox
node_developer -->|"uses event log"| node_event_log
node_event_log -->|"replays events"| node_projection
node_serialization -->|"upgrades contracts"| node_evolution
node_analyzers -->|"checks conventions"| node_developer
node_dapper -->|"registers store"| node_outbox_store
node_dapper -->|"registers store"| node_inbox_store
node_ef_transactions -.->|"maps store"| node_outbox_store
node_palorm -.->|"alternative adapter"| node_outbox_store
node_kafka -.->|"implements broker"| node_broker
node_rabbitmq -.->|"implements broker"| node_broker

click node_domain_model "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Core/AggregateRoot.cs"
click node_analyzers "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Analyzers/StrategicDddAnalyzer.cs"
click node_dispatcher "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.CQRS/Dispatcher.cs"
click node_pipeline "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.CQRS/PipelineBehaviors.cs"
click node_di "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.DependencyInjection/ServiceRegistration.cs"
click node_uow "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Core/IUnitOfWork.cs"
click node_outbox "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Transactions/Outbox/OutboxProcessor.cs"
click node_outbox_store "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Dapper/DapperOutboxStore.cs"
click node_inbox "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Transactions/Inbox/InboxProcessor.cs"
click node_inbox_store "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Dapper/DapperInboxStore.cs"
click node_broker "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Messaging/MessageBroker.cs"
click node_saga "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Transactions/Saga/Saga.cs"
click node_saga_state "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Transactions/Saga/SagaState.cs"
click node_event_log "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.EventLog/IEventLog.cs"
click node_projection "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Projections/ProjectionProcessor.cs"
click node_serialization "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Serialization/IMessageSerializer.cs"
click node_evolution "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Serialization.Evolution/MessageEvolutionPipeline.cs"
click node_dapper "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Dapper/DapperServiceCollectionExtensions.cs"
click node_ef_transactions "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Transactions.EFCore/ServiceCollectionExtensions.cs"
click node_palorm "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.PalORM/Stores/PalOrmOutboxStore.cs"
click node_kafka "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Messaging.Kafka/KafkaBroker.cs"
click node_rabbitmq "https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Messaging.RabbitMQ/RabbitMqBroker.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_domain_model,node_analyzers toneBlue
class node_dispatcher,node_pipeline,node_di,node_uow toneAmber
class node_outbox,node_outbox_store,node_inbox,node_inbox_store,node_broker,node_saga,node_saga_state toneMint
class node_event_log,node_projection,node_serialization,node_evolution toneRose
class node_dapper,node_ef_transactions,node_palorm,node_kafka,node_rabbitmq,node_developer toneIndigo
```

## Components

### Domain foundation

- [Domain model](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Core/AggregateRoot.cs): `src/PalDDD.Core/AggregateRoot.cs`
- [DDD analyzers](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Analyzers/StrategicDddAnalyzer.cs): `src/PalDDD.Analyzers/StrategicDddAnalyzer.cs`

### Application flow

- [CQRS dispatcher](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.CQRS/Dispatcher.cs): `src/PalDDD.CQRS/Dispatcher.cs`
- [Request pipeline](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.CQRS/PipelineBehaviors.cs): `src/PalDDD.CQRS/PipelineBehaviors.cs`
- [Handler registration](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.DependencyInjection/ServiceRegistration.cs): `src/PalDDD.DependencyInjection/ServiceRegistration.cs`
- [Unit of work](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Core/IUnitOfWork.cs): `src/PalDDD.Core/IUnitOfWork.cs`

### Reliable messaging

- [Outbox processor](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Transactions/Outbox/OutboxProcessor.cs): `src/PalDDD.Transactions/Outbox/OutboxProcessor.cs`
- [Outbox store](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Dapper/DapperOutboxStore.cs): `src/PalDDD.Dapper/DapperOutboxStore.cs`
- [Inbox processor](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Transactions/Inbox/InboxProcessor.cs): `src/PalDDD.Transactions/Inbox/InboxProcessor.cs`
- [Inbox store](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Dapper/DapperInboxStore.cs): `src/PalDDD.Dapper/DapperInboxStore.cs`
- [Message broker](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Messaging/MessageBroker.cs): `src/PalDDD.Messaging/MessageBroker.cs`
- [Saga orchestration](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Transactions/Saga/Saga.cs): `src/PalDDD.Transactions/Saga/Saga.cs`
- [Saga state](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Transactions/Saga/SagaState.cs): `src/PalDDD.Transactions/Saga/SagaState.cs`

### Events and projections

- [Event log](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.EventLog/IEventLog.cs): `src/PalDDD.EventLog/IEventLog.cs`
- [Projection replay](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Projections/ProjectionProcessor.cs): `src/PalDDD.Projections/ProjectionProcessor.cs`
- [Message serialization](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Serialization/IMessageSerializer.cs): `src/PalDDD.Serialization/IMessageSerializer.cs`
- [Contract evolution](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Serialization.Evolution/MessageEvolutionPipeline.cs): `src/PalDDD.Serialization.Evolution/MessageEvolutionPipeline.cs`

### Persistence and integration

- [Dapper adapters](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Dapper/DapperServiceCollectionExtensions.cs): `src/PalDDD.Dapper/DapperServiceCollectionExtensions.cs`
- [EF transaction adapters](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Transactions.EFCore/ServiceCollectionExtensions.cs): `src/PalDDD.Transactions.EFCore/ServiceCollectionExtensions.cs`
- [PalORM adapters](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.PalORM/Stores/PalOrmOutboxStore.cs): `src/PalDDD.PalORM/Stores/PalOrmOutboxStore.cs`
- [Kafka broker](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Messaging.Kafka/KafkaBroker.cs): `src/PalDDD.Messaging.Kafka/KafkaBroker.cs`
- [RabbitMQ broker](https://github.com/yuebo119/palddd/blob/main/src/PalDDD.Messaging.RabbitMQ/RabbitMqBroker.cs): `src/PalDDD.Messaging.RabbitMQ/RabbitMqBroker.cs`

### Other components

- **Application code**

## Connections

- Application code → CQRS dispatcher: sends command (evidence: `README.md`)
- CQRS dispatcher → Request pipeline: runs pipeline
- Handler registration → CQRS dispatcher: registers handlers (evidence: `src/PalDDD.DependencyInjection/ServiceRegistration.cs`)
- Request pipeline → Application code: returns result
- Application code → Domain model: uses domain types (evidence: `README.md`)
- Application code → Unit of work: commits changes (evidence: `README.md`)
- Unit of work → Outbox store: writes transactionally (evidence: `README.md`)
- Outbox processor → Outbox store: claims messages
- Outbox processor → Message broker: publishes messages (evidence: `README.md`)
- Message broker → Inbox processor: delivers messages
- Inbox processor → Inbox store: records processing
- Application code → Saga orchestration: defines workflow (evidence: `README.md`)
- Saga orchestration → Saga state: updates state (evidence: `src/PalDDD.Transactions/Saga/Saga.cs`)
- Saga orchestration → Outbox processor: supports batch processing (evidence: `src/PalDDD.Transactions/Saga/Saga.cs`)
- Application code → Event log: uses event log (evidence: `README.md`)
- Event log → Projection replay: replays events (evidence: `README.md`)
- Message serialization → Contract evolution: upgrades contracts (evidence: `src/PalDDD.Serialization.Evolution/MessageEvolutionPipeline.cs`)
- DDD analyzers → Application code: checks conventions (evidence: `README.md`)
- Dapper adapters → Outbox store: registers store (evidence: `src/PalDDD.Dapper/DapperServiceCollectionExtensions.cs`)
- Dapper adapters → Inbox store: registers store (evidence: `src/PalDDD.Dapper/DapperServiceCollectionExtensions.cs`)
- EF transaction adapters → Outbox store: maps store
- PalORM adapters → Outbox store: alternative adapter
- Kafka broker → Message broker: implements broker
- RabbitMQ broker → Message broker: implements broker
