Component Diagrams¶
Executive Summary¶
Component Diagrams provides C4-style Level 3 diagrams for the Spring Boot Modulith backend. These diagrams describe logical components, module boundaries, internal events, AIOS boundaries, and outbox alignment.
Why This Exists¶
The container view identifies the Spring Boot Modulith backend as Algosure's core application container. Component diagrams show how the backend should be decomposed without defining code or final infrastructure.
Owner¶
The owner is the Chief Product Officer and Enterprise Architect.
Business Value¶
The diagrams help teams preserve DDD module ownership, event-driven coordination, security, tenant isolation, AIOS governance, and the Architecture Mirror Principle.
Spring Boot Modulith Component Diagram¶
flowchart TB
subgraph Backend["Spring Boot Modulith Backend"]
API[API Boundary Components]
Security[Security and Tenant Context]
App[Application Services]
Domain[Aggregates, Entities, Value Objects]
DomainServices[Domain Services]
Repositories[Module-Owned Repositories]
Events[Internal Domain Events]
Outbox[Outbox Boundary]
AIOS[AIOS Integration Boundary]
Integration[Integration Boundary]
Shared[Minimal Shared Kernel]
end
API --> Security
Security --> App
App --> Domain
App --> DomainServices
App --> Repositories
Domain --> Events
DomainServices --> Events
Events --> Outbox
App --> AIOS
App --> Integration
Shared --> API
Shared --> App
Shared --> Domain
Domain Module Diagram¶
flowchart LR
subgraph Modules["Domain-Aligned Modulith Modules"]
Identity[Identity]
Organization[Organization]
Compliance[Compliance]
Opportunity[Opportunity]
Bid[Bid]
Contract[Contract]
Supplier[Supplier]
Marketplace[Marketplace]
Funding[Funding]
Learning[Learning]
Intelligence[Intelligence]
Notification[Notification]
Analytics[Analytics]
Billing[Billing]
Administration[Administration]
end
Identity --> Organization
Billing --> Identity
Organization --> Compliance
Organization --> Opportunity
Organization --> Bid
Organization --> Contract
Organization --> Supplier
Organization --> Funding
Opportunity --> Bid
Bid --> Contract
Contract --> Funding
Supplier --> Marketplace
Marketplace --> Supplier
Intelligence --> Opportunity
Intelligence --> Bid
Intelligence --> Compliance
Notification --> Analytics
Analytics --> Administration
Standard Module Interior¶
flowchart TB
Inbound[Inbound API or Event Handler]
Application[Application Service]
Policy[Policy and Authorization]
Aggregate[Aggregate / Entity]
DomainService[Domain Service]
Repository[Repository]
Event[Domain Event]
Outbox[Outbox Record]
Projection[Owned Projection]
Inbound --> Application
Application --> Policy
Application --> Aggregate
Application --> DomainService
Application --> Repository
Aggregate --> Event
DomainService --> Event
Event --> Outbox
Event --> Projection
Event and Outbox Diagram¶
sequenceDiagram
participant API as API Boundary
participant App as Application Service
participant Domain as Domain Model
participant Repo as Module Repository
participant Outbox as Outbox Boundary
participant Subscriber as Subscriber Module
API->>App: Execute tenant-scoped command
App->>Domain: Apply business behavior
Domain-->>App: Domain event
App->>Repo: Persist owned state
App->>Outbox: Record event for reliable delivery
Outbox->>Subscriber: Deliver business event
Subscriber-->>Subscriber: React through own application service
AIOS Boundary Diagram¶
flowchart LR
Module[Owning Domain Module]
App[Module Application Service]
Intelligence[Intelligence Module]
AIOS[AIOS Integration Boundary]
Memory[Semantic Memory Boundary]
Human[Human Approval]
Module --> App
App --> Intelligence
Intelligence --> AIOS
AIOS --> Memory
AIOS --> Intelligence
Intelligence --> App
App --> Human
Human --> App
App --> Module
Database Ownership Diagram¶
flowchart LR
ModuleA[Module A]
RepoA[Module A Repository]
DataA[(Module A Owned Records)]
ModuleB[Module B]
RepoB[Module B Repository]
DataB[(Module B Owned Records)]
Event[Domain Event or API Contract]
ModuleA --> RepoA
RepoA --> DataA
ModuleB --> RepoB
RepoB --> DataB
ModuleA --> Event
Event --> ModuleB
Diagram Notes¶
- These are C4 Level 3 logical component diagrams.
- The backend is a Spring Boot Modulith, not a god module.
- Each Domain maps to one module where practical.
- Shared kernel is minimal and does not own business behavior.
- Repositories and database records are module-owned.
- Internal events and outbox alignment support future-safe event delivery.
- AIOS integration is governed through Intelligence and module-owned application services.
- API boundaries belong to the module that owns the use case or query.