Free Projects

Building a Bookstore with Java Spring Boot and MySQL: Features, Guide, and Insights

Bookstore with Java Spring Boot
Bookstore with Java Spring Boot

Bookstore with Java Spring Boot and MySQL

Overview

Bookstore with Java Spring Boot and MySQL is a robust and user-friendly Java Spring Boot application designed for managing and selling books. It organizes books into various categories and streamlines their addition, sale, and record management.

Download New Real Time Projects :-Click here

Project Details

Project NameBookStore
LanguageJava
FrameworkSpring Boot
DatabaseMySQL
Developer

Categories Supported

  1. LITERATURE
  2. NONFICTION
  3. ACTION
  4. THRILLER
  5. TECHNOLOGY
  6. DRAMA
  7. POETRY
  8. MEDIA
  9. OTHERS

 

Database Details

The application uses a MySQL database named bookstore, which contains a single table, book. The table includes the following columns:

Column NameDescription
idUnique identifier for each book
authorAuthor of the book
titleTitle of the book
categoryBook category (enum-based)
pricePrice of the book
total_countTotal number of copies available
soldNumber of copies sold

Key Features

1. Book Addition

  • Add New Book: Register a book thats not already in the system with endpoint /api/add-new-book.
  • Add Copies to Existing Book: Update the inventory of an existing book with endpoint /api/add-book.

2. Fetch Book Details

  • Get Book by ID: Retrieve book details by its ID with endpoint /api/book/{id}.
  • Get All Books: List all registered books via /api/book-list.
  • Get Number of Books Available by ID: Use /api/number-of-books/{id} to find the available count.

3. Update Book Details

Update book information using the endpoint /api/books/{id}.

4. Selling Books

  • Sell a Single Book: Endpoint /api/sell-book/{id} sells one copy of a book by its ID.
  • Sell Multiple Books: Use /api/sell-books to process multiple book sales.

5. Advanced Search

  • Search by Category and Keyword: /api/books?keyword=keyword&category=category searches books based on category and keyword.
  • Get Sales Data: /api/number-of-books?keyword=keyword&category=category retrieves the number of books sold per category.

Tools and Frameworks

Tool/FrameworkPurpose
MySQLRelational database for data storage
JPA/HibernateORM for database communication
JUnit/MockitoUnit testing frameworks used in the controller and service layers
JacocoCode coverage tool for generating test reports
LombokSimplifies Java code with annotations for Getters, Setters, and Constructors
ModelMapperObject mapping tool for simplifying object conversions
SwaggerAPI documentation and testing framework

Steps to Run the Application

  1. Set Up the Environment:
    • Ensure MySQL is installed.
    • Create a database named bookstore.
  2. Configure Database:
    • Modify the application.yaml file to match your MySQL username, password, and datasource URL.
    • Example configuration: spring: datasource: url: jdbc:mysql://localhost:3306/bookstore username: root password: admin
  3. Install Lombok Plugin:
    • If your IDE doesnt have Lombok, install the plugin.
  4. Run the Application:
    • The table book will be created automatically.
    • Default port: 9999.
    • Access the Swagger UI at .
  5. Run Tests:
    • Execute unit tests with mvn clean test.
    • Generate code coverage report using mvn jacoco:report.

Complete Advance AI topics:- 
Complete Python Course with Advance topics:-



bookstore with java spring boot github
bookstore with java spring boot pdf
bookstore with java spring boot example
free bookstore with java spring boot
online bookstore with java spring boot
online book store using spring boot github
online book store project in java with source code
spring initializr

Source Code Available

Interested in This Project?

Get the complete source code for this project at a very affordable price — perfect for your portfolio, college submission, or learning. Message us on WhatsApp and we'll get back to you instantly!

Full source code included Step-by-step setup guide Instant delivery on WhatsApp Instant reply on WhatsApp
Chat on WhatsApp

We usually reply within a few minutes

Leave a Reply

Your email address will not be published. Required fields are marked *

Chat with us