Skip to content

Module Standard

Executive Summary

Module Standard defines the required engineering documentation and structure for each Spring Boot Modulith module.

Required Module Fields

Every module must define:

Field Requirement
Purpose What business Domain the module implements.
Domain ownership Source facts, lifecycle state, rules, and decisions owned by the module.
Package structure Module package under com.algoza.algosure.<module>.
Aggregate package Aggregates in domain.model.
Entity package Entities in domain.model.
Value object package Value objects in domain.model.
Command package Commands in application.command.
Query package Queries in application.query.
Application service package Use-case services in application.service.
Domain service package Domain services in domain.service.
Repository package Module-owned repositories in infrastructure.persistence.
Event package Domain events in domain.event.
API/controller package REST API boundary in api.rest.
Mapper package API and application mappers in api.mapper.
Test package Tests under matching module package.
Allowed dependencies Approved module, shared kernel, event, API, or service dependencies.
Forbidden dependencies Repositories, aggregates, tables, internal services, and infrastructure of other modules.
Events published Past-tense domain events published by the module.
Events consumed Events consumed from other modules.
Database ownership Owned tables, schemas, or persistence area at architecture level.
AIOS interaction boundary Application services or internal APIs AIOS may use.
Future microservice extraction considerations Contracts, events, persistence, and operational needs for possible extraction.

Standard Module Template

<module>
  Purpose:
  Domain ownership:
  Packages:
  Allowed dependencies:
  Forbidden dependencies:
  Events published:
  Events consumed:
  Database ownership:
  AIOS interaction boundary:
  Future extraction:

Required Modules

Module Domain
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

Standard Dependencies

Dependency Type Default
Shared kernel Allowed for approved primitives only.
Identity Allowed through authorization APIs and events, not repositories.
Organization Allowed through organization context APIs and events, not repositories.
Billing Allowed through entitlement APIs and events, not repositories.
Intelligence Allowed through AIOS application service boundaries and events.
Notification Allowed by publishing notification intent events or calling approved application services.
Analytics Allowed through events and projections.