Book Store is a comprehensive service for managing book purchases. It supports various operations including book catalog management, shopping cart functionality, and order processing.
- Assortment Management: Add, update, or remove books, and organize them into categories for efficient cataloging.
- Shopping Cart Operations: Manage the contents of shopping carts, facilitating easy checkout.
- Order Management: Administer and monitor the entire order fulfillment process.
- Java: 17
- Build Tool: Maven
- Framework: Spring Boot 3.2.0
- Spring Boot Web
- Spring Data JPA
- Spring Security
- Spring Validation
- Database: MySQL 8.0.33, H2 (for testing)
- ORM: Hibernate
- Versioning: Liquibase
- Testing: JUnit, Mockito, Spring Boot Starter Test, Docker Test Containers
- Containerization: Docker
- Utilities: Lombok, MapStruct, Swagger, JWT (for security)
Handles user registration and login, supporting both Basic and JWT authentication.
POST /api/auth/registration
: User registrationPOST /api/auth/login
: User login
Manages CRUD operations for books.
GET /api/books
: Retrieve all booksGET /api/books/{id}
: Retrieve a book by its IDPOST /api/books
: Create a new book (Admin only)PUT /api/books/{id}
: Update a book (Admin only)DELETE /api/books/{id}
: Delete a book (Admin only)
Handles category management and retrieves books by category.
GET /api/categories
: Retrieve all categoriesGET /api/categories/{id}
: Retrieve a category by its IDGET /api/categories/{id}/books
: Retrieve books by category IDPOST /api/categories
: Create a new category (Admin only)PUT /api/categories/{id}
: Update category information (Admin only)DELETE /api/categories/{id}
: Delete a category (Admin only)
Manages CRUD operations for orders.
GET /api/orders
: Retrieve order historyGET /api/orders/{order-id}/items
: Retrieve items from a specific orderGET /api/orders/{order-id}/items/{item-id}
: Retrieve a specific item from an orderPOST /api/orders
: Place a new orderPATCH /api/orders/{id}
: Update an order status (Admin only)
Handles CRUD operations for shopping cart items.
GET /api/cart
: Retrieve all items in the shopping cartPOST /api/cart
: Add an item to the shopping cartPUT /api/cart/cart-items/{cartItemId}
: Update the quantity of a specific item in the cartDELETE /api/cart/cart-items/{cartItemId}
: Remove an item from the cart
- Java: Ensure you have Java 17 installed.
- Docker: Docker is required to run the project in a containerized environment.
To run the application, create a .env
file in the root of your project and populate it with the following environment variables:
MYSQLDB_USER=user
MYSQLDB_DATABASE=yourdb
MYSQLDB_ROOT_PASSWORD=your_password
MYSQLDB_LOCAL_PORT=3307
MYSQLDB_DOCKER_PORT=3306
SPRING_LOCAL_PORT=8088
SPRING_DOCKER_PORT=8080
DEBUG_PORT=5005
- Clone the repository.
- Ensure Docker is running.
- Build the project using Maven:
mvn clean install
- Run the Docker containers:
docker-compose up
- Access the application via the provided endpoints.