Table of Contents

Samples

Derived. The behaviour described here is specified under openspec/specs/. Those specifications are the source; this page explains and illustrates them.

Runnable demos. The two Hero Samples show what makes Stratara different — tamper-evident streams and tenant-aware encryption — with no dependencies at all: no database, no DI container. The five Learning Path samples walk through the core CQRS / Event Sourcing / Outbox / Saga / ASP.NET wiring in order. A Pipeline Behaviors sample covers request validation, and two Identity & Access samples cover sign-in and the identity directory.

The hero + learning-path samples share the same bank-account / money-transfer domain so you don't have to re-learn the problem space for each one.

Hero Samples

The why-Stratara demos. Self-contained, zero-dependency, designed to make the point in under a minute.

Sample Concept Read
TamperProof Hash-chained event streams catch direct-DB tampering 5–10 min
Encryption [EncryptData] with tenant-bound AAD prevents cross-tenant decryption 5–10 min

Learning Path

End-to-end runnable demos along a CQRS-→-Event-Sourcing-→-Saga progression. Each one builds on the prior.

# Sample Concept Lines (approx) Read
1 CQRS Basics IMediator + ICommand / IQuery + handler discovery ~200 5–10 min
2 Event Sourced Event-sourced aggregate + projection (read/write separation) ~250 10–15 min
3 Outbox + Worker Outbox + message bus + two background workers (async dispatch) ~300 15–20 min
4 Money-Transfer Saga Saga / process manager — one command fans out into two via the outbox ~330 15–20 min
5 ASP.NET Core API HTTP minimal-API endpoints → mediator wiring ~250 10–15 min

Samples 2–4 build conceptually on the one before; sample 5 is parallel to 1 and can be read at any point.

Pipeline Behaviors

Cross-cutting mediator behaviors that run before the handler. Self-contained, with a small user-registration command.

Sample Concept Read
Validation IValidator<T> as a mediator pipeline behavior — valid, warning-only (still handled), and invalid (blocked) 5–10 min

Identity & Access

Two halves of the same story: how a caller is authenticated, and what that identity may then do. They use their own small tenant/simulation domain rather than the bank-account one.

Sample Concept Read
Identity External OpenID Connect sign-in + hardened JIT provisioning, API keys / PATs, and the auth-scheme selector routing all three 10–15 min
Identity Directory Tenant membership (roles scoped per membership), [RequirePermission] at the mediator, and the scoped-settings fallback chain 10–15 min

Each sample is self-contained code (no shared "Stratara.Sample.Common" project) — duplication between samples is intentional so each one reads from top to bottom without jumping to a shared library. Every sample is smoke-tested in CI via tests/Stratara.Samples.SmokeTests/ — releases ship only after each sample's stdout has been asserted line-for-line.

Running locally

dotnet run --project samples/Stratara.Sample.TamperProof
dotnet run --project samples/Stratara.Sample.Encryption
dotnet run --project samples/Stratara.Sample.CqrsBasics