The Cart Service is a meticulously designed component that facilitates customers in selecting items from the store's website and managing their shopping carts. It leverages a robust architecture to handle the complexities of cart management, providing a seamless experience for users.
We must configure MySQL as the persistent store destination.
- Setup axon-server and MySQL docker images
local-dev > docker compose up -d
- Run the application
cart-service > mvn clean springboot:run
- Endpoint for resting
- Generate a request for add to cart.
curl --location 'http://localhost:9094/cart/add' \
--header 'Content-Type: application/json' \
--data '{
"productId": "199",
"quantity": 1,
"userId": "1652"
}'
- Generate a request for remove to cart.
curl --location 'http://localhost:9094/cart/remove' \
--header 'Content-Type: application/json' \
--data '{
"productId": "205",
"quantity": 1,
"userId": "1652"
}'
- Generate a request to get cart contents.
curl --location 'http://localhost:9094/cart/get' \
--header 'Content-Type: application/json' \
--data '{
"userId": "1652"
}'
We have integrated sonar in our project for inspection of code quality to perform automatic reviews with static analysis of code to detect bugs, code smells, and security.
Execute the following Maven command to run Sonar analysis:
mvn clean verify sonar:sonar
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.