├── .sdkmanrc ├── src ├── main │ ├── resources │ │ ├── static │ │ │ ├── css │ │ │ │ └── styles.css │ │ │ └── images │ │ │ │ └── books.png │ │ ├── db │ │ │ └── migration │ │ │ │ ├── __root │ │ │ │ └── V1__create_events_schema.sql │ │ │ │ ├── orders │ │ │ │ ├── V1__create_orders_schema.sql │ │ │ │ ├── V4__orders_add_user_id_to_orders_table.sql │ │ │ │ ├── V3__orders_add_orders_data.sql │ │ │ │ └── V2__orders_create_orders_table.sql │ │ │ │ ├── users │ │ │ │ ├── V1__create_users_schema.sql │ │ │ │ ├── V3__users_add_users_data.sql │ │ │ │ └── V2__create_users_table.sql │ │ │ │ ├── catalog │ │ │ │ ├── V1__create_catalog_schema.sql │ │ │ │ ├── V2__catalog_create_products_table.sql │ │ │ │ └── V3__catalog_add_books_data.sql │ │ │ │ └── inventory │ │ │ │ ├── V1__create_inventory_schema.sql │ │ │ │ └── V2__inventory_create_inventory_table.sql │ │ ├── templates │ │ │ ├── partials │ │ │ │ ├── orders.html │ │ │ │ ├── pagination.html │ │ │ │ ├── products.html │ │ │ │ ├── cart.html │ │ │ │ └── order-form.html │ │ │ ├── products.html │ │ │ ├── registration-success.html │ │ │ ├── cart.html │ │ │ ├── orders.html │ │ │ ├── login.html │ │ │ ├── registration.html │ │ │ ├── layout.html │ │ │ └── order_details.html │ │ ├── certs │ │ │ ├── public.pem │ │ │ ├── keypair.pem │ │ │ └── private.pem │ │ └── application.properties │ └── java │ │ └── com │ │ └── sivalabs │ │ └── bookstore │ │ ├── config │ │ ├── package-info.java │ │ ├── WebMvcConfig.java │ │ ├── CommonSecurityConfig.java │ │ ├── OpenApiConfig.java │ │ ├── RabbitMQConfig.java │ │ ├── WebSecurityConfig.java │ │ ├── JwtSecurityConfig.java │ │ └── ApiSecurityConfig.java │ │ ├── users │ │ ├── package-info.java │ │ ├── domain │ │ │ ├── CreateUserCmd.java │ │ │ ├── UserDto.java │ │ │ ├── JwtToken.java │ │ │ ├── UserMapper.java │ │ │ ├── UserRepository.java │ │ │ ├── Role.java │ │ │ ├── UserService.java │ │ │ ├── SecurityUserDetailsService.java │ │ │ ├── JwtTokenHelper.java │ │ │ ├── SecurityUser.java │ │ │ └── UserEntity.java │ │ ├── UserContextUtils.java │ │ └── web │ │ │ ├── UserController.java │ │ │ └── UserRestController.java │ │ ├── catalog │ │ ├── package-info.java │ │ ├── domain │ │ │ ├── ProductRepository.java │ │ │ ├── ProductNotFoundException.java │ │ │ ├── ProductService.java │ │ │ └── ProductEntity.java │ │ ├── ProductDto.java │ │ ├── mappers │ │ │ └── ProductMapper.java │ │ ├── ProductApi.java │ │ └── web │ │ │ ├── CatalogExceptionHandler.java │ │ │ ├── ProductWebController.java │ │ │ └── ProductRestController.java │ │ ├── orders │ │ ├── CreateOrderResponse.java │ │ ├── domain │ │ │ ├── models │ │ │ │ ├── package-info.java │ │ │ │ ├── OrderStatus.java │ │ │ │ ├── OrderCreatedEvent.java │ │ │ │ ├── Customer.java │ │ │ │ └── OrderItem.java │ │ │ ├── OrderRepository.java │ │ │ ├── ProductServiceClient.java │ │ │ ├── OrderService.java │ │ │ └── OrderEntity.java │ │ ├── InvalidOrderException.java │ │ ├── package-info.java │ │ ├── OrderView.java │ │ ├── web │ │ │ ├── OrderForm.java │ │ │ ├── CartUtil.java │ │ │ ├── OrdersExceptionHandler.java │ │ │ ├── Cart.java │ │ │ ├── CartController.java │ │ │ ├── OrderRestController.java │ │ │ └── OrderWebController.java │ │ ├── OrderNotFoundException.java │ │ ├── OrderDto.java │ │ ├── CreateOrderRequest.java │ │ ├── OrdersApi.java │ │ └── mappers │ │ │ └── OrderMapper.java │ │ ├── inventory │ │ ├── package-info.java │ │ ├── InventoryRepository.java │ │ ├── OrderEventInventoryHandler.java │ │ ├── InventoryEntity.java │ │ └── InventoryService.java │ │ ├── notifications │ │ ├── package-info.java │ │ └── OrderEventNotificationHandler.java │ │ ├── common │ │ ├── package-info.java │ │ └── models │ │ │ └── PagedResult.java │ │ ├── BookStoreApplication.java │ │ └── ApplicationProperties.java └── test │ ├── java │ └── com │ │ └── sivalabs │ │ └── bookstore │ │ ├── TestBookStoreApplication.java │ │ ├── BookStoreApplicationTests.java │ │ ├── ModularityTests.java │ │ ├── inventory │ │ └── InventoryIntegrationTests.java │ │ ├── TestcontainersConfiguration.java │ │ ├── catalog │ │ └── web │ │ │ └── ProductRestControllerTests.java │ │ ├── users │ │ └── web │ │ │ └── UserRestControllerTests.java │ │ └── orders │ │ └── web │ │ └── OrderRestControllerTests.java │ └── resources │ └── test-products-data.sql ├── docs └── bookstore-modulith.png ├── renovate.json ├── .mvn └── wrapper │ └── maven-wrapper.properties ├── .github ├── dependabot.yml └── workflows │ └── maven.yml ├── http_requests.http ├── k8s ├── kind │ ├── kind-config.yml │ ├── kind-cluster.sh │ └── kind-cluster.ps1 ├── manifests │ ├── zipkin.yaml │ ├── postgres.yaml │ ├── rabbitmq.yaml │ └── app.yaml ├── check-ready.sh └── check-ready.ps1 ├── .gitignore ├── compose.yml ├── Taskfile.yml ├── README.md ├── mvnw.cmd ├── LICENSE └── mvnw /.sdkmanrc: -------------------------------------------------------------------------------- 1 | java=25-tem 2 | maven=3.9.11 3 | -------------------------------------------------------------------------------- /src/main/resources/static/css/styles.css: -------------------------------------------------------------------------------- 1 | #app { 2 | padding-top: 90px; 3 | } -------------------------------------------------------------------------------- /src/main/resources/db/migration/__root/V1__create_events_schema.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA events; 2 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/orders/V1__create_orders_schema.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA orders; 2 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/users/V1__create_users_schema.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA users; 2 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/catalog/V1__create_catalog_schema.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA catalog; 2 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/inventory/V1__create_inventory_schema.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA inventory; 2 | -------------------------------------------------------------------------------- /docs/bookstore-modulith.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sivaprasadreddy/spring-modular-monolith/HEAD/docs/bookstore-modulith.png -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/static/images/books.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sivaprasadreddy/spring-modular-monolith/HEAD/src/main/resources/static/images/books.png -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookstore/config/package-info.java: -------------------------------------------------------------------------------- 1 | @NullMarked 2 | package com.sivalabs.bookstore.config; 3 | 4 | import org.jspecify.annotations.NullMarked; 5 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookstore/users/package-info.java: -------------------------------------------------------------------------------- 1 | @NullMarked 2 | package com.sivalabs.bookstore.users; 3 | 4 | import org.jspecify.annotations.NullMarked; 5 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookstore/catalog/package-info.java: -------------------------------------------------------------------------------- 1 | @NullMarked 2 | package com.sivalabs.bookstore.catalog; 3 | 4 | import org.jspecify.annotations.NullMarked; 5 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookstore/orders/CreateOrderResponse.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookstore.orders; 2 | 3 | public record CreateOrderResponse(String orderNumber) {} 4 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookstore/inventory/package-info.java: -------------------------------------------------------------------------------- 1 | @NullMarked 2 | package com.sivalabs.bookstore.inventory; 3 | 4 | import org.jspecify.annotations.NullMarked; 5 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookstore/notifications/package-info.java: -------------------------------------------------------------------------------- 1 | @NullMarked 2 | package com.sivalabs.bookstore.notifications; 3 | 4 | import org.jspecify.annotations.NullMarked; 5 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookstore/users/domain/CreateUserCmd.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookstore.users.domain; 2 | 3 | public record CreateUserCmd(String name, String email, String password, Role role) {} 4 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookstore/users/domain/UserDto.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookstore.users.domain; 2 | 3 | public record UserDto(Long id, String name, String email, String password, Role role) {} 4 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | wrapperVersion=3.3.4 2 | distributionType=only-script 3 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip 4 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookstore/users/domain/JwtToken.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookstore.users.domain; 2 | 3 | import java.time.Instant; 4 | 5 | public record JwtToken(String token, Instant expiresAt) {} 6 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookstore/common/package-info.java: -------------------------------------------------------------------------------- 1 | @ApplicationModule(type = ApplicationModule.Type.OPEN) 2 | package com.sivalabs.bookstore.common; 3 | 4 | import org.springframework.modulith.ApplicationModule; 5 | -------------------------------------------------------------------------------- /src/main/java/com/sivalabs/bookstore/orders/domain/models/package-info.java: -------------------------------------------------------------------------------- 1 | @NamedInterface("order-models") 2 | package com.sivalabs.bookstore.orders.domain.models; 3 | 4 | import org.springframework.modulith.NamedInterface; 5 | -------------------------------------------------------------------------------- /src/main/resources/templates/partials/orders.html: -------------------------------------------------------------------------------- 1 |
| Order ID | 18 |Status | 19 |
|---|
13 |
14 | product.price
23 || Product Name | 11 |Price | 12 |Quantity | 13 |Sub Total | 14 |
|---|---|---|---|
| [[${cart.item.name}]] | 19 |[[${cart.item.price}]] | 20 |21 | 31 | | 32 |[[${cart.item.quantity * cart.item.price}]] | 33 |
| 38 | | 39 | Total Amount: [[${cart.totalAmount}]] 40 | | 41 |||
| Product Name | 19 |Price | 20 |Quantity | 21 |Sub Total | 22 |
|---|---|---|---|
| name | 27 |price | 28 |quantity | 29 |SubTotal | 30 |
| 35 | | 36 | Total Amount: totalAmount 37 | | 38 |||