This project demonstrates a simple implementation of Moduliths using Spring Boot ๐. Moduliths are a way to structure large applications, breaking them down into smaller, more manageable modules. In this tutorial, we'll be creating a simple system with two modules, Customer and Product.
The application is divided into the following major components:
- ModulithApplication: ๐ป The main entry point of the application.
- Customer Module: ๐ฅ Contains the
CustomerControllerwhich exposes a REST API endpoint at/customer. - Product Module: ๐ฆ Contains the
ProductControllerwhich exposes a REST API endpoint at/product.
Each of these components has its own gradle build script (build.gradle) and source code under src/main/java.
The root directory also contains a build.gradle which orchestrates the build process for all modules.
To build and run the application, you need to have Gradle installed on your machine. Navigate to the root directory of the application and run the following command:
./gradlew buildOnce the application has been built successfully, you can start it with the following command:
./gradlew runThe application exposes the following REST API endpoints:
-
/customer: Returns a test string "Test Customer". ๐งพ You can use this to verify that the CustomerController is working as expected. -
/product: Returns a test string "Test Product". ๐งพ You can use this to verify that the ProductController is working as expected.