A simple full‑stack Book Management web application — built with Java 21, Spring Boot, Spring Data JPA / Hibernate, and MySQL, with a lightweight frontend using HTML / CSS / JavaScript (Fetch API).
The Book Management System is a minimal full‑stack application for managing books. It exposes a RESTful API (CRUD + search + filters) and includes a responsive single‑page frontend served from src/main/resources/static/index.html.
Use cases: keep a local collection of books, demo apps for interviews, learning Spring Boot + JPA + Fetch API.
- Create, Read, Update, Delete (CRUD) operations for books
- Search books by title (case‑insensitive)
- Filter books by author and price range
- Statistics: total number of books and total inventory value
- Responsive frontend (works on mobile and desktop)
- CORS enabled for easy frontend-backend interaction
Backend
- Java 21
- Spring Boot (Web, Data JPA)
- Hibernate
- MySQL 8
- Embedded Tomcat (via Spring Boot)
- Maven (build tool)
Frontend
- HTML5 / CSS3
- JavaScript (ES6+) using Fetch API
Base URL: http://localhost:8080/api/books
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/books |
Create a new book. Body: { "title": "...", "author": "...", "price": 0.0 } |
| GET | /api/books |
Get all books |
| GET | /api/books/{id} |
Get book by id |
| PUT | /api/books/{id} |
Update book by id. Body: { "title": "...", "author": "...", "price": 0.0 } |
| DELETE | /api/books/{id} |
Delete book by id |
| DELETE | /api/books |
Delete all books |
| GET | /api/books/author/{author} |
Get books by author |
| GET | /api/books/search?keyword={keyword} |
Search by title (contains) |
| GET | /api/books/price-range?minPrice={min}&maxPrice={max} |
Get books within price range |
