A comprehensive bookstore management system built with Spring Boot, providing RESTful APIs for managing books, authors, customers, and reviews.
- User Management: Secure user authentication and authorization with JWT and RSA keys
- Book Management: CRUD operations for books with search and filtering capabilities
- Author Management: Manage author information
- Customer Management: Track customer information and categorize customers
- Review System: Allow customers to leave reviews and ratings for books
- RESTful API: Well-structured API following REST principles
- Java 21
- Spring Boot 4.0.1
- Spring Security with JWT authentication
- Spring Data JDBC
- PostgreSQL database
- Docker Compose for development environment
- Gradle for build management
The project follows a clean architecture with domain-driven design principles:
src/main/java/org/example/hbookstore/
├── author/ # Author domain
├── book/ # Book domain
├── customer/ # Customer domain
├── review/ # Review domain
├── user/ # User domain
└── shared/ # Shared components
├── config/ # Application configuration
├── error/ # Error handling
└── security/ # Security configuration
Each domain package contains:
api/: Controllers and DTOsdomain/: Domain models and repositoriesservice/: Business logicmapping/: Object mappers
- Java 21 or higher
- Docker and Docker Compose
-
Clone the repository:
git clone https://github.com/yourusername/HBookStore.git cd HBookStore -
Start the PostgreSQL database using Docker Compose:
docker-compose up -d
-
Build and run the application:
./gradlew bootRun
-
The application will be available at
http://localhost:8080
The API is documented using OpenAPI 3.0. You can access the Swagger UI at:
- Swagger UI:
http://localhost:8080/swagger-ui.html - OpenAPI Spec:
http://localhost:8080/api-docs
GET /api/v1/books: Get all books (paginated)GET /api/v1/books/{id}: Get a specific bookPOST /api/v1/books: Create a new bookPUT /api/v1/books/{id}: Update a bookDELETE /api/v1/books/{id}: Delete a bookGET /api/v1/books/author/{authorId}: Get books by authorGET /api/v1/books/category/{category}: Get books by categoryGET /api/v1/books/format/{format}: Get books by formatGET /api/v1/books/language/{language}: Get books by languageGET /api/v1/books/publisher/{publisher}: Get books by publisherGET /api/v1/books/search?query={query}: Search books
Similar endpoints are available for authors, customers, reviews, and users.
The application can be configured through the application.properties file. For development, you can use the
application-dev.properties file.
This project is licensed under the MIT License - see the LICENSE file for details.
GATTAL Hamza