Skip to content

sumanbisunkhe/library-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š Library Management System

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.

🌟 Key Features

  • πŸ” 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.

πŸ’» Technology Stack

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

πŸ—‚οΈ Project Structure

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

πŸ”— Dependencies

Core Spring Boot Dependencies

  • 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.

Development and Testing

  • 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.

Database and Persistence

  • postgresql: Driver for PostgreSQL database connections.
  • jakarta.validation-api: Ensures data integrity with bean validation.

JSON and Serialization

  • spring-boot-starter-json: For JSON serialization and deserialization.
  • jackson-databind: Core library for JSON processing.

Authentication and Security

  • jjwt: For secure token-based authentication using JSON Web Tokens (JWT).

Email Support

  • spring-boot-starter-mail: Facilitates email notifications.

Utility Libraries

  • lombok: Reduces boilerplate code (e.g., getters/setters).
  • modelmapper: Simplifies mapping between DTOs and entities.

Logging

  • slf4j-api: Logging interface.
  • logback-classic: Implementation for logging.

XML Binding

  • jaxb-api: Support for XML binding.

πŸš€ Usage

  1. Authentication & User Management: Secure JWT authentication with customizable role access.
  2. Book Management: Admins oversee the library catalog; users can explore and reserve books.
  3. Borrowing & Notifications: Users can borrow and return books with email reminders for due dates.
  4. Community Engagement: Foster resource selection by allowing users to rate and review books.

βš™οΈ Getting Started

  1. Clone the Repository

    git clone https://github.com/sumanbisunkhe/library-management-system.git
    cd library-management-system
  2. Database Setup

    • Configure PostgreSQL and update application.properties with 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
  3. Run Application

    mvn clean install
    mvn spring-boot:run

πŸ‘‘ Contributors

🌟 Suman Bisunkhe ✨ Developer Extraordinaire | Shaping the future with code and creativity. πŸš€

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages