DOC-20250130-WA0000..pdf (9) .PDF (1) .PDF - 20250320 - 195539 - 0000
DOC-20250130-WA0000..pdf (9) .PDF (1) .PDF - 20250320 - 195539 - 0000
PROJECT REPORT
ON
Submitted to
Rama Devi Women’s University
COMPUTER SCIENCE
Submited by
Samiksya Patra
Under the Guidance of
Mrs. Sumitra Panda
Faculty, Department of Computer science
Tulasi Women's College, Kendrapara
I sincerely express my deep sense of gratitude to my Guide, Mrs. Sumitra Panda for her
extraordinary cooperation, invaluable guidance and supervision. This dissertation paper
work is the result of his painstaking and generous attitude.
I would like to thank all the faculty members of Dept. of Computer science, Tulasi Women's
collage, Kendrapara for their valuable suggestions and useful comments throughout this
dissertation paper work.
I owe and respectfully offer my thanks to my noble parents for their constant moral support and
mellifluous affection which helped me to achieve success in every sphere of life and without their
kind devotion this dissertation paper work would have been a sheer dream.
I am also thankful to my siblings and friends for their constructive discussions, perseverance
and encouragement during this research work.
I sincerely acknowledge the efforts of all those who have directly or indirectly helped
me in completing my dissertation paper work successfully. It is the kindness of these
acknowledged persons that this dissertation paper work sees the light of the day. I
submit this dissertation paper of mine with great humility and utmost regard bearing
the sole responsibility for any errors.
Samiksya Patra
B.Sc Comp.Sc 3rd Year
Roll No: 55K0122019
College Roll No. –BS(P)-22-002
Tulasi Women's College,
Bhubaneswar
DECLARATION
I, Samiksya Patra, Roll No-55K0122019, Student of B.Sc.Comp.Sc 3rd year undertake to say that the
project titled “LIBRARY MANAGEMENT SYATEM” is a bonafide work done by me under the
guidance of Mrs. Sumitra Panda. Further I undertake to say that no part of the project has been copied
by me.
4. Objectives
7 to 8
5. Methodology- 9 to 10
7. System Design
13 to 56
8. Findings 57 to 60
9. Analysis
61
10. Discussion
62
11. Conclusion 63
12. Reference 64
13.
Annexure 65
INTRODUCTION
INTRODUCTION
1
INTRODUCTION
The project titled Library Management System is Library management software for monitoring and
controlling the transactions in a library The project "Library Management System" is developed in java
script, which mainly focuses on basic operations in a library like adding new member, new books, and
updating new information, searching books and members and facility to borrow and return books.
"Library Management System" is a windows application written for 32-bit Windows operating
systems, designed to help users maintain and organize library. Our software is easy to use for both
beginners and advanced users. It features a familiar and well thought-out, an attractive user interface,
combined with strong searching Insertion and reporting capabilities. The report generation facility of
library system helps to get a good idea of which are the books borrowed by the members, makes users
possible to generate reports hard copy.
Library Management System is an application which refers to library systems which are generally
small or medium in size. It is used by librarian to manage the library record various transactions
like issue of books, return of books, addition of new books, addition of new students etc. Books
and student maintenance modules are also included in this system which would keep track of the
students using the library and also a detailed description about the books a library contains.. In
addition, report module is also included in Library Management System. If user's position is admin,
the user is able to generate different kinds of reports like lists of students registered, list of books,
issue and return reports. All these modules are able to help librarian to manage the library.
The library management system is all about organizing. managing the library, and library-
oriented tasks. It also involves maintaining the database of entering new books and the record
of books that have been retrieved or issued, with their respective dates.
The main aim of this project is to provide an easy to handle and automated library management
system. This project also provides features and an interface for maintaining librarian's records,
student's history of issues, and fines. The owner can easily update, delete and insert data in the
database with this project.
2
LITERATURE REVIEW
3
LITERATURE REVIEW
The use of libraries has grown tremendously in the last decade. Its
processes, such as acquisition, cataloguing, shelving and the general
management of information has evolved through the years, in aspects of
digitisation and in fact knowledge management. All these would not have
happened if not for the need for Librarians to make work easy for
themselves and indeed the library users. This is one of the reasons Younis
(2012) made aware that library users encounter problems when finding,
borrowing, localising, renewing the borrowing, queuing for books. For
most
of the problems, solutions or ongoing researches are on to solve the
problems. However, one area still short of in-depth research, is the area of
integrating topic modelling into library management systems. Topic
modelling is a kind of a probabilistic generative model that has been used
widely in the field of computer science with a specific focus on text mining
and information retrieval in recent years (Liu et. al, 2016). In recent years,
focus have shifted by open and distance learning institutions to electronic
books, hence the large tons of data in the information space. This
ubiquitousness portends a challenge for librarians and most especially users
in skimming through electronic data, in form of books, in finding their
target information. It is safe to say, “you do not judge a book by its cover”
or perhaps its table of content or even abstract. If a user cannot establish the
2 contents of say, a 1000-page book, for instance, by going through the table
of content, abstract or book cover, then how? The traditional means
adopted by most users is to scan through each of the “suspected” books,
before finally settling on one or two. This exercise can be tedious, tasking,
time consuming and in fact, sometimes, ineffective. The digital age has
exposed the minds of users into an unending world of possibilities, thereby,
seeking new and more explorative ways of solving issues in library usage.
4
A Library Management System has been designed to automate, manage and
look after the overall processing of a library, especially in ODL institutions.
Efforts have been made to continually improve on library management
systems, such as application login through smart 3 cards, RFID enabled
smart library for cataloguing, circulation of materials, centralised database,
user identification through their smart cards, theft detection statistics and
reporting web-based module etc (BGIL, 2017). More specifically, the aim is
to simplify library process and in turn save time and cost. The automated
library system (ALS) has undergone significant changes since its inception in
the 1970s. These changes are reflected in the conceptual differences between
the ALS and the integrated library system (ILS) (Kinner, 2009). It was
observed by Uzoma, Oye bola and Izuchukwu (2015) how the importance of
integrated systems in library activities such as cataloguing, circulation,
acquisition and serials management, etc is no longer debatable as libraries all
over the world have realised the need to move from their manual practices
into integrated systems and networked operations. An integrated library
system can be such a robust enterprise resource management system that can
continually adapt and fulfil the requirements and needs of patrons.
According to Müller (2011), “In choosing ILS software, libraries must base
their decision not only on the performance and efficiency of the system, but
also on its fundamental flexibility to readily adapt to the future demands and
needs of their patrons”. Hence the need to consciously continue to improve
on these systems. In integrating more features, it’s important to maintain
standards, as opined by Mandal and Das (2013) that the widespread use of
Integrated Library Systems (ILS), global communications via the Internet,
and growing numbers of digital library initiatives have made the need for
compliance with standards more critical than ever. That is, implementing
information products and systems that support standards should at least
ensure that library systems be able to: more easily adopt new technologies,
such as, topic modelling.
5
RESEARCH GAP
The existing system that is being used in majority of public libraries completely manual
in nature. Information about all the books and members/users is maintained separately
in data entry registers. The entries made in each and every register are having a serial
number corresponding to the register name and year. Also, there are separate registers
for purchase and sale of books and for different user plans. This often leads to
redundant information too. Though some libraries do have computerised system that
provide basic features such as adding books, users etc and also that of issuing the books,
but what they lack is the user involvement and interactivity. Limitations of existing
system
6
OBJECTIVES
7
OBJECTIVES
The objectives of a library management system is to operate a
library with efficiency and at reduced costs. The system being
entirely automated streamlines all the tasks involved in
operations of the library. The activities of book purchasing,
cataloging, indexing, circulation recording and stock checking
are done by the software. Such software eliminates the need for
repetitive manual work and minimizes the chances of errors.
The library management system software helps in reducing
operational costs. Managing a library manually is labor
intensive and an immense amount of paper work is involved. An
automated system reduces the need for manpower and
stationery. This leads to lower operational costs.
8
METHODOLOGY
9
The methodology outlines the approach taken to design, develop, and implement a
Library Management System (LMS).
A Library web-based system literally manages online textual and graphical resources,
which
in turn is made available to users for research and of course, extract information.
Methodology is of two types
To make the library management system of our collage through online survey by
developing a website about our collage LMS which includes a survey through
questionnaire. For this we developed a website using JavaScript and My SQL.
10
SOFTWARE
AND
HARDWARE
REQUIREMENT
SPECIFICATION
11
Hardware
Hardware is a term that refers to all the physical parts that make up a
computer. The internal hardware devices that make up the computer. Various
devices which are essentials to form a hardware is called as components.
Following are the hardware specifications that is required to develop this
project is as follows:
Software
Computer software, or simply software, is a collection of data or computer
instructions that tell the computer how to work. This is in contrast to
physical hardware, from which the system is build and actually performs
the work.
Operating System
Windows11
Ubuntu Linux
12
SYSTEM DESIGN
13
Source Code: login page
// frontend/src/components/Login.jsx
import React, { useState, useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { loginUser } from '../slices/authSlice';
import { useNavigate } from 'react-router-dom';
import { toast } from 'react-toastify';
useEffect(() => {
if (userInfo) {
// Redirect based on user role
if (userInfo.role === 'admin') {
navigate('/admin');
} else {
navigate('/profile');
}
}
}, [userInfo, navigate]);
14
return (
<div className="flex items-center justify-center min-h-screen bg-gray-100">
<div className="max-w-md w-full bg-white p-8 rounded-lg shadow-xl">
<h2 className="text-3xl font-bold mb-6 text-center text-gray-800">Login</h2>
{error && <div className="mb-4 text-red-500">{error}</div>}
<form onSubmit={handleSubmit} className="space-y-4">
<input
type="email" placeholder="Email" required
value={email} onChange={(e) =>
setEmail(e.target.value)}
15
1)Login Page:
This is the Library Management System login form. Here the
Admin has to enter his Username and Password. When the Admin
registers, the email he enters is his Username.
16
Source Code:
Home Page
import React from 'react'; import { Link
} from 'react-router-dom'; import {
motion } from 'framer-motion';
/>
<motion.path
d="M280 320 L480 320 L480 300 L280 300 Z"
fill="#2563EB"
initial={{ x: -50 }}
animate={{ x: 0 }}
transition={{ duration: 0.5, delay: 0.6 }}
/>
17
stroke="#E5E7EB"
strokeWidth="2"
fill="none"
initial={{ pathLength: 0 }}
animate={{ pathLength: 1 }}
transition={{ duration: 2, repeat: Infinity }}
/>
<motion.circle
cx="350" cy="150" r="5" fill="#4F46E5"
initial={{ scale: 0 }} animate={{ scale: [0, 1,
0] }} transition={{ duration: 2, repeat:
Infinity }}
/>
</motion.g>
</svg>
);
// New wave divider component
const WaveDivider = ({ className = "", fill = "white" }) => (
<div className={`absolute bottom-0 left-0 right-0 transform ${className}`}>
<svg viewBox="0 0 1440 120" fill="none" xmlns="http://www.w3.org/2000/svg">
<motion.path
initial={{ opacity: 0, pathLength: 0 }}
animate={{ opacity: 1, pathLength: 1 }}
transition={{ duration: 1.5 }}
d="M0 120L60 110C120 100 240 80 360 70C480 60 600 60 720 65C840 70 960 80 1080
85C1200 90 1320 90 1380 90L1440 90V120H1380C1320 120 1200 120 1080 120C960 120 840
120 720 120C600 120 480 120 360 120C240 120 120 120 60 120H0V120Z"
fill={fill}
/>
</svg>
</div>
);
18
const numberAnimation = {
hidden: { opacity: 0, y: 20 },
visible: {
opacity: 1,
y: 0,
transition: { duration: 0.5 }
}
};
onst Landing = () => { return ( <div
className="min-h-screen overflow-hidden">
{/* Hero Section - Remains the same as your original code */}
<section className="min-h-screen relative bg-gradient-to-br from-indigo-500 via-purple-
500 to-pink-500">
{/* ... Your existing hero section code ... */}
<div className="absolute inset-0 bg-[url('data:image/svg+xml,...')] opacity-10"></div>
<div className="max-w-7xl mx-auto px-4 h-screen flex items-center">
<div className="grid grid-cols-1 md:grid-cols-2 gap-12 items-center">
<motion.div
initial={{ opacity: 0, x: -50 }}
animate={{ opacity: 1, x: 0 }}
transition={{ duration: 0.8 }}
className="text-white"
>
<h1 className="text-6xl font-bold mb-6">
Your Digital
<span className="block text-transparent bg-clip-text bg-gradient-to-r
from-yellow-200 to-yellow-400">
Library Partner
</span>
</h1>
19
<div className="space-x-4">
<motion.button
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
className="bg-white text-indigo-600 px-8 py-3 rounded-lg hover:shadow-
lg transition"
>
Get Started
</motion.button>
<motion.button
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
className="border-2 border-white text-white px-8 py-3 rounded-lg
hover:bg-white/10 transition"
>
Learn More
</motion.button>
</div>
</motion.div>
<div className="hidden md:block h-[500px]">
<BooksSVG />
</div>
</div>
</div>
{/* Decorative waves */}
<div className="absolute bottom-0 left-0 right-0">
<svg viewBox="0 0 1440 120" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M0 120L60 110C120 100 240 80 360 70C480 60 600 60 720 65C840 70 960 80 1080
85C1200 90 1320 90 1380 90L1440 90V120H1380C1320 120 1200 120 1080 120C960
120 840 120 720 120C600 120 480 120 360 120C240 120 120 120 60 120H0V120Z"
fill="white"
/>
</svg>
</div>
<WaveDivider />
</section>
20
{/* Features Section - Your existing code remains */}
<section className="py-20 bg-white relative">
{/* ... Your existing features section code ... */}
<div className="max-w-7xl mx-auto px-4">
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.8 }}
className="text-center mb-16"
>
<h2 className="text-4xl font-bold mb-4">Powerful Features</h2>
<p className="text-gray-600">Everything you need to manage your library efficiently</p>
</motion.div>
>
{[
{ number: "10K+", label: "Books Available" },
{ number: "5K+", label: "Active Users" },
{ number: "99%", label: "Satisfaction Rate" },
{ number: "24/7", label: "Support" }
].map((stat, index) => (
<motion.div
key={index}
variants={numberAnimation}
initial="hidden"
whileInView="visible"
viewport={{ once: true }}
transition={{ delay: index * 0.2 }}
className="text-center p-6 bg-white/50 backdrop-blur-sm rounded-xl hover:shadow-xl
transition-shadow"
>
<h3 className="text-4xl font-bold bg-gradient-to-r from-indigo-600 to-purple-600
bg- clip-text text-transparent">
{stat.number}
</h3>
22
<p className="text-gray-600 mt-2">{stat.label}</p>
</motion.div>
))}
</motion.div>
</div>
<WaveDivider fill="white" />
</section>
{/* Testimonials Section */}
<section className="py-20 bg-white relative">
<div className="max-w-7xl mx-auto px-4">
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
className="text-center mb-16"
>
<h2 className="text-4xl font-bold mb-4">What Our Users Say</h2>
<p className="text-gray-600">Trusted by librarians and readers worldwide</p>
</motion.div>
},
{
23
].map((testimonial, index) => (
<motion.div
key={index}
initial={{ opacity: 0, x: -20 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{ delay: index * 0.2 }}
className="p-6 bg-gradient-to-br from-purple-50 to-indigo-50 rounded-xl
shadow-lg hover:shadow-xl transition-shadow"
>
<div className="mb-4 text-4xl">❝</div>
<p className="text-gray-600 mb-4">{testimonial.text}</p>
<div className="border-t pt-4">
<p className="font-semibold">{testimonial.author}</p>
<p className="text-sm text-gray-500">{testimonial.role}</p>
</div>
</motion.div>
))}
</div>
</div>
</section>
24
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
className="max-w-lg mx-auto"
>
<div className="bg-white/10 backdrop-blur-lg rounded-xl p-8">
<form className="space-y-4">
<input
type="text"
placeholder="Your Name"
className="w-full p-3 bg-white/5 border border-gray-700 rounded-lg
focus:outline-none focus:ring-2 focus:ring-purple-500 transition-all text-white"
/>
<input
type="email"
placeholder="Your Email"
className="w-full p-3 bg-white/5 border border-gray-700 rounded-lg
focus:outline-none focus:ring-2 focus:ring-purple-500 transition-all text-white"
/>
<textarea
placeholder="Your Message"
rows={4}
className="w-full p-3 bg-white/5 border border-gray-700 rounded-lg
focus:outline-none focus:ring-2 focus:ring-purple-500 transition-all text-white"
/>
<motion.button
whileHover={{ scale: 1.02 }}
whileTap={{ scale: 0.98 }}
className="w-full bg-gradient-to-r from-purple-500 to-indigo-500 text-white py-3
rounded-lg hover:from-purple-600 hover:to-indigo-600 transition-all"
>
Send Message
</motion.button>
</form>
</div>
</motion.div>
</div>
</section>
25
{/* Footer - Enhanced version of your existing footer */}
<footer className="bg-black text-white py-12">
<div className="max-w-7xl mx-auto px-4">
<div className="grid grid-cols-1 md:grid-cols-4 gap-8">
<div>
<h3 className="text-xl font-semibold mb-4">About Us</h3>
<p className="text-gray-400">Modern library management system for
efficient book and user management.</p>
</div>
<div>
<h3 className="text-xl font-semibold mb-4">Quick Links</h3>
<ul className="space-y-2 text-gray-400">
<li><Link to="/" className="hover:text-white transition">Home</Link>
</li>
<li><Link to="/about" className="hover:text-white
transition">About</Link></li>
<li><Link to="/features" className="hover:text-white
transition">Features</Link></li>
<li><Link to="/contact" className="hover:text-white
transition">Contact</Link></li>
</ul>
</div>
<div>
<h3 className="text-xl font-semibold mb-4">Contact</h3>
<ul className="space-y-2 text-gray-400">
<li>Email: info@library.com</li>
<li>Phone: (555) 123-4567</li>
<li>Address: 123 Library Street</li>
</ul>
</div>
26
<div>
<h3 className="text-xl font-semibold mb-4">Follow Us</h3>
<div className="flex space-x-4">
{['Twitter', 'Facebook', 'Instagram', 'LinkedIn'].map((social) => (
<motion.a
key={social}
href="#"
whileHover={{ scale: 1.1 }}
whileTap={{ scale: 0.9 }}
className="w-10 h-10 bg-gray-800 rounded-full flex items-center justify-center
hover:bg-gray-700 transition"
>
{social[0]}
</motion.a>
))}
</div>
</div>
</div>
<div className="border-t border-gray-800 mt-8 pt-8 text-center text-gray-400">
<p>© 2025 Library Management System. All rights reserved.</p>
</div>
</div>
</footer>
</div>
);
};
27
4) Home:
This is the Main Window of the Library Management System.
From here the Admin uses this system.
28
Admin Page
Source Code:
import React, { useEffect, useState, useMemo } from 'react';
import { Panel, PanelGroup } from 'react-resizable-panels';
import { useDispatch, useSelector } from 'react-redux';
import { fetchBooks, addBook } from '../slices/booksSlice';
import { useNavigate } from 'react-router-dom';
import axios from 'axios';
import { toast } from 'react-toastify';
const predefinedCategories = [
"Fiction",
"Non-Fiction",
"Science",
"History",
"Biography",
"Mystery",
"Fantasy",
"Uncategorized"
];
function AdminDashboard() {
const dispatch = useDispatch();
const { books, loading, error } = useSelector((state) => state.books);
const { userInfo } = useSelector((state) => state.auth);
const navigate = useNavigate();
29
const [selectedCategory, setSelectedCategory] = useState(null);
const [selectedBookData, setSelectedBookData] = useState(null); // { book, transactions }
const [showModal, setShowModal] = useState(false);
const [updatePrices, setUpdatePrices] = useState({
price: 0,
rentalPrice: 0,
});
useEffect(() => {
dispatch(fetchBooks());
}, [dispatch]);
} catch (error) {
console.error('Error updating prices:', error);
toast.error('Failed to update prices.');
}
};
const addBookHandler = async (e) => {
e.preventDefault();
console.log("Sending book data:", newBook); // ✅ Debugging log
try {
30
price: newBook.price,
✅ Force default
rentalPrice: newBook.rentalPrice,
image: newBook.image || "https://via.placeholder.com/200x250?text=No+Image", //
image if missing
}, {
headers: { Authorization: `Bearer ${userInfo.token}` },
});
✅
console.log("Book added successfully:", data); // Debugging log
toast.success('Book added successfully!');
dispatch(fetchBooks());
setNewBook({
title: '',
description: '',
author: '',
isbn: '',
categories: [],
price: 0,
rentalPrice: 0,
image: '',
});
} catch (error) {
console.error('Error adding book:', error.response?.data || error);
toast.error('Failed to add book.');
}
};
setShowModal(true);
} catch (error) {
31
console.error('Error fetching book details:', error);
toast.error('Failed to load book details.');
}
} ;
const closeModal = () => {
setShowModal(false);
setSelectedBookData(null); };
const handleImageError = (e) => {
e.target.onerror = null;
e.target.src = 'https://via.placeholder.com/400x300?text=No+Image';
};
// Filter books by selected category if one is selected; otherwise, return all books
const filteredBooks = useMemo(() => {
if (selectedCategory) {
return books.filter((book) => {
if (Array.isArray(book.category)) {
return book.category.includes(selectedCategory);
}
r e t u r n ( b o o k . c a t e g o r y | | ' U n c a t e g o r
});
}
32
return books;
}, [books, selectedCategory]);
33
<CategoryFolders
categories={categories}
selectedCategory={selectedCategory}
onSelectCategory={setSelectedCategory}
/>
</div>
<div className="mb-6">
<BooksList
books={filteredBooks}
handleBookClick={handleBookClick}
handleImageError={handleImageError}
/>
</div>
</Panel>
</PanelGroup>
</main>
{/* Book Modal */}
{showModal && selectedBookData && (
<BookModal
selectedBookData={selectedBookData}
updatePrices={updatePrices}
setUpdatePrices={setUpdatePrices}
updatePriceHandler={updatePriceHandler}
closeModal={closeModal}
handleImageError={handleImageError}
handleDeleteBook={userInfo?.role === 'admin' ? handleDeleteBook : null}
/>
)}
</div>
);
}
34
3)Admin:
This is the Main Window of the Library Management System. From here
the Admin uses this system.
35
Registration Page
Source Code
// frontend/src/components/Register.jsx
import React, { useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { registerUser } from '../slices/authSlice';
import { useNavigate } from 'react-router-dom';
return (
<div className="max-w-md mx-auto mt-10 bg-white p-8 rounded-lg shadow-xl">
<h2 className="text-3xl font-bold mb-6 text-center text-gray-800">Register</h2>
{error && <div className="mb-4 text-red-500">{error}</div>}
<form onSubmit={submitHandler} className="space-y-6">
<div>
<label className="block mb-2 text-sm font-medium text-gray-700">Name</label>
<input
type="text"
className="w-full p-3 border border-gray-300 rounded focus:outline-none focus:ring-2
focus:ring-blue-400"
value={name}
onChange={(e) => setName(e.target.value)}
required
/>
36
</div>
<div>
<label className="block mb-2 text-sm font-medium text-gray-700">Email</label>
<input
type="email"
className="w-full p-3 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-
blue-400"
value={email}
onChange={(e) => setEmail(e.target.value)}
required
/>
</div>
<div>
<label className="block mb-2 text-sm font-medium text-gray-700">Password</label>
<input>
type="password"
className="w-full p-3 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-
blue-400"
value={password}
onChange={(e) => setPassword(e.target.value)}
required
/>
</div>
<button
type="submit"
disabled={loading}
className="w-full bg-green-500 hover:bg-green-600 text-white p-3 rounded transition duration-300"
>
{loading ? 'Loading...' : 'Register'}
</button>
</form>
</div>
);
}
37
1) Registration:
The User or Admin has to first register to use the Library Management System.
This is the Registration input screen, in which the user has to enter some details
to generate his Username and Password.
38
Source Code
User Details
// frontend/src/components/UserDashboard.jsx
import React, { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { fetchBooks } from '../slices/booksSlice';
import { useNavigate } from 'react-router-dom';
import axios from 'axios';
function UserDashboard() {
const dispatch = useDispatch();
const { books, loading, error } = useSelector((state) => state.books);
const { userInfo } = useSelector((state) => state.auth);
const [profile, setProfile] = useState(null);
const navigate = useNavigate();
useEffect(() => {
dispatch(fetchBooks());
const fetchProfile = async () => {
try {
const config = { headers: { Authorization: `Bearer ${userInfo.token}` } };
const { data } = await axios.get('/api/users/profile', config);
setProfile(data);
} catch (err) {
console.error(err);
}
};
fetchProfile();
}, [dispatch, userInfo.token]);
39
const rentOrBuyHandler = async (bookId, type) => {
try {
const config = { headers: { Authorization: `Bearer ${userInfo.token}` } };
await axios.post('/api/transactions', { bookId, type }, config);
alert(`Book ${type} successful!`);
} catch (err) {
console.error(err);
alert('Transaction failed.');
}
} ;
return (
<div className="p-6">
<div className="flex justify-between items-center mb-6">
<h1 className="text-3xl font-bold">User Dashboard</h1>
</div>
{profile && (
<div className="mb-6">
<h2 className="text-2xl font-semibold">Profile</h2>
<p><strong>Name:</strong> {profile.name}</p> <p>
<strong>Email:</strong> {profile.email}</p> <div
className="mt-4">
<h3 className="font-semibold">Purchased Books:</h3>
<ul>
{profile.purchasedBooks.map(book => (
<li key={book._id}>{book.title}</li>
))}
</ul>
40
<h3 className="font-semibold mt-4">Rented Books:</h3>
<ul>
{profile.rentedBooks.map(book => (
<li key={book._id}>{book.title}</li>
))}
</ul>
</div>
</div>
)}
<div>
<p>Loading books...</p>
) : error ? (
<p className="text-red-500">{error}</p>
):(
<ul className="space-y-2">
{books.map(book => (
<li key={book._id} className="p-4 bg-white rounded shadow flex justify-
between">
<div>
<h3 className="font-bold">{book.title}</h3>
<p>{book.author}</p>
</div>
<div className="space-x-2">
<button
onClick={() => rentOrBuyHandler(book._id, 'rental')}
className="bg-blue-500 text-white p-2 rounded"
>
41
Rent
</button>
<button
onClick={() => rentOrBuyHandler(book._id, 'purchase')}
className="bg-green-500 text-white p-2 rounded"
> Buy </button> </div> </li> ))} </ul> )}
</div> </div> ); }
42
Book Information
Source Code
// frontend/src/components/BookCard.jsx
import React from 'react';
<div
className="w-32 flex-shrink-0 bg-white rounded shadow hover:scale-105 transform transition
duration-300 cursor-pointer"
onClick={() => handleBookClick(book._id)}
>
{book.image ? (
<img
src={book.image}
alt={book.title}
onError={handleImageError}
</div>
</div>
);
};
43
// frontend/src/components/BookModal.jsx
import React, { useState } from 'react';
import ConfirmModal from './ConfirmModal';
const BookModal = ({
selectedBookData,
updatePrices,
setUpdatePrices,
updatePriceHandler,
closeModal,
handleImageError,
handleDeleteBook // Optional: if provided, deletion is available
}) => {
const [showConfirm, setShowConfirm] = useState(false);
44
return (
<>
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-
50">
<div className="relative bg-white rounded shadow-lg max-w-2xl w-full p-6 animate-
fadeIn">
{handleDeleteBook && (
<button
onClick={() => setShowConfirm(true)}
className="absolute top-2 left-2 bg-red-500 text-white px-3 py-1 rounded"
>
Delete Book
</button>
)}
<button
className="absolute top-2 right-2 text-gray-600 hover:text-gray-800"
onClick={closeModal}
>
Close
</button>
<div className="flex flex-col md:flex-row">
<div className="md:w-1/3">
{selectedBookData.book.image ? (
<img
src={selectedBookData.book.image}
alt={selectedBookData.book.title}
onError={handleImageError}
className="w-full h-auto rounded"
/>
45
):(
<div className="w-full h-48 bg-gray-200 flex items-center justify-center rounded">
<span className="text-gray-500">No Image</span>
</div>
)}
</div>
<div className="md:w-2/3 md:pl-4 mt-4 md:mt-0">
<h2 className="text-2xl font-bold">{selectedBookData.book.title}</h2>
<p className="text-gray-600 mb-2">by {selectedBookData.book.author}</p>
<p className="mb-4">{selectedBookData.book.description}</p>
<div className="mb-4">
/>
</div>
<div className="mb-4">
<label className="font-semibold">Rental Price: </label>
<input
type="number"
className="border p-1 rounded ml-2"
value={updatePrices.rentalPrice}
onChange={(e) => setUpdatePrices({ ...updatePrices, rentalPrice:
Number(e.target.value) })}
/>
</div>
46
<button
onClick={updatePriceHandler}
className="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded transition
duration-300" > Update Prices </button> </div> </div>
<div className="mt-6">
<div className="mt-6">
<h3 className="text-xl font-bold mb-2">Transactions</h3>
{selectedBookData.transactions && selectedBookData.transactions.length
>0?(
47
<ul className="list-disc pl-5">
{selectedBookData.transactions.map((tx) => (
<li key={tx._id}>
{tx.user.name} ({tx.user.email}) - {tx.type}
</li>
))}
</ul>
):(
<p>No transactions yet.</p>
> )}
</div>
</div>
</div>
<ConfirmModal
isOpen={showConfirm}
title="Confirm Deletion"
message="Are you sure you want to delete this book? This action cannot be undone."
onConfirm={onDeleteConfirm}
onCancel={onDeleteCancel}
/>
</>
);
};
48
6) Book Details: This is Library Management System Book Details Form. This form
shows the details of the Books of the Library such as the Title of the Book, Author
Name, Price of the Book and other details to the Administrator.
49
Source Code
Borrowing Book
{/* Search and Sort Section */}
<div className="flex flex-col sm:flex-row items-center justify-between mb-4 space-y-2
sm:space-y-0 sm:space-x-4">
<div className="w-full sm:w-48">
<input
type="text"
placeholder="Search books..."
value={searchTerm}
focus:ring-blue-400"
/>
</div>
<div className="w-full sm:w-48">
<select
value={sortBy}
onChange={(e) => setSortBy(e.target.value)}
{currentBooks.map((book) => (
50
<BookCard
key={book._id}
book={book}
handleBookClick={handleBookClick}
handleImageError={handleImageError}
/>
))}
</div>
51
<button
onClick={() => handlePageChange(currentPage + 1)}
disabled={currentPage === totalPages}
className="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-md
transition-all disabled:opacity-50"
>
Next
</button>
</div>
</div>
</div>
);
};
52
logout Page
Source Code
{/* Right Side: Profile Avatar & Logout */}
{userInfo && (
<div className="flex items-center space-x-6">
<motion.div
whileHover={{ scale: 1.1 }}
whileTap={{ scale: 0.9 }}
>
<Link to="/profile" className="relative group">
{avatarUrl ? (
<img
src={avatarUrl}
alt="Profile"
className="w-10 h-10 rounded-full object-cover ring-2 ring-blue-500 ring-offset-2"
/>
):(
<div className="w-10 h-10 rounded-full bg-gradient-to-br from-blue-500 to-blue-600 flex
items-center justify-center text-white text-sm font-semibold ring-2 ring-blue-500 ring-offset-2">
{getInitials(userInfo.name)}
</div>
)}
<motion.div
initial={{ opacity: 0, scale: 0.8 }}
whileHover={{ opacity: 1, scale: 1 }}
className="absolute -bottom-12 left-1/2 transform -translate-x-1/2 bg-gray-800 text-white
px-3 py-1 rounded text-sm whitespace-nowrap"
>
View Profile
</motion.div>
</Link>
</motion.div>
53
<motion.button
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
onClick={() => {
dispatch(logout());
navigate('/');
}}
className="bg-gradient-to-r from-red-500 to-red-600 hover:from-red-600 hover:to-red-700
text-white px-6 py-2 rounded-lg shadow-md hover:shadow-lg transition-all duration-200 flex items-
center space-x-2"
>
<span>Logout</span>
</motion.button>
</div>
)}
</div>
</motion.nav>
>
<AnimatePresence mode="wait">
<Routes>
{/* Public Routes */}
<Route path="/login" element={<Login />} />
<Route path="/register" element={<Register />} />
<Route path="/" element={<Landing />} />
54
{/* Protected Routes */}
<Route
path="/catalog"
element={
<ProtectedRoute>
<BooksCatalog />
</ProtectedRoute>
}
/ >
< R
opauth="/profile"
telem ent={
<ProtectedRoute>
<Profile />
</ProtectedRoute>
}
/ >
55
<Route
path="/userlist"
element={
<ProtectedRoute adminOnly> <UserList />
</ProtectedRoute> } /> <Route path="*"
element={<ErrorPage />} /> </Routes>
</AnimatePresence> </motion.div>
</motion.div> );
56
FINDINGS
57
58
59
These are the results of the survey I performed online
60
ANALYSIS
1- From the first graph we got to know that most of the people visit library
rarely
2- From the second graph , we got to know that most of the people search
for books by browsing shelves manually
3 - From the third graph , we got to know that the features people use the
most in LIBRARY MANAGEMENT SYSTEM is Book search and catelog
4 - From the fourth graph we got to know that most people feel neutral
about the LIBRARY MANAGEMENT SYSTEM
5 - From the fifth graph we got to know that the most common issue people
face with the LIBRARY MANAGEMENT SYSTEM is not clear
6- From the sixth graph we got to know that most of the people never
receive timely notifications for due dates and overdue books
7- From the seventh graph we got to know that the ease of the use of the
library management system is moderate
8 - From the eighth graph we got to know that the additional feature they
would like in the library system is Improved search filters
9 - From the ninth graph we got to know that the responses for accessing
eBook through the digital system is same for 3 options
Which are - Depending on availability -rarely -prefering physical books
10 - from the last graph we got to know that the most people would prefer
to access the library sy stem is by Mobile App .
61
DISCUSSION
FUTURE SCOPE OF PROJECT
Our web-based application “Library Management System” which
provides complete information about Users like Student, Admin and
Lecturer. We will add more content on them in future. In our web-
based
application right now, only Books and Users with their information
available but in future we will add Online Lectures, Links, etc.
62
CONCLUSION
Library Management System allows the user to store the book details and the customer
details. This
software package allows storing the details of all the data related to library. The system is
strong enough
to withstand regressive yearly operations under conditions where the database is maintained
and cleared
over a certain time of span. The implementation of the system in the organization will
considerably
reduce data entry, time and also provide readily calculated reports.
63
REFERENCES
https://www.tutorialspoint.com/index.htm
https://www.javatpoint.com
https://www.w3schools.com
https://html.com
Books References:
64
ANNEXURE
-How often do you visit library ?
-How do you usually search for books in the library?
-What features do you use the most in the library management system?
-How satisfied are you with the current library management system?
-What is the most common issue you face with the library system?
-Do you receive timely notifications for due dates and overdue books?
-How would you rate the ease of use of the library management system?
-What additional feature would you like in the library system?
-Would you be interested in accessing eBook through digital system?
-How would you prefer to access the library system?
66