This project is a gRPC-based Java application for an online book store. It provides CRUD (Create, Read, Update, Delete) operations for managing a collection of books.
The project structure is as follows:
build.gradle: Configuration file for Gradle build system.settings.gradle: Settings file for Gradle.src/main/java: Directory for main Java source files.src/main/proto: Directory for Protobuf (.proto) definition files.src/test/java: Directory for unit tests.
- JDK 21
- Gradle 8.5
- Clone the repository:
git clone https://github.com/kishankoushal/Bookstore.git cd Bookstore - Build the Project:
./gradlew build ./gradlew generateProto
-
Open
BookStoreServer.java(src/main/java/mainstore/BookStoreServer)in your IDE. -
Run the
mainmethod to start the gRPC server.
-
Open
BookStoreClient.java(src/main/java/mainstore/BookStoreClient)in your IDE. -
Run the
mainmethod to start the gRPC client.
Adds a new book to the store. If a book with the same ISBN already exists, the operation fails (success = false). Otherwise, the book is added successfully (success = true).
Updates an existing book in the store based on its ISBN. Returns success = true if the book is updated successfully. Returns success = false if the book with the specified ISBN does not exist.
Deletes a book from the store based on its ISBN. Returns success = true if the book is deleted successfully. Returns success = false if the book with the specified ISBN does not exist.
Retrieves all books currently stored in the book store. Returns a list of all books.