springboot-lambda Project Structure - Full Architectural Hierarchy (Complete) ๐Ÿš€

# Path / File Description Clean DDD Hexagonal CQRS Event-Driven Serverless
1๐Ÿ“ springboot-lambda/Project Root Directoryโœ“โœ“โœ“โœ“โœ“โœ“
2โ”œโ”€โ”€ ๐Ÿ“„ build.gradleGradle build script (Dependencies and Configuration)โœ“โœ“
3โ”œโ”€โ”€ ๐Ÿ“„ settings.gradleGradle settings for module resolutionโœ“โœ“
4โ”œโ”€โ”€ ๐Ÿ“œ template.yamlAWS SAM / CloudFormation template for serverless deploymentโœ“
5โ”œโ”€โ”€ ๐Ÿ“ src/Source code and test directoriesโœ“โœ“โœ“โœ“โœ“โœ“
6โ”‚ โ”œโ”€โ”€ ๐Ÿ“ main/Main production source codeโœ“โœ“โœ“โœ“โœ“โœ“
7โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ java/Java source files rootโœ“โœ“โœ“โœ“โœ“
8โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“ org/ldschurch/rest_api/Base package structure (Implied layers start here)โœ“โœ“โœ“โœ“โœ“
9โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿข domain/The core business logic (DDD)โœ“โœ“โœ“
10โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ‘ค model/Entities and Value Objectsโœ“โœ“โœ“
11โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ User.javaUser Aggregate Rootโœ“โœ“โœ“
12โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ โš™๏ธ service/Domain Servicesโœ“โœ“โœ“
13โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ BusinessRules.javaService for complex business rulesโœ“โœ“โœ“
14โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ข event/Domain Events structureโœ“โœ“โœ“โœ“
15โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ DomainEvent.javaBase interface/class for all eventsโœ“โœ“โœ“โœ“
16โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ UserCreatedEvent.javaSpecific domain eventโœ“โœ“โœ“โœ“
17โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ EventPublisher.javaDomain interface for event publishingโœ“โœ“โœ“โœ“
18โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ โœ๏ธ command/handlers/Domain logic handlers for commandsโœ“โœ“โœ“โœ“
19โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ UserCommandHandler.javaHandler for processing user commandsโœ“โœ“โœ“โœ“
20โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿงฉ application/Use Cases and Application Portsโœ“โœ“โœ“โœ“
21โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ฉ command/Command DTOs (Write side data)โœ“โœ“โœ“
22โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ CreateUserCommand.javaDTO for user creationโœ“โœ“โœ“
23โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ UpdateUserCommand.javaDTO for user updateโœ“โœ“โœ“
24โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ DeleteUserCommand.javaDTO for user deletionโœ“โœ“โœ“
25โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ CommandHandler.javaBase command handler interfaceโœ“โœ“โœ“
26โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ โ“ query/Query DTOs (Read side data)โœ“โœ“โœ“
27โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ GetUserQuery.javaDTO for retrieving a single userโœ“โœ“โœ“
28โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ListUsersQuery.javaDTO for retrieving a list of usersโœ“โœ“โœ“
29โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ QueryHandler.javaBase query handler interfaceโœ“โœ“โœ“
30โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ โžก๏ธ port/Boundary interfaces (Ports)โœ“โœ“โœ“โœ“โœ“
31โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ input/Primary/Driving Ports (APIs exposed by the application)โœ“โœ“โœ“โœ“
32โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ CommandUseCase.javaInterface for use cases that modify dataโœ“โœ“โœ“
33โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ QueryUseCase.javaInterface for use cases that retrieve dataโœ“โœ“โœ“
34โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ EventHandlerUseCase.javaInterface for use cases responding to eventsโœ“โœ“โœ“โœ“
35โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ โฌ…๏ธ output/Secondary/Driven Ports (Dependencies of the application)โœ“โœ“โœ“โœ“โœ“
36โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ UserWriteRepositoryPort.javaPort for writing to the command-side databaseโœ“โœ“โœ“โœ“
37โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ UserReadRepositoryPort.javaPort for reading from the query-side databaseโœ“โœ“โœ“โœ“
38โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ EventPublisherPort.javaPort for notifying external systems of eventsโœ“โœ“โœ“โœ“
39โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ โœ… service/Implementations of the Use Cases (Business workflows)โœ“โœ“โœ“โœ“
40โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ command/CreateUserService.javaImplements user creation workflow (Command)โœ“โœ“โœ“
41โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ command/UpdateUserService.javaImplements user update workflow (Command)โœ“โœ“โœ“
42โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ command/DeleteUserService.javaImplements user deletion workflow (Command)โœ“โœ“โœ“
43โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ query/GetUserService.javaImplements single user retrieval workflow (Query)โœ“โœ“โœ“
44โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ query/ListUsersService.javaImplements list retrieval workflow (Query)โœ“โœ“โœ“
45โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ EventDrivenService.javaService handling event responses/reactionsโœ“โœ“โœ“
46โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ”Œ adapter/External infrastructure implementations (Adapters)โœ“โœ“โœ“โœ“โœ“โœ“
47โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐ŸŒ rest/REST API Adapters (Inbound/Driving)โœ“โœ“โœ“
48โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ command/UserCommandController.javaSpring Controller for commands (POST, PUT, DELETE)โœ“โœ“โœ“
49โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ command/HealthCheckController.javaController for application health check endpointโœ“โœ“
50โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ query/UserQueryController.javaSpring Controller for queries (GET)โœ“โœ“โœ“
51โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ’พ persistence/Database Adapters (Outbound/Driven)โœ“โœ“โœ“โœ“
52โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ read/JpaUserReadRepositoryAdapter.javaJPA implementation for UserReadRepositoryPort (Query side)โœ“โœ“โœ“โœ“
53โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ write/JpaUserWriteRepositoryAdapter.javaJPA implementation for UserWriteRepositoryPort (Command side)โœ“โœ“โœ“โœ“
54โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ฮป lambda/Serverless Lambda Handlers (Inbound/Driving)โœ“โœ“โœ“โœ“
55โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ CommandLambdaHandler.javaAWS Lambda entry point for command events (e.g., API Gateway POST)โœ“โœ“โœ“โœ“
56โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ QueryLambdaHandler.javaAWS Lambda entry point for query events (e.g., API Gateway GET)โœ“โœ“โœ“โœ“
57โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ’ฌ events/Event System Adapters (Inbound/Outbound)โœ“โœ“โœ“โœ“โœ“
58โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ KafkaEventPublisherAdapter.javaAdapter to publish events to Kafkaโœ“โœ“โœ“โœ“
59โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ SnsEventPublisherAdapter.javaAdapter to publish events to AWS SNSโœ“โœ“โœ“โœ“โœ“
60โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ SqsEventListener.javaAdapter to consume events from AWS SQSโœ“โœ“โœ“โœ“โœ“
61โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ EventDeserializer.javaUtility for deserializing incoming event payloadsโœ“โœ“โœ“
62โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ’‰ config/Spring Dependency Injection Configurationโœ“โœ“
63โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ BeanConfig.javaGeneral Spring `@Configuration` for use cases/portsโœ“โœ“
64โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ KafkaConfig.javaConfiguration for Kafka connectionsโœ“โœ“โœ“
65โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ SnsConfig.javaConfiguration for AWS SNS connectionsโœ“โœ“โœ“โœ“
66โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ SqsConfig.javaConfiguration for AWS SQS connectionsโœ“โœ“โœ“โœ“
67โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ—๏ธ infrastructure/Cross-Cutting Concerns and shared utilitiesโœ“โœ“
68โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿชž tracing/LoggingAspect.javaAOP component for logging/tracingโœ“โœ“
69โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ TracingInterceptor.javaInterceptor for distributed tracing contextโœ“โœ“
70โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ›‘ exception/GlobalExceptionHandler.javaCentralized error handling for APIs/Lambdasโœ“โœ“
71โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“Š metrics/MetricsCollector.javaUtility for application performance monitoringโœ“โœ“
72โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿš€ SpringbootLambdaApplication.javaMain Spring Boot entry point and configuration starterโœ“โœ“
73โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“ resources/Configuration and static contentโœ“โœ“
74โ”‚ โ”‚ โ”œโ”€โ”€ โš™๏ธ application.ymlPrimary Spring Boot configuration fileโœ“โœ“
75โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ logback-spring.xmlConfiguration file for logging frameworkโœ“โœ“
76โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ static/Static web content directoryโœ“โœ“
77โ”‚ โ””โ”€โ”€ ๐Ÿงช test/Test source rootโœ“โœ“
78โ”‚ โ””โ”€โ”€ ๐Ÿ“ java/.../application/command/Unit tests for Application Command Servicesโœ“โœ“โœ“
79โ”‚ โ””โ”€โ”€ CreateUserServiceTest.javaUnit test for CreateUserServiceโœ“โœ“โœ“
80โ”‚ โ””โ”€โ”€ ๐Ÿ“ java/.../adapter/persistence/write/Integration tests for Write Adaptersโœ“โœ“โœ“โœ“
81โ”‚ โ””โ”€โ”€ JpaUserWriteRepositoryAdapterTest.javaTest for the JPA implementation of the write portโœ“โœ“โœ“โœ“
82โ”‚ โ””โ”€โ”€ events/KafkaEventPublisherAdapterTest.javaTest for Kafka event publishing functionalityโœ“โœ“โœ“โœ“
83โ””โ”€โ”€ ๐Ÿ“ build/distributions/Generated build artifactsโœ“โœ“
84    โ””โ”€โ”€ springboot-lambda-0.0.1-SNAPSHOT.zipFinal deployable package (for Lambda)โœ“โœ“