This is a Spring Boot based REST API for managing books and authors. It provides CRUD operations, search functionality, role-based access control, and uses an in-memory H2 database for demonstration.
Add, update, delete, and view books and authors
Search books by different criteria
Role-based access control with Spring Security
Swagger UI for API documentation and testing
Modular and extendable layered architecture
Spring Boot (4.0.0-M2)
Spring Data JPA
Spring Security
H2 Database
Maven
Swagger (Springdoc OpenAPI)
Clone or download the project.
Open it in your IDE (IntelliJ/Eclipse).
Run the project with Maven or directly from the IDE.
Access the API at:
Swagger UI: http://localhost:8080/swagger-ui.html
H2 Console: http://localhost:8080/h2-console
Add a Book (POST /books)
Request JSON
{ "title": "Spring Boot in Action", "isbn": "123456789", "author": { "id": 1, "name": "Craig Walls" } }
Response JSON
{ "id": 1, "title": "Spring Boot in Action", "isbn": "123456789", "author": { "id": 1, "name": "Craig Walls" } }
Get All Books (GET /books)
Response JSON
[ { "id": 1, "title": "Spring Boot in Action", "isbn": "123456789", "author": { "id": 1, "name": "Craig Walls" } } ]