$ show agelenler/food-ordering-system
This repository implements a food ordering system using a microservices architecture with four services: customer, order, payment, and restaurant. It employs Domain-Driven Design, clean/hexagonal architecture, and patterns such as Saga for distributed transactions, Outbox for reliable messaging, and CQRS for separating commands and queries. Services communicate asynchronously via Kafka with Avro serialization. The system includes REST APIs for customer and order operations, and uses Spring Boot with JPA for persistence.
The LLM identified 4 files worth highlighting for reuse:
A generic scheduler that ensures reliable message delivery by periodically publishing outbox messages. It is decoupled from specific message types and repositories via interfaces, allowing reuse across services.
Defines the contract for a step in a Saga, including processing and compensation methods. Enables implementation of distributed transactions across services by defining a sequence of steps with corresponding rollback actions.
Encapsulates an amount and currency, providing arithmetic operations, comparison, and formatting. Prevents primitive obsession and ensures money values are always valid, a reusable DDD building block.
Provides centralized exception handling for REST controllers, converting exceptions to appropriate HTTP responses with error details. Extended by service-specific handlers for customization, demonstrating a template method pattern.