The Bookstore Inventory Management System is a robust SpringBoot application tailored for efficient management of a bookstore's inventory. This backend system empowers users with comprehensive CRUD operations, including adding, updating, deleting, and retrieving book records, facilitated through a gRPC interface with Protobuf for streamlined communication.
- CRUD Operations: Comprehensive Create, Read, Update, and Delete functionalities for bookstore inventory management:
- AddBook: Seamlessly create a new book record.
- GetBook: Efficiently retrieve a book by its ID.
- UpdateBook: Update existing book records with ease.
- DeleteBook: Delete a book record by its ID.
- ListBooks: List all books in the inventory, providing a complete overview.
- Database Integration: Utilizes PostgreSQL for reliable data persistence and management.
- gRPC and Protobuf: Leverages gRPC and Protobuf for efficient, type-safe data serialization and robust communication.
- Testcontainers & Citrus Integration: Ensures high reliability and stability through integration with testcontainers and Citrus framework for comprehensive integration testing.
- MapStruct: Employs MapStruct for efficient and accurate object mapping between the entity and DTO layers.
- Docker Integration: Utilizes Docker for containerization, ensuring consistent and seamless deployment environments.
- Reactive Version Development: Ongoing work on a reactive version of the application, incorporating Spring WebFlux and Project Reactor, for enhanced performance and scalability.
- High Test Coverage: Achieved an impressive 96% line coverage with a combination of unit and integration tests, demonstrating the commitment to reliability and quality.
- Best Practices & SOLID Principles: The development of the application strictly adheres to AGILE methodologies and SOLID principles, ensuring a maintainable, scalable, and robust codebase.
Before you begin, ensure you have met the following requirements:
- Docker installed on your machine.
- Gradle for building the project.
- Optionally, Postman for testing the gRPC API.
These instructions will get your copy of the project up and running on your local machine for development and testing purposes.
-
Clone the repository:
git clone https://github.com/AntonBabychP1T/bookstore-inventory-managment-system
-
Ensure Docker is running on your machine.
-
Build the project:
./gradlew clean build
-
Create a
.env
file in the root directory of the project and add the following environment variables:
POSTGRESQL_USER=username
POSTGRESQL_ROOT_PASSWORD=password
POSTGRESQL_PASSWORD=password
POSTGRESQL_DATABASE=database_name
POSTGRESQL_LOCAL_PORT=5433
POSTGRESQL_DOCKER_PORT=5432
SPRING_LOCAL_PORT=8081
SPRING_DOCKER_PORT=8080
DEBUG_PORT=5005
GRPC_SERVER_PORT=9090
- Run the application using Docker Compose:
docker-compose up --build
The gRPC server will be accessible on port 9090.
-
Install Postman on your computer.
-
Import the provided .proto file and use existing form to testing application).
Below are examples of how to use the gRPC API to interact with the Bookstore Inventory Management System. These examples are presented in JSON format, as they would appear when using a gRPC client like Postman.
To add a new book to the inventory:
{
"title": "The Great Gatsby",
"author": "F. Scott Fitzgerald",
"isbn": "1234567890",
"quantity": 10,
"description": "A classic novel...",
"coverImage": "http://example.com/image.jpg"
}
To retrieve a book by its ID:
{
"id": "1"
}
To update an existing book in the inventory:
{
"id": "1",
"title": "The Great Gatsby Updated",
"author": "F. Scott Fitzgerald",
"isbn": "1234567890",
"quantity": 12,
"description": "An updated classic novel...",
"coverImage": "http://example.com/newimage.jpg"
}
To delete a book from the inventory using its ID:
{
"id": "1"
}
To list all books in the inventory:
{
"page": 1,
"size": 10
}
Here you can see video presentation for this project link
My email - [email protected]
Project Link: https://github.com/AntonBabychP1T/bookstore-inventory-managment-system