This is a Spring Boot application for managing a bookstore system, providing functionalities for managing books, authors, categories, orders, and user authentication.
- Features
- Technologies Used
- Project Structure
- Setup Instructions
- API Documentation
- Usage
- Contributing
- CRUD operations for Books, Authors, Categories, and Orders.
- User registration, authentication, and role-based access control (RBAC) using Spring Security and JWT.
- Secure endpoints for user management and order management.
- Pagination, filtering, and search functionality for books, authors, and categories.
- Error handling and validation for user inputs.
- Versioning of APIs to handle backward compatibility.
- Java
- Spring Boot
- Spring Web
- Spring Data JPA (Hibernate)
- MySQL (for production)
- Maven (for dependency management)
The project follows a standard Spring Boot project structure:
src/
├── main/
│ ├── java/
│ │ └── com/
│ │ └── bookstore/
│ │ ├── controller/ # RESTful API controllers
│ │ ├── service/ # Business logic services
│ │ ├── repository/ # Data access repositories
│ │ ├── config/ # Configuration classes (e.g., SwaggerConfig)
│ │ ├── entity/ # JPA entities (e.g., Book, Author)
│ │ └── SpringbookprojectApplication.java # Main application class
│ └── resources/
│ ├── application.properties # Application configuration
│ ├── data.sql # Sample data for development
│ └── schema.sql # Database schema definition
└── test/
└── java/
└── com/
└── bookstore/
├── controller/ # Unit and integration tests for controllers
└── service/ # Unit tests for services
-
Clone the repository:
git clone https://github.com/nkatajoshua/Bookstoresystem.git
-
Navigate to the project directory:
cd Bookstoresystem
-
Build the application:
mvn clean package
-
Run the application:
java -jar target/springbookproject-0.0.1-SNAPSHOT.jar
-
Access the application:
Open a web browser and go to
http://localhost:8080
The API documentation is generated using Swagger. After starting the application, access the Swagger UI at http://localhost:8080/swagger-ui/index.html
to view detailed documentation of the RESTful API endpoints.
- Use the API endpoints documented in Swagger to interact with the bookstore system.
- Perform CRUD operations on books, authors, categories, and orders.
- Register users, authenticate, and manage user roles.
mvn test
Contributions are welcome! Please follow these guidelines:
- Fork the repository.
- Create a new branch (
git checkout -b feature-xyz
). - Make your changes and commit them (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-xyz
). - Create a new Pull Request.