.NET 11 · PostgreSQL 18 · Channels Bus · Agentic Factory

Modular monolith architecture, built for humans & agents.

Orbit is an open-source .NET 11 modular monolith baseline and agentic software factory. Five isolated bounded contexts run inside one deployable host and one PostgreSQL 18 database—enforced by 49 boundary guardrails, a topic-routed Channels service bus, and live OpenTelemetry traces.

Looking for Milan Jovanović’s video curriculum? Explore Modular Monolith Architecture Course →

ORBIT.SLNX · 35 PROJECTSOne .NET 11 Host · Five Isolated Schemas
59/59 Gates Passing
ASP.NET Core 11 Minimal API Host · Zero Cross-Module References
Orbit.Common.EventBusFrozenDictionary<Topic, BoundedChannel[]>
O(1) Topic Routing•<10ms OutboxWakeupSignal•Idempotent Inbox•W3C trace_parent
Orders Bounded ContextPostgreSQL 18 · schema: orders

Snapshots SKU pricing, writes orders.outbox_messages, and compensates StockRejected.

Publishes: order-placed, order-cancelled
PostgreSQL 185 schemas · 0 public tables
Aspire OTelTraces · Metrics · Logs (:18888)
8 Agent Skills.agents/skills/*/SKILL.md
Architectural Guardrails

Why modular monoliths decay—and how Orbit prevents it.

Folder conventions rot under deadline pressure and AI code generation unless module boundaries are enforced in the compiler, the SQL layer, and runtime telemetry.

PostgreSQL 18

Schema-per-Module Isolation

Zero tables in public. Every module owns an exclusive schema (users, catalog, inventory, orders, shipments), EF Core writes with xmin + FOR UPDATE, and schema-scoped Dapper reads.

O(1) Routing

Channels Topic Pub/Sub Bus

Orbit.Common.EventBus routes topics via an immutable FrozenDictionary into per-subscriber bounded queues—eliminating fan-out waste and single-queue head-of-line blocking.

OpenTelemetry

Runtime Eyes for Agents

W3C trace_parent travels inside outbox_messages into a local Aspire Dashboard (:18888) so both engineers and coding agents trace async sagas end-to-end.

Software Factory

8 Composable Agent Skills

Task-focused SKILL.md playbooks plus a 5-second, 49-test boundary gate let Claude Code, Codex, and Antigravity scaffold modules and vertical slices without boundary leaks.

Interactive Code & Saga Walkthrough

Five buyers race for the last unit in stock.

Scroll through the live request path—from synchronous SKU snapshotting to atomic Outbox commits, O(1) topic routing, and SELECT ... FOR UPDATE row serialization. Every step links to the exact C# lines and proving test.

LIVE SAGA & OTEL TRACESnapshot SKUs via Catalog PublicApi
Orbit.Api (.NET 11 Host)PostgreSQL 18 Schemas & OpenTelemetryBuyer / APIPOST /api/ordersAI AgentClaude / Codex / AGY8 SKILL.md+ 49 ArchTestsCatalogICatalogPublicApiOrdersOrder AggregateInventoryStockItem LockShipmentsPick · Pack · ShipOrbit.EventBus (System.Threading.Channels)FrozenDictionary O(1) Topic Router · Bounded Queuesorders.*Order + Itemsoutbox + inbox+ trace_parentinventory.*FOR UPDATE + xminAspire OTelTraces & Metrics
01Orders → Catalog

Snapshot SKUs via Catalog PublicApi

Orders never queries catalog.products directly. PlaceOrderCommandHandler calls ICatalogPublicApi in-process to verify active SKUs and snapshot unit prices before opening a database transaction—keeping Catalog free to change prices later without mutating historical orders.

Buyer HTTP Request POST /api/ordersOrders Module
Snapshot SKU & price via ICatalogPublicApiCatalog.PublicApi
02Orders

Commit Order & Outbox with W3C Trace

Inside OrdersDbContext, InsertOutboxMessagesInterceptor captures OrderPlacedDomainEvent alongside Activity.Current?.Id (W3C trace_parent) in orders.outbox_messages within the exact same PostgreSQL commit, then pulses OutboxWakeupSignal for sub-10ms dispatch.

Orders Module Commit Order + OutboxMessage + trace_parentOutbox + trace_parent
03Orbit.EventBus

Route Topic in O(1) via Channels Bus

ModuleOutboxProcessor publishes OrderPlacedIntegrationEvent to Orbit.Common.EventBus. TopicSubscriptionRegistry looks up orders.order-placed in O(1) via an immutable FrozenDictionary and writes only to subscribed bounded Channel<IntegrationEventEnvelope> queues.

Outbox + trace_parent Pulse OutboxWakeupSignal (<10ms)Orbit.EventBus (Channels)
Route orders.order-placed in O(1)Inventory Module
04Inventory

Lock Stock Row with SELECT FOR UPDATE

Inventory wraps its handler in IdempotentIntegrationEventHandler and executes SELECT *, xmin FROM inventory.stock_items ... ORDER BY product_id FOR UPDATE. When five buyers race for the last unit, PostgreSQL serializes the lock: one order wins reservation and four receive StockRejected.

Orbit.EventBus (Channels) Route orders.order-placed in O(1)Inventory Module
SELECT *, xmin FOR UPDATE in sorted orderinventory.stock_items
Architecture Trade-Offs

Modular Monolith vs. Microservices vs. Layered Monolith.

DimensionTraditional Layered MonolithOrbit Modular Monolith (.NET 11)Premature Microservices
Deployable units1 host, tangled assemblies1 host, 5 strictly isolated bounded contexts5+ services, brokers, CI pipelines
Database ownershipShared public schema & ad-hoc joins5 exclusive PostgreSQL 18 schemas, 0 cross-joins5 separate DB clusters & ops overhead
Cross-module messagingDirect service-to-service method callsOutbox/Inbox + O(1) Channels topic pub/subNetwork broker + two-stage ack gap
AI agent safetyHigh risk of silent coupling across features49 automated compiler + SQL boundary checksSplit across repos; blind across network hops
Future extraction pathMulti-quarter rewriteSwap IEventBus adapter per module seamAlready paying distributed tax on day one
Implementation Atlas

Six engineering guides & runnable PostgreSQL labs.

Learn It or Have It Built for Your Domain

Two ways to adopt this architecture in production.

Self-Paced Video Course

Master Modular Monolith Architecture

Join thousands of .NET engineers inside Milan Jovanović’s flagship course. Design bounded contexts, CQRS vertical slices, Outbox/Inbox messaging, sagas, and service extraction step by step while building Evently.

Done-With-You Architecture Handoff

Custom Domain Setup & Software Factory

Starting a critical .NET product or untangling a monolith? We map your bounded contexts, configure Orbit’s PostgreSQL schemas, OIDC provider, OpenTelemetry, and custom SKILL.md agent workflows for your domain—and hand off 100% of the code.

Frequently asked questions

What makes Orbit different from a typical .NET modular monolith template?

Orbit combines five isolated bounded contexts, PostgreSQL 18 schema-per-module isolation, a custom System.Threading.Channels topic-routed pub/sub bus, end-to-end OpenTelemetry (Aspire Dashboard), plug-and-play OIDC auth, 49 boundary tests, and 8 SKILL.md workflows for AI coding agents.

When should a team choose a modular monolith over microservices?

Choose a modular monolith when your domain has multiple bounded contexts that evolve rapidly, share transactional velocity, or belong to a single engineering organization that should not pay distributed broker, network, and deployment overhead prematurely.

Can Orbit be adapted to our company’s business domain and OIDC provider?

Yes. Orbit ships with the domain-adaptation and configure-auth-idp skills for self-serve re-targeting, and Milan Jovanović also offers custom domain setup and source-code handoff engagements for teams.

Summary

Orbit gives .NET teams a battle-tested modular monolith baseline where every module owns its PostgreSQL 18 schema, asynchronous integration events travel over a topic-routed System.Threading.Channels bus with W3C OpenTelemetry trace continuity, and 8 composable agent skills keep both human developers and AI coding agents aligned.