Skip to content

Kunal05j/Restful-BookStore-API-Project

Repository files navigation

Restful BookStore API

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.

Features

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

Tools Used

Spring Boot (4.0.0-M2)

Spring Data JPA

Spring Security

H2 Database

Maven

Swagger (Springdoc OpenAPI)

How to Run

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

Example

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" } } ]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages