Concrete domain: Order microservice.
POST /api/orders→ validates payload, persists in-memory (for demo), publishesorder.createdevent to Kafka.GET /actuator/health→ health.- OpenAPI docs at
/swagger-ui/index.html. - Unit tests (JUnit/Mockito) + Integration test with Testcontainers Kafka.
- GitHub Actions CI (build + test + package).
- Dockerfile +
docker-compose(Kafka/Zookeeper + app).
Goal: Show real-world structure with SOLID, TDD/BDD flavor, OpenAPI-first mindset, and DevOps artifacts.
# 1) Start infra
docker-compose up -d kafka zookeeper
# 2) Run app
./mvnw spring-boot:run
# 3) Create an order
curl -X POST http://localhost:8080/api/orders -H "Content-Type: application/json" -d '{
"customerId":"c-1001",
"items":[{"sku":"SKU-1","qty":2},{"sku":"SKU-2","qty":1}],
"currency":"TRY",
"total": 1299.90
}' -i
# 4) Swagger UI
open http://localhost:8080/swagger-ui/index.html./mvnw clean verifydocker build -t your-docker-user/order-events-spring-kafka:latest .
docker run -p 8080:8080 -e KAFKA_BOOTSTRAP_SERVERS=localhost:9092 your-docker-user/order-events-spring-kafka:latestkubectl apply -k k8s- SOLID: Controller → Service → Ports (Kafka), DTO & Mapper separation.
- Testing: Unit (Mockito), Integration (Testcontainers Kafka).
- OpenAPI:
src/main/resources/openapi.yaml+ springdoc UI. - DevOps: GitHub Actions CI, Dockerfile, K8s with Kustomize overlay.
By: Orçun