Welcome to the Library Management System! This demo Spring Boot application serves as a comprehensive solution for managing library resources, users, and transactions. It empowers libraries to handle user registrations, book reservations, borrowing, notifications, fines, and reviews seamlessly through secure RESTful APIs. Leveraging JWT-based authentication and fine-grained role-based authorization, this application ensures a robust security model for both end-users and administrators.
- π Secure Authentication & Authorization: JWT-based token authentication with role-based access.
- π Book Management: Add, update, and search for books, complete with real-time availability tracking.
- π₯ Borrowing & Returns: Streamlined borrowing and returning processes, with d fine calculations.
- π¬ Notifications: Timely email reminders for reservations, due dates, and fines.
- β User Reviews: Engage the community by allowing users to rate and review books.
β οΈ Detailed Error Responses: JSON responses for error handling, simplifying front-end integration.
| Category | Technologies |
|---|---|
| Framework | Spring Boot |
| Security | Spring Security, JWT |
| Database | PostgreSQL, Spring Data JPA |
| Utilities | Lombok, ModelMapper, Jakarta Validation API |
| Email Support | Spring Boot Starter Mail |
| JSON Handling | Jackson Databind |
library-management-system/
β
βββ src/
β βββ main/
β β βββ java/
β β β βββ com/
β β β βββ library/
β β β βββ management/
β β β βββ config/
β β β β βββ SecurityConfig.java
β β β β
β β β βββ controllers/
β β β β βββ AuthController.java
β β β β βββ BookController.java
β β β β βββ BorrowController.java
β β β β βββ FineController.java
β β β β βββ NotificationController.java
β β β β βββ ReservationController.java
β β β β βββ ReviewController.java
β β β β βββ UserController.java
β β β β
β β β βββ dto/
β β β β βββ BookDto.java
β β β β βββ BorrowDto.java
β β β β βββ FineDto.java
β β β β βββ NotificationDto.java
β β β β βββ ReservationDto.java
β β β β βββ ReviewDto.java
β β β β βββ UserDto.java
β β β β
β β β βββ entities/
β β β β βββ Book.java
β β β β βββ Borrow.java
β β β β βββ Fine.java
β β β β βββ Notification.java
β β β β βββ Reservation.java
β β β β βββ Review.java
β β β β βββ Role.java
β β β β βββ User.java
β β β β
β β β βββ enums/
β β β β βββ RoleName.java
β β β β
β β β βββ exceptions/
β β β β βββ GlobalExceptionHandler.java
β β β β
β β β βββ jwt/
β β β β βββ AuthenticationRequest.java
β β β β βββ AuthenticationResponse.java
β β β β βββ JwtRequestFilter.java
β β β β βββ JwtUtil.java
β β β β
β β β βββ repo/
β β β β βββ BookRepo.java
β β β β βββ BorrowRepo.java
β β β β βββ FineRepo.java
β β β β βββ NotificationRepo.java
β β β β βββ ReservationRepo.java
β β β β βββ ReviewRepo.java
β β β β βββ RoleRepo.java
β β β β βββ UserRepo.java
β β β β
β β β βββ service/
β β β β βββ impl/
β β β β β βββ BookServiceImpl.java
β β β β β βββ BorrowServiceImpl.java
β β β β β βββ EmailServiceImpl.java
β β β β β βββ FineServiceImpl.java
β β β β β βββ NotificationServiceImpl.java
β β β β β βββ ReservationServiceImpl.java
β β β β β βββ ReviewServiceImpl.java
β β β β β βββ UserServiceImpl.java
β β β β β
β β β β βββ BookService.java
β β β β βββ BorrowService.java
β β β β βββ EmailService.java
β β β β βββ FineService.java
β β β β βββ NotificationService.java
β β β β βββ ReservationService.java
β β β β βββ ReviewService.java
β β β β βββ UserService.java
β β β β
β β β βββ utils/
β β β β βββ CustomCustomerDetailsService.java
β β β β βββ CustomEmailMessage.java
β β β β βββ Databaselnitializer.java
β β β β βββ Rolelnitializer.java
β β β β
β β β βββ LibraryManagementSystemApplication.java
β β β
β β βββ resources/
β β βββ static/
β β βββ templates/
β β βββ application.properties
β β
β βββ test/
β
βββ LICENSE
βββ mvnw
βββ mvnw.cmd
βββ pom.xml
βββ README.md
spring-boot-starter-data-jpa: For ORM and database interactions.spring-boot-starter-security: Ensures robust authentication and authorization.spring-boot-starter-web: Facilitates building RESTful APIs and handling web requests.
spring-boot-devtools: Automatic restarts during development.spring-boot-starter-test: JUnit and Mockito for effective testing.spring-security-test: Utilities for testing Spring Security.
postgresql: Driver for PostgreSQL database connections.jakarta.validation-api: Ensures data integrity with bean validation.
spring-boot-starter-json: For JSON serialization and deserialization.jackson-databind: Core library for JSON processing.
jjwt: For secure token-based authentication using JSON Web Tokens (JWT).
spring-boot-starter-mail: Facilitates email notifications.
lombok: Reduces boilerplate code (e.g., getters/setters).modelmapper: Simplifies mapping between DTOs and entities.
slf4j-api: Logging interface.logback-classic: Implementation for logging.
jaxb-api: Support for XML binding.
- Authentication & User Management: Secure JWT authentication with customizable role access.
- Book Management: Admins oversee the library catalog; users can explore and reserve books.
- Borrowing & Notifications: Users can borrow and return books with email reminders for due dates.
- Community Engagement: Foster resource selection by allowing users to rate and review books.
-
Clone the Repository
git clone https://github.com/sumanbisunkhe/library-management-system.git cd library-management-system -
Database Setup
- Configure PostgreSQL and update
application.propertieswith your database credentials.
# ========== Application Name ========== spring.application.name=library-management-system # ========== Database Configuration ========== spring.datasource.url=jdbc:postgresql://localhost:5432/library_management_system_db spring.datasource.username=your_username spring.datasource.password=your_password spring.datasource.driver-class-name=org.postgresql.Driver # ========== Hibernate/JPA Settings ========== spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect # ========== JWT Configuration ========== jwt.secret=superSecretKeyHere # ========== Logging Configuration ========== logging.level.org.hibernate.SQL=DEBUG logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE # ========== Mail Configuration ========== spring.mail.host=smtp.gmail.com spring.mail.port=587 spring.mail.username=your_email_address spring.mail.password=your_email_app_password spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true
- Configure PostgreSQL and update
-
Run Application
mvn clean install mvn spring-boot:run
π Suman Bisunkhe β¨ Developer Extraordinaire | Shaping the future with code and creativity. π
This project is licensed under the MIT License - see the LICENSE file for details.