How gaetanbloch/meal-order works
Project type and purpose
• This is a multi-module, event-driven microservices system for processing “meal orders.”
• It uses Domain-Driven Design (DDD), Hexagonal (Ports & Adapters) architecture, CQRS for commands/queries, the Outbox pattern with Debezium for reliable event publication, and Saga orchestration for long-running business transactions.
File structure
• Top-level modules:
• common – shared kernel (core DDD annotations, validation, Outbox+Debezium setup, Avro schemas)
• customer – Customer bounded context microservice
• order – Order bounded context microservice
• payment – Payment bounded context microservice
• restaurant – Restaurant bounded context microservice
• Each module follows the same layered structure:
• application/cqrs (command/query handlers)
• application/port/input + output (use case interfaces)
• domain (entities, value objects, events, services)
• infrastructure/adapter (secondary adapters for persistence, messaging)
• presentation/adapter (primary adapters – REST resources)
• Shared configuration: each service has its own application.properties and Maven pom.xml; all share the common module.
Key architectural insights from README
• Minimal README suggests “meal-order” orchestrates all contexts.
• Avro schemas in common/src/main/resources/avro specify the contract for messages exchanged over Kafka.
Detail
• Four bounded context services plus the common library
• Full Outbox→Debezium→Kafka→Consumer cycle for each service
• Saga steps across services (e.g., OrderCreated → PaymentRequested → PaymentCompleted → RestaurantApprovalRequested → RestaurantApproved → OrderCompleted)
• Don’t omit the Schema Registry / Avro schema definitions