{"id":49535253,"url":"https://github.com/sassy-solutions/compendium","last_synced_at":"2026-05-02T10:02:49.338Z","repository":{"id":353555836,"uuid":"1219883774","full_name":"sassy-solutions/compendium","owner":"sassy-solutions","description":"A pragmatic .NET framework for event-sourced multi-tenant SaaS applications","archived":false,"fork":false,"pushed_at":"2026-05-02T05:54:07.000Z","size":8837,"stargazers_count":7,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-02T07:28:44.376Z","etag":null,"topics":["cqrs","csharp","dotnet","event-sourcing","hexagonal-architecture","multi-tenancy","oss","saas"],"latest_commit_sha":null,"homepage":"https://github.com/sassy-solutions/compendium","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sassy-solutions.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-24T10:12:22.000Z","updated_at":"2026-05-02T05:52:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sassy-solutions/compendium","commit_stats":null,"previous_names":["sassy-solutions/compendium"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sassy-solutions/compendium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassy-solutions%2Fcompendium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassy-solutions%2Fcompendium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassy-solutions%2Fcompendium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassy-solutions%2Fcompendium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sassy-solutions","download_url":"https://codeload.github.com/sassy-solutions/compendium/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassy-solutions%2Fcompendium/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32530176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cqrs","csharp","dotnet","event-sourcing","hexagonal-architecture","multi-tenancy","oss","saas"],"created_at":"2026-05-02T10:02:48.509Z","updated_at":"2026-05-02T10:02:49.322Z","avatar_url":"https://github.com/sassy-solutions.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compendium\n\n\u003e A pragmatic .NET framework for building event-sourced, multi-tenant SaaS applications.\n\n[![CI](https://github.com/sassy-solutions/compendium/actions/workflows/ci.yml/badge.svg)](https://github.com/sassy-solutions/compendium/actions/workflows/ci.yml)\n[![NuGet](https://img.shields.io/nuget/v/Compendium.Core.svg)](https://www.nuget.org/packages/Compendium.Core/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![.NET 9](https://img.shields.io/badge/.NET-9.0-512BD4.svg)](https://dotnet.microsoft.com/)\n\nCompendium is the framework that powers [Nexus](https://sassy.solutions), Sassy Solutions' multi-tenant platform engineering product. It distills years of building event-sourced SaaS into a small set of focused packages: DDD primitives, CQRS handlers, an event store, multi-tenancy, and ready-to-use adapters for PostgreSQL, Redis, Zitadel, and more.\n\n## Why Compendium?\n\n- **Zero-dependency Core** — Pure DDD primitives (`AggregateRoot\u003cTId\u003e`, `ValueObject`, `Result\u003cT\u003e`, `Error`) with no external dependencies beyond the .NET BCL.\n- **CQRS + Event Sourcing built-in** — Command/query dispatchers, event store interfaces, and a PostgreSQL adapter wired out of the box.\n- **Sagas, two flavors** — `ProcessManager\u003cTState\u003e` for DDD-style orchestration sagas and `IHandle\u003cTEvent\u003e` for event-driven choreography sagas, each clearly named so you don't have to guess which pattern you're using. See [docs/sagas.md](docs/sagas.md).\n- **Multi-tenancy native** — Tenant context, resolution, and scoping baked into the primitives — not bolted on.\n- **Result pattern everywhere** — No control-flow exceptions. Every fallible operation returns `Result\u003cT\u003e` with structured `Error` values.\n- **Modular adapters** — Pick only what you need: PostgreSQL, Redis, Zitadel, Listmonk, LemonSqueezy, OpenRouter, ASP.NET Core.\n- **Battle-tested in production** — Powers Nexus, a multi-tenant platform engineering product.\n\n## Quick start\n\nInstall the packages you need:\n\n```bash\ndotnet add package Compendium.Core\ndotnet add package Compendium.Application\ndotnet add package Compendium.Adapters.PostgreSQL\n```\n\nDefine an event-sourced aggregate:\n\n```csharp\nusing Compendium.Core.Domain.Primitives;\nusing Compendium.Core.Results;\n\npublic sealed class OrderAggregate : AggregateRoot\u003cOrderId\u003e\n{\n    private OrderStatus _status;\n    private decimal _amount;\n\n    private OrderAggregate(OrderId id) : base(id) { }\n\n    public static Result\u003cOrderAggregate\u003e Create(CustomerId customerId, decimal amount)\n    {\n        if (amount \u003c= 0)\n            return Result.Failure\u003cOrderAggregate\u003e(\n                Error.Validation(\"Order.Amount.Invalid\", \"Amount must be positive\"));\n\n        var order = new OrderAggregate(OrderId.New());\n        order.AddDomainEvent(new OrderCreated(order.Id, customerId, amount));\n        return Result.Success(order);\n    }\n\n    public void Apply(OrderCreated @event)\n    {\n        _status = OrderStatus.Pending;\n        _amount = @event.Amount;\n    }\n}\n```\n\nWire it up in `Program.cs`:\n\n```csharp\nusing Compendium.Application.CQRS;\nusing Microsoft.Extensions.DependencyInjection;\n\nvar builder = WebApplication.CreateBuilder(args);\n\n// Register Compendium CQRS dispatchers (command/query handlers are resolved via IServiceProvider).\nbuilder.Services.AddScoped\u003cICommandDispatcher, CommandDispatcher\u003e();\nbuilder.Services.AddScoped\u003cIQueryDispatcher, QueryDispatcher\u003e();\n\n// Register your command/query handlers, then wire the PostgreSQL event store adapter\n// using the options published by Compendium.Adapters.PostgreSQL.\n\nvar app = builder.Build();\n```\n\n## Architecture\n\n```\nCore (zero deps) → Abstractions → Application → Infrastructure → Adapters\n                                       ↓\n                              Multitenancy (cross-cutting)\n```\n\n- **Core** — Domain primitives with no external dependencies.\n- **Abstractions** — Ports (interfaces) for infrastructure concerns: identity, billing, email, AI.\n- **Application** — CQRS orchestration: command/query handlers, dispatchers.\n- **Infrastructure** — Generic infrastructure concerns: projections, outbox, caching.\n- **Adapters** — Concrete integrations with external systems.\n- **Multitenancy** — Tenant resolution and scoping, usable across all layers.\n\n## Packages\n\n| Package | Purpose | NuGet |\n|---------|---------|-------|\n| `Compendium.Core` | DDD primitives, Result pattern, domain events | [![NuGet](https://img.shields.io/nuget/v/Compendium.Core.svg)](https://www.nuget.org/packages/Compendium.Core/) |\n| `Compendium.Abstractions` | Shared infrastructure port interfaces | [![NuGet](https://img.shields.io/nuget/v/Compendium.Abstractions.svg)](https://www.nuget.org/packages/Compendium.Abstractions/) |\n| `Compendium.Abstractions.AI` | AI provider contracts | [![NuGet](https://img.shields.io/nuget/v/Compendium.Abstractions.AI.svg)](https://www.nuget.org/packages/Compendium.Abstractions.AI/) |\n| `Compendium.Abstractions.Billing` | Billing provider contracts | [![NuGet](https://img.shields.io/nuget/v/Compendium.Abstractions.Billing.svg)](https://www.nuget.org/packages/Compendium.Abstractions.Billing/) |\n| `Compendium.Abstractions.Email` | Email provider contracts | [![NuGet](https://img.shields.io/nuget/v/Compendium.Abstractions.Email.svg)](https://www.nuget.org/packages/Compendium.Abstractions.Email/) |\n| `Compendium.Abstractions.Identity` | Identity provider contracts | [![NuGet](https://img.shields.io/nuget/v/Compendium.Abstractions.Identity.svg)](https://www.nuget.org/packages/Compendium.Abstractions.Identity/) |\n| `Compendium.Application` | CQRS dispatchers, handlers, pipelines | [![NuGet](https://img.shields.io/nuget/v/Compendium.Application.svg)](https://www.nuget.org/packages/Compendium.Application/) |\n| `Compendium.Infrastructure` | Projections, outbox, infrastructure building blocks | [![NuGet](https://img.shields.io/nuget/v/Compendium.Infrastructure.svg)](https://www.nuget.org/packages/Compendium.Infrastructure/) |\n| `Compendium.Multitenancy` | Tenant context, resolution, and scoping | [![NuGet](https://img.shields.io/nuget/v/Compendium.Multitenancy.svg)](https://www.nuget.org/packages/Compendium.Multitenancy/) |\n| `Compendium.Testing` | Test helpers, fakes, TestContainers fixtures | [![NuGet](https://img.shields.io/nuget/v/Compendium.Testing.svg)](https://www.nuget.org/packages/Compendium.Testing/) |\n| `Compendium.Extensions.ExternalAdapters` | Unified registration for external adapters | [![NuGet](https://img.shields.io/nuget/v/Compendium.Extensions.ExternalAdapters.svg)](https://www.nuget.org/packages/Compendium.Extensions.ExternalAdapters/) |\n| `Compendium.Adapters.AspNetCore` | ASP.NET Core integration (middleware, auth, problem details) | [![NuGet](https://img.shields.io/nuget/v/Compendium.Adapters.AspNetCore.svg)](https://www.nuget.org/packages/Compendium.Adapters.AspNetCore/) |\n| `Compendium.Adapters.PostgreSQL` | PostgreSQL event store \u0026 repositories | [![NuGet](https://img.shields.io/nuget/v/Compendium.Adapters.PostgreSQL.svg)](https://www.nuget.org/packages/Compendium.Adapters.PostgreSQL/) |\n| `Compendium.Adapters.Redis` | Redis cache adapter | [![NuGet](https://img.shields.io/nuget/v/Compendium.Adapters.Redis.svg)](https://www.nuget.org/packages/Compendium.Adapters.Redis/) |\n| `Compendium.Adapters.Zitadel` | Zitadel OIDC identity adapter | [![NuGet](https://img.shields.io/nuget/v/Compendium.Adapters.Zitadel.svg)](https://www.nuget.org/packages/Compendium.Adapters.Zitadel/) |\n| `Compendium.Adapters.Listmonk` | Listmonk email adapter | [![NuGet](https://img.shields.io/nuget/v/Compendium.Adapters.Listmonk.svg)](https://www.nuget.org/packages/Compendium.Adapters.Listmonk/) |\n| `Compendium.Adapters.LemonSqueezy` | LemonSqueezy billing adapter | [![NuGet](https://img.shields.io/nuget/v/Compendium.Adapters.LemonSqueezy.svg)](https://www.nuget.org/packages/Compendium.Adapters.LemonSqueezy/) |\n| `Compendium.Adapters.OpenRouter` | OpenRouter AI provider adapter | [![NuGet](https://img.shields.io/nuget/v/Compendium.Adapters.OpenRouter.svg)](https://www.nuget.org/packages/Compendium.Adapters.OpenRouter/) |\n\n## Documentation\n\nThe full documentation site is being built at [sassy-solutions.github.io/compendium](https://sassy-solutions.github.io/compendium/) (DocFX-powered). In the meantime:\n\n- [ROADMAP.md](ROADMAP.md) — themes, what's next, and what's out of scope\n- [CONTRIBUTING.md](CONTRIBUTING.md) — build, test, conventions\n- [docs/adr/](docs/adr/) — architecture decision records\n- Source under `src/` and the Nexus consumer code for end-to-end examples\n\n## Who's using Compendium?\n\n- **[Nexus](https://sassy.solutions)** — Multi-tenant platform engineering by Sassy Solutions.\n\nUsing Compendium in your project? Open a PR to add yourself to this list.\n\n## Contributing\n\nContributions, issues, and feedback are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on code style, commit conventions, and the development loop.\n\n## License\n\nMIT \u0026copy; 2026 Sassy Solutions. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsassy-solutions%2Fcompendium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsassy-solutions%2Fcompendium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsassy-solutions%2Fcompendium/lists"}