Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 1.23 KB

README.md

File metadata and controls

62 lines (42 loc) · 1.23 KB

Redis Shopping Cart Example

This project is a simple shopping cart example built with Spring Boot and Redis. The project allows users to add products to the cart, perform stock checks, and view the contents of their cart.

Features

  • Add products for users
  • Stock check
  • View user's cart

Technologies Used

  • Spring Boot
  • Redis
  • Docker

Getting Started

To run the project on your local machine, follow these steps.

Prerequisites

  • Java 11 or higher
  • Maven
  • Docker

Installation

  1. Clone the project:
git clone https://github.com/ardasdasdas/redis-shopping-cart.git
  1. Navigate to the project directory:
cd redis-shopping-cart
  1. Start Redis and Redis Insight containers with Docker Compose:
docker-compose up
  1. Run the Spring Boot application:
mvn spring-boot:run

Usage

POST http://localhost:8080/v1/cart-api/product/add Content-Type: application/json

POST http://localhost:8080/v1/cart-api/product/add-all Content-Type: application/json

POST http://localhost:8080/v1/cart-api/cart/add/{{userId}}/{{productId}} Content-Type: application/x-www-form-urlencoded

GET http://localhost:8080/v1/cart-api/cart/{{userId}}

GET http://localhost:8080/v1/cart-api/product/find-all