Hexagonal Architecture
The KYC system is structured as 6 concentric rings — from the pure Domain Model at the core, outward through Services, Port Interfaces, Commands, Inbound Adapters, and AWS Infrastructure.
Layer Overview
1
Domain Model
Pure business entities — KYCProfile, FormSubmission, PartyIdentity
2
Service Layer
Business logic — KYCProfileService, FormOrchestrationService
3
Port Interfaces
Dependency inversion contracts — KYCRepository, EventPublisher
4
Command Layer
36 CQRS commands — CreateProfile, SubmitForm, ProcessEvent
5
Inbound Adapters
HTTP controllers, Lambda handlers, event consumers
6
AWS Infrastructure
DynamoDB, SQS, EventBridge, S3, Cognito, Lambda