A professional, high-performance RESTful API built with Spring Boot 4 and Java 25 to manage your personal library efficiently. This application provides a backend for tracking books, their descriptions, page counts, and reading status.
- Full CRUD Operations: Create, Read, Update, and Delete books.
- Filtered Search: Easily find books based on their reading status.
- Modern Architecture: Clean separation of concerns with Controller, Service, Repository, and DTO layers.
- Framework: Spring Boot 4.0.1
- Language: Java 25
- Database: PostgreSQL
- ORM: Spring Data JPA (Hibernate)
- Documentation: SpringDoc OpenAPI (Swagger UI)
- Utilities: Lombok
- Build Tool: Maven
src/main/java/com/neko/greatbook/
├── controller/ # REST Endpoints
├── service/ # Business Logic
├── repository/ # Database Access (JPA)
├── model/ # JPA Entities
└── dto/ # Data Transfer Objects
- JDK 25 or higher
- PostgreSQL installed and running
- Maven 3.9+
Update src/main/resources/application.properties with your PostgreSQL credentials:
spring.datasource.url=jdbc:postgresql://localhost:5432/springdb
spring.datasource.username=your_username
spring.datasource.password=your_passwordClone the repository:
git clone <repository-url>
cd greatbookBuild and run:
mvn spring-boot:runThe server will start on http://localhost:8080.
Once the application is running, you can access the interactive API documentation at:
- Swagger UI: http://localhost:8080/swagger-ui.html
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/books |
Create a new book |
GET |
/api/books |
List all books |
GET |
/api/books/{id} |
Get book details by ID |
GET |
/api/books/filter |
Filter by read status (?read=true/false) |
PUT |
/api/books/{id} |
Replace an existing book |
PATCH |
/api/books/{id} |
Partially update a book |
DELETE |
/api/books/{id} |
Remove a book |
{
"name": "The Great Gatsby",
"description": "A novel by F. Scott Fitzgerald",
"page": 180,
"read": true
}