A ready-to-use BookStore API for online shops.
- 👨💻Tech stack
- ⚡Quick start
-
✈️ Controllers - 🧑🚀Postman Collection
- 🎥Video Presentation
- 🏁Conclusion
- 📝License
Here's a brief high-level overview of the tech stack the BookStore API uses:
- Spring Boot: provides a set of pre-built templates and conventions for creating stand-alone, production-grade Spring-based applications.
- Hibernate: simplifies the interaction between Java applications and databases by mapping Java objects to database tables and vice versa.
- Spring Security: provides features like authentication, authorization, and protection against common security threats.
- Spring Web: includes tools for handling HTTP requests, managing sessions, and processing web-related tasks.
- Spring Data JPA: provides a higher-level abstraction for working with databases and includes support for JPA (Java Persistence API).
- Lombok: helps reduce boilerplate code by automatically generating common code constructs (like getters, setters, constructors, etc.) during compile time.
- Mapstruct: generates mapping code based on annotations, reducing the need for manual, error-prone mapping code.
- Liquibase: helps manage database schema changes over time, making it easier to track and deploy database updates.
- Swagger: provides a framework for generating interactive API documentation, allowing developers to understand, test, and use APIs more easily.
- Docker: provides a consistent and reproducible way to deploy applications across different environments.
- Postman: allows developers to create and send HTTP requests to test APIs, monitor responses, and automate testing workflows.
First, download a repository. You can use git console command:
git clone https://github.com/Denis-Balako/Online-Book-Store.git
Build a project using Maven:
mvn clean install
Then, rise a Docker container of your app:
docker build -t {your-image-name} .
docker-compose build
docker-compose up
Also, you can run this project without docker, but before that, you need to configure the connection to your local database in the application properties. Run this command after that:
mvn spring-boot:run
That's all you need to know to start! 🎉
- AuthenticationController: handles user registration and authorization.
- BookController: manages book operations, such as creation, updating, deleting and search.
- CartController: manages shopping cart state, allows users to add, update, retrieve and delete cart items.
- CategoryController: manages categories, allows admins to create, update, retrieve and delete.
- OrderController: handles order management, creating, updating, deleting and retrieving order history.
For easy test, I've created a Postman collection and environment, that includes all user and admin requests.
For access to all endpoints use admin login in admin endpoints folder or use admin credentials below:
Username: denis@example.com
Password: qwe123456789
This video shows the operation of the application in detail. Here we will see how the search for books and categories works, the ability of the admin to change them, the user functionality, and how the shopping cart and orders work.
Link : https://www.loom.com/share/19bad7530e49408dbd6e78cc9c209a67?sid=d4630fee-e404-45b8-a501-a45911e13071
The Bookstore API offers a robust framework for constructing a platform dedicated to selling books. Whether you're initiating a fresh online bookstore or enhancing an already established one, this API enables you to efficiently handle books, orders, and customer information.
This project is licensed under the MIT license. Feel free to edit and distribute this template as you like.