Library Management System Project Report
Library Management System Project Report
1 Introduction 1
1.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.4 Model Used & Rationale . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4.1 Agile Model Overview . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4.2 Why We Chose the Agile Model . . . . . . . . . . . . . . . . . . . 2
1.4.3 Limitations Managed . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Requirement Analysis 4
2.1 Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.1 Book Management . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.2 User Management . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.3 Borrow/Return System . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Non-Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Proposed Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
i
5 Testing 15
5.1 Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.2 Mocking for Isolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.3 Conclusion of Testing Strategy . . . . . . . . . . . . . . . . . . . . . . . . 16
ii
List of Figures
4.1 AIR Diagram showing the high-level component interactions and respon-
sibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.2 UML Class Diagram showing classes, relationships, and methods used in
the system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.3 ER Diagram representing the normalized relational schema of the MySQL
database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
iii
Chapter 1 : Introduction
1.1 Definition
A Library Management System (LMS) is software designed to manage and automate the
daily operations of a library. It is a digital system used to streamline all library functions,
including book tracking, borrowing management, and fine calculations, ensuring efficiency
and accuracy in library operations.
1.3 Objectives
Objectives are specific goals that guide the development of a Library Management System
to meet the needs of librarians and students. The key objectives include:
• Maintain accurate and up-to-date records of books, students, and borrowing history.
1
• Reduce manual work, save time, and minimize human errors.
• Provide easy access to information like book availability, due dates, and fines.
• Ensure secure login and role-based access for different user types.
Figure 1.1: Agile Model in the Software Development Life Cycle (SDLC)
▷ Fast Delivery of Features: Important components like the login system, book
management, and borrowing module were developed and tested incrementally.
2
▷ Helpful User Feedback: Feedback from librarians and users during sprints im-
proved search features, user interface, and reporting functions.
▷ Better Quality with Fewer Errors: Testing after each sprint ensured early error
detection, resulting in a stable and reliable system.
▷ Visible Progress: Each sprint delivered working modules, providing clear evidence
of continuous improvement.
• Estimating time and total cost was challenging due to evolving features.
3
Chapter 2 : Requirement Analysis
This chapter outlines the requirements for the Library Management System (LMS), a
desktop application designed to streamline library operations such as book management,
user administration, and transaction tracking. The requirements are categorized into
functional and non-functional requirements, ensuring the system meets the needs of li-
brarians and students while maintaining performance, security, and scalability. These
requirements were gathered through stakeholder consultations and aligned with the sys-
tem’s layered architecture and technical specifications.
• Add New Books: Register new • Search for Books: Search books by
books with details such as title, au- title, author, or ISBN with partial and
thor, ISBN, publication year, and cat- exact match capabilities.
egory.
• View All Books: Display the com-
• Update Book Details: Modify
plete book catalog with availability
existing book information, including
status.
availability status and location.
4
• Add New Users: Create accounts counts, ensuring no active transac-
for students and admins with role- tions or requests.
based access (admin or student).
• Search for Users: Locate users by
• Update Details: Modify user infor- username, email, or student ID.
mation, including email, phone num-
• View All Users: Display a list of all
ber, and borrowing limits.
users with their roles and borrowing
• Delete Users: Remove user ac- status.
Scalability
The system supports growth to handle up to 10,000 books and 1,000 users without
performance degradation, facilitated by MySQL’s indexing and Hibernate’s caching.
Performance
Query response times (e.g., book searches, transaction updates) are under 2 seconds,
achieved through database indexes on books.title, books.author, and books.isbn.
Security
User data is protected with BCrypt password hashing, role-based access control (ad-
min vs. student), and secure database connections to prevent unauthorized access.
5
Usability
The JavaFX-based interface is intuitive, with clear navigation and responsive design
for librarians and students, supporting CSS-styled layouts.
Compatibility
The system is accessible on desktop platforms, with plans for future mobile and web
interfaces to enhance accessibility.
• Authentication & Security: Secure login system using BCrypt password hashing
for both admin and student roles.
• Book Management: Admins can add, update, delete, and track books using an
intuitive interface backed by Hibernate for ORM (Object-Relational Mapping).
• Search Functionality: Students can search for books using optimized search
queries for better performance and partial matches.
• Borrowing & Returning: A transaction service ensures books are issued and re-
turned with proper validation. Atomic operations are used to maintain consistency
between book status and borrowing records.
• Fine Calculation: Automatic fine tracking based on due dates and return status,
removing the need for manual calculations.
• Reports & Statistics: Admin dashboard offers overdue book reports, top bor-
rowed books, and student activity logs via SQL aggregations and filtering.
6
Figure 2.1: Proposed System Architecture for the Library Management System
7
Chapter 3 : System Architecture and Technology Stack
The proposed Library Management System (LMS) follows a layered architectural de-
sign to ensure modularity, maintainability, and scalability. It is a desktop-based appli-
cation developed with Java technologies, leveraging JavaFX for the user interface and
Hibernate ORM for database interactions.
• Business Logic Layer: Contains core services managing system workflows includ-
ing authentication, book management, user management, borrowing and returning
processes, and fine calculations. This layer enforces business rules, validates trans-
actions, and ensures consistency.
• Data Access Layer: Uses Hibernate ORM to interact with the MySQL database,
abstracting direct SQL queries into object-oriented operations. This layer manages
CRUD operations on key entities such as books, users, and transactions, enabling
efficient data persistence and retrieval.
• Database Layer: A MySQL relational database storing all system data. It in-
cludes normalized tables for books, users, transactions, and book requests. Proper
indexing is used to optimize search and transaction performance.
8
Figure 3.1: Layered Architecture of the Library Management System illustrating the
Presentation Layer (JavaFX UI), Business Logic Layer (core services and workflows),
Data Access Layer (Hibernate ORM), and Database Layer (MySQL with normalized
tables and indexing).
• JavaFX 17.0.2
Powers the user interface, providing an interactive and modern GUI for students
and librarians. It uses scene graphs, event-driven patterns, and CSS styling to
create responsive views.
9
3.1.3 Data Access Layer
• Hibernate 6.2.13
Acts as the bridge between business logic and the database. It maps Java enti-
ties to database tables and handles persistence operations through repositories like
BookRepository and UserRepository.
• Maven
Manages dependencies for Hibernate and other libraries required by the data access
layer. Ensures consistent builds and integration of database connectors.
• OkHttp (Planned)
Reserved for possible future REST integrations or external data fetching needs,
operating alongside the service layer.
10
Chapter 4 : Design
This chapter outlines the system design using three core models: the AIR (Architec-
ture–Interaction–Responsibility) Diagram, the Class Diagram, and the Database Schema.
Together, they define the system’s structure, behavior, and data organization.
• Architecture: Logical layering and major components, such as the UI layer, ser-
vice layer, and data layer.
• Interaction: Flow of data and control between components. For example, how
user inputs trigger backend operations or database queries.
• Responsibility: The role of each component or class in the system, such as han-
dling business logic, user interaction, or data access.
This diagram helps developers understand the structure and behavior of individual com-
ponents and their relationships in the system.
11
Figure 4.1: AIR Diagram showing the high-level
12 component interactions and responsibil-
ities
Figure 4.2: UML Class Diagram showing classes,
13 relationships, and methods used in the
system
Figure 4.3: ER Diagram representing the 14
normalized relational schema of the MySQL
database
Chapter 5 : Testing
A robust testing strategy is crucial for ensuring the quality, reliability, and correctness
of any software system. For the Library Management System, testing was integrated
throughout the development lifecycle to identify and resolve defects early, validate func-
tionality, and enhance the overall stability of the application.
Our testing strategy primarily focused on Unit Testing and Integration Testing,
complemented by manual testing efforts. The goal was to ensure that individual com-
ponents perform correctly in isolation and that these components interact as expected
when combined.
• Tool Used: JUnit 5 was the chosen framework for writing and executing unit
tests. JUnit 5 provides a flexible and powerful platform for structuring tests using
annotations such as @Test, @BeforeEach, @AfterEach, etc., and offers a wide range
of assertion methods (assertEquals, assertTrue, assertNull, etc.) to verify the
expected outcomes of tested units.
• Objectives: The objectives of unit testing were to verify the correctness of the
business logic, ensure that utility functions perform as intended, and confirm that
individual methods handle various inputs (valid, invalid, edge cases) appropriately.
• Tool Used: Mockito was employed to create mock objects. Mockito allowed us
to simulate the behavior of dependencies (like UserRepository, BookRepository)
and control the outcomes of method calls to these dependencies during unit tests.
15
• Role of Mocking: By mocking repositories, we could test the logic within a
Service method without requiring an actual database connection or performing real
database operations. This made the unit tests faster, more reliable, and truly
focused on the logic of the unit under test, isolating it from external factors. We
could also verify that the Service class interacted with its dependencies as expected
(e.g., called a specific repository method a certain number of times).
16
Chapter 6 : Project Screenshots and Discussion
18
Figure 6.1: Project screenshots – part 1
Figure 6.2: Project screenshots – part 2
19
6.1 User Interface and Functionality
The User Interface (UI), developed using JavaFX, serves as the Presentation Layer of
the system. It ensures an intuitive and role-based interaction model for both librarians
and students. Key UI components are organized using FXML, with dedicated controller
classes handling logic and event management.
• UI elements include email/username input, password, role selector, and login but-
ton.
• Features: welcome header, navigation tabs, book search, add book/copy buttons,
and a table of books.
• Functionalities:
– Add Book/Copy: Opens input form, saves via service layer, updates database.
• Elements: student search bar, add student button, and student data table.
• Functionalities:
20
– Add Student: Saves records into both users and student profiles tables
with hashed passwords.
• Elements: search bar, filter dropdown, return button, transaction table (color-
coded).
• Functionalities:
– Return Book: Updates status, records return, adjusts student data, and
calculates fines if applicable.
• Functionalities:
• Elements: key metrics, pie chart (book overview), and recent activity feed.
• Functionalities:
21
Search Books Tab
• Functionality:
22
Chapter 7 : Conclusion and Contribution
Conclusion
The Library Management System is a robust and scalable solution designed using Java
17, JavaFX, MySQL, and Hibernate. It offers a user-friendly interface and ensures a
secure, efficient way to manage library resources. Security features like BCrypt reinforce
password protection, while the use of the JavaMail API opens up potential for future
communication features such as overdue notifications and system alerts.
The system is flexible and modular, making it easy to maintain and extend. It can be
tailored to meet the specific needs of educational institutions or public libraries, thereby
serving as a long-term solution for digital library automation.
Contribution Table
23