This project demonstrates how to build a modular monolith using Spring Boot 3.5.5 and Spring Modulith. It features a clean separation of concerns with distinct modules (Product and Order) while maintaining a single deployable unit.
- Java 17 or higher
- Gradle (included via wrapper)
./gradlew build./gradlew bootRunThe application will start on http://localhost:8080
./gradlew testGET /api/products/hello- Product module greetingGET /api/orders/hello- Order module greeting
src/main/kotlin/com/example/springmonolith/
├── SpringmonolithApplication.kt # Main application entry point
├── product/ # Product module
│ ├── ProductController.kt
│ └── ProductService.kt
└── order/ # Order module
├── OrderController.kt
└── OrderService.kt
The application is organized into logical modules:
- Product Module: Handles product-related functionality
- Order Module: Handles order-related functionality
Each module is self-contained with its own controllers and services, demonstrating modulith boundaries.