Components

Rather than one big mess, there are 50 business modules, each its own project, and they talk to each other only through a narrow seam. The map below is generated from the solution.

The components, layered: business modules over the contracts seam over the infrastructure50 business modules in a grid. Below them the two contracts assemblies that are the only things a module may reference. Below those, the platform and the hosts.BUSINESS MODULES · 50 projects · 98 aggregates · no module references anotherAccounting.Books2 aggAccounting.IntegrityserviceAttachments.Alerts1 aggAttachments.Files1 aggAttachments.Notes1 aggAuthorisation4 aggAutomation.AssistantserviceAutomation.DayEndserviceAutomation.ImportserviceAutomation.Storyboards1 aggCards.Acquiring3 aggCards.Issuing2 aggChannels.ClientChannel6 aggChannels.Metering1 aggChannels.ServiceEnrolment3 aggCompliance.Clearances1 aggCompliance.Identifications1 aggCompliance.Regulatory4 aggCompliance.Tax2 aggCorrespondence3 aggDocuments.Signing1 aggDocuments.Statements2 aggDocuments.Templates2 aggGlobalization.CountriesserviceGlobalization.Currencies1 aggGlobalization.LanguagesserviceLending.Collections5 aggLending.CreditRiskserviceLending.Limits2 aggLending.Securities2 aggPayments.BankStatements9 aggPayments.Cashier3 aggPayments.Electronic10 aggPayments.Liquidity4 aggPayments.Suspense1 aggPayments.VirtualAccounts6 aggPricing.Changes1 aggPricing.Plans2 aggPricing.PriceListsservicePricing.RatesserviceProductsserviceReferenceData.LookupsserviceReferenceData.MarketDataserviceRegistry.Accounts3 aggRegistry.Counterparties2 aggRegistry.OperatingEntities2 aggRegistry.Structures1 aggSchedulingserviceTasks2 aggWarehouse1 aggreferences go one way: down, and only to theseContractsthe business seam: typed identifiers, events, queries, resolver interfaces. Never a domain object, never a table.Runtime.Contractsthe platform seam: access control, settings, features, messaging, the AI client.INFRASTRUCTURE · implements the platform seam; the hosts compose everything into the deployablePLATFORMRuntime.BlobStorageRuntime.CachingRuntime.EdgeRuntime.HostingRuntime.IdentityRuntime.InfrastructureRuntime.MigrationsRuntime.ScriptingHOSTSRuntime.Hosting.ApiRuntime.Hosting.AspireRuntime.Hosting.Client.ApiRuntime.Hosting.Client.GatewayRuntime.Hosting.GatewayRuntime.Hosting.MigrationsRuntime.Hosting.Worker
The two dots on a module say which seams it references: blue for the business contracts and grey for the platform contracts, and nothing else. No module references another module's implementation, and the build fails on any new attempt to.

Each module is a bounded context: its own aggregates, its own tests, its own project.

Accounts, payments, books, collections, compliance, structures and the rest are separate compiled units. A module knows its own subject matter and nothing else. Its internals, the aggregates, handlers and projections, are not visible to any other module, so they can change without anyone outside noticing.

The seam

Two contracts assemblies, nothing else

Business contracts carry the identifiers, events, queries and resolvers that modules share, and infrastructure contracts carry access control, settings, features and messaging. A module may reference those two, but never another module.

Narrow on purpose

What crosses the seam is a typed id, an event, a query or a resolver interface, and never a domain object, a database or a projection. A module hydrates what it needs at projection time from the contracts instead of reaching into another one.

Enforced by the build

An implementation-to-implementation reference between feature projects is a hard stop. The architecture tests fail the build on a new one, and the few that predate the rule are listed as debt so nobody mistakes them for precedent.

Hosts compose, modules do not

The API, the worker, the gateway and the day-end host are the only places that see every module, because they assemble the deployable. A module never sees the host.

Inside a module

One file for each thing the business does

Most of us learned to build software in layers, with a folder for controllers, one for services, one for repositories and one for the DTOs, and adding a single field meant a trip through all four, plus the mapper nobody remembered was there. We built systems like that for years. It works, but every change is spread thin across the codebase, and the parts that belong together are never in the same place.

Inside a LedgerTM module the code is cut the other way, by what the business does, which the trade calls vertical slice architecture. Activating an account is one file: the command, the rules that validate it, the checks it has to pass, the handler that records the event and the endpoint that receives the request, a few hundred lines in all. The accounts module has several dozen of those. If you want to know what activating an account involves, you open one file and read it from the top.

That matters more now than it used to, because the reader is often an AI. An agent working on a slice has the whole feature in front of it and very little else, so it doesn't have to guess what a change in one folder does to three others. It's a good part of the reason cards went from the first prompt to a working product in five days.

Why this is the hard part

Designing the bounded contexts is the work that decides whether a banking system stays maintainable.

Where does a facility end and a limit begin? Is a structure a thing or a grouping? Which of counterparty, account and operating entity owns a bank account? Get these wrong and every feature after them fights the model. In LedgerTM they are settled, with the reasoning in the decision records, and the rule that keeps them settled is in the build.

What ships

  • 50 business modules, 98 aggregates between them
  • 22 contracts assemblies: the whole public surface
  • 8 platform projects: storage, messaging, migrations
  • 7 hosts that compose them into the deployable
  • 0 cross-module references carried as listed debt

A module can be read, tested, replaced or switched off on its own, so a capability you license is a project you can point at, and the model that makes that true is already drawn.