A simple Bookstore Management System built using Spring Boot with H2 Database for backend storage and a minimal frontend using Thymeleaf & CSS.
This application allows users to:
- Add new books with title, author, and ISBN.
- Update existing book details.
- Delete books from the system.
- Search books by title or author.
- View books in a scrollable list with only 5 visible at a time.
- Spring Boot (Backend)
- Spring Data JPA (Database Handling)
- H2 Database (In-memory storage)
- Thymeleaf (Frontend Templating)
- CSS (Basic UI Styling)
If you haven't cloned the project yet, run:
git clone https://github.com/your-repo/bookstore.git
cd bookstore
- Open IntelliJ IDEA.
- Click File > Open and select the project folder.
- Wait for Maven to download dependencies.
- Navigate to the
BookstoreApplication.java
file insrc/main/java/com/example/bookstore/
. - Click the Run button (or press
Shift + F10
).
The application will start on:
👉 http://localhost:8080
This project uses an H2 in-memory database, meaning data will be lost after the application restarts.
- Open your browser and go to:
👉http://localhost:8080/h2-console
- Use the following credentials:
- JDBC URL:
jdbc:h2:mem:bookstoredb
- Username:
sa
- Password: (leave empty)
- JDBC URL:
- Click Connect.
Once connected, run the following SQL command:
SELECT * FROM book;
Method | Endpoint | Description |
---|---|---|
GET | /api/books |
Get all books |
POST | /api/books |
Add a new book |
PUT | /api/books/{id} |
Update a book |
DELETE | /api/books/{id} |
Delete a book |
- Only 5 books are shown at a time, remaining are scrollable.
- Duplicate author names & ISBNs are prevented with a validation check.
- Search bar filters books by title or author.
- Styled UI for better user experience.
- Feel free to fork the project and submit PRs.