Converted Text
Converted Text
1. Title Page
Project Title: Library Management System
Your Name/Group Names: By Prashant Chauhan, Bharat Chauhan, Dhruv Chauhan
Course/Subject: BCA 3rd Year
Teacher/Instructor: Mr. Rajat Dixit
School/College Name: R.B.S College Technical Campus, Agra
Date of Submission: May 23, 2025
2. Acknowledgement
"I would like to express my sincere gratitude to my teacher, Mr. Rajat Dixit, for their invaluable
guidance and support throughout this project. I also thank my friends and family for their
encouragement."
3. Table of Contents
1. Introduction 1.1. Project Overview 1.2. Purpose of the Project 1.3. Objectives
2. System Analysis 2.1. Existing System 2.2. Proposed System 2.3. Feasibility Study
3. System Design 3.1. User Interface Design 3.2. Data Structure / In-Memory Storage 3.3. System
Flow
4. Implementation 4.1. Technologies Used 4.2. Key Code Snippets & Screenshots
5. Features and Functionality 5.1. Core Functionalities 5.2. Special Features
6. Testing
7. Future Scope
8. Conclusion
9. Bibliography/References
4. Introduction
This project presents a web-based Library Management System designed to streamline and
automate the basic operations within a library, such as user login, book management (adding
and deleting), member management (adding and deleting), and the issuance and return of books.
It aims to provide a user-friendly interface for managing library resources efficiently.
4.2. Purpose of the Project
The primary purpose of this project is to develop a simple yet effective digital platform for
managing common library tasks. It addresses the need for an organized system to track books
and members, facilitating easier access and control over library assets compared to manual
record-keeping.
4.3. Objectives
To develop a secure login mechanism for authorized library personnel
.
5. System Analysis
5.1. Existing System (Manual/Traditional Approach)
Traditionally, library management often involves manual registers and physical tracking, which
can lead to inefficiencies such as:
The proposed Library Management System aims to overcome these limitations by providing a
digital solution. It offers a centralized interface for all core library operations, enhancing speed,
accuracy, and overall operational efficiency. The web-based nature allows for accessibility and a
structured approach to data management.
6. System Design
The system features a clean and responsive user interface, designed using HTML and styled with
Tailwind CSS. It includes distinct sections for login, book management, member management,
and issue/return operations.
6.2. Data Structure / In-Memory Storage
The system currently uses JavaScript arrays to store book, member, and issued book data in
memory.
books
: An array of objects, each representing a book with
id
,
title
,
author
, and
isbn
.
members
: An array of objects, each representing a member with
id
and
name
.
issuedBooks
: An array of objects, each tracking an issued book with
bookId
,
memberId
, and
issueDate
.
3. Book Management:
Users can add new books by providing a title, author, and ISBN. Existing books are displayed in
a list and can be deleted
.
4. Member Management:
Users can add new members by providing a name and a member ID. Existing members are
displayed in a list and can be deleted
.
5. Issue/Return Book:
Issue:
Books can be issued by entering a Book ID and Member ID. The system checks if both exist
and if the book is not already issued
.
Return:
Books can be returned by entering the Book ID. The system removes the record from the
issued books list
.
6. Logout:
A logout button allows users to return to the login screen
.
7. Implementation
Fonts:
Google Fonts ('Inter')
This section demonstrates the core functionalities of the Library Management System through
screenshots of the user interface and corresponding code snippets.
Description: This is the initial screen users see. It requires a username and password to
access the main system dashboard. An error message appears for invalid credentials.
Screenshot (GUI):
[Insert a screenshot of your login page, showing the username, password fields, and login
button.]
Code Snippet:
HTML
JavaScript
Description: This section allows librarians to add new books to the system by entering their
title, author, and ISBN. The newly added books are immediately reflected in the book list.
Screenshot (GUI):
[Insert a screenshot of the "Book Management" section, specifically showing the input
fields for Title, Author, ISBN, and the "Add Book" button. Also show the Books list with
some entries.]
Code Snippet:
HTML
<section class="mb-8">
<h3 class="text-xl font-semibold text-gray-700 mb-4">Book Management</h3> [cite: 5]
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4"> [cite: 6]
<div class="bg-gray-50 rounded-md p-4">
<label for="add-book-title" class="block text-gray-700 text-sm font-bold mb-2">Title:</label>
[cite: 6]
<input type="text" id="add-book-title" class="shadow appearance-none border rounded w-full
py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> [cite: 6]
</div>
<div class="bg-gray-50 rounded-md p-4">
<label for="add-book-author" class="block text-gray-700 text-sm font-bold mb-2">Author:</
label> [cite: 7]
<input type="text" id="add-book-author" class="shadow appearance-none border rounded w-
full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> [cite: 7]
</div>
<div class="bg-gray-50 rounded-md p-4">
<label for="add-book-isbn" class="block text-gray-700 text-sm font-bold mb-2">ISBN:</label>
[cite: 8]
<input type="text" id="add-book-isbn" class="shadow appearance-none border rounded w-full
py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> [cite: 8]
</div>
</div>
<button id="add-book-button" class="bg-green-500 hover:bg-green-700 text-white font-bold
py-2 px-4 rounded focus:outline-none focus:shadow-outline">Add Book</button> [cite: 9]
JavaScript
Explanation:
The HTML structure defines the input fields and button for adding books
. The
addBookButton
event listener captures input values, creates a new book object with a simple ID, adds it to
the
books
array, and then calls
renderBookList()
to update the displayed list
. The
renderBookList()
function dynamically generates list items for each book, including a delete button that
allows removal from the array
.
Description: This module handles the core operations of issuing books to registered
members and processing their returns. It prevents issuing a book that is already out.
Screenshot (GUI):
[Insert a screenshot of the "Issue/Return Book" section, showing the Book ID, Member ID
input fields, and the "Issue Book" and "Return Book" buttons. Also, show the Issued Books
list.]
Code Snippet:
HTML
<section>
<h3 class="text-xl font-semibold text-gray-700 mb-4">Issue/Return Book</h3> [cite: 14]
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"> [cite: 14]
<div class="bg-gray-50 rounded-md p-4">
<label for="issue-book-id" class="block text-gray-700 text-sm font-bold mb-2">Book ID:</
label> [cite: 14]
<input type="text" id="issue-book-id" class="shadow appearance-none border rounded w-full
py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> [cite: 14, 15]
</div>
<div class="bg-gray-50 rounded-md p-4">
<label for="issue-member-id" class="block text-gray-700 text-sm font-bold mb-2">Member
ID:</label> [cite: 15]
<input type="text" id="issue-member-id" class="shadow appearance-none border rounded w-
full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> [cite: 15]
</div>
</div>
<button id="issue-book-button" class="bg-purple-500 hover:bg-purple-700 text-white font-bold
py-2 px-4 rounded focus:outline-none focus:shadow-outline mr-2">Issue Book</button> [cite:
16]
<button id="return-book-button" class="bg-yellow-500 hover:bg-yellow-700 text-white font-bold
py-2 px-4 rounded focus:outline-none focus:shadow-outline">Return Book</button> [cite: 16]
JavaScript
if (book && member) { // Make sure book and member exist [cite: 35]
const listItem = document.createElement("li"); [cite: 36]
listItem.className = "bg-gray-50 rounded-md p-2 mb-2 flex justify-between items-center";
[cite: 36]
listItem.textContent = `${book.title} (Issued to: ${member.name}, Issue Date:
${item.issueDate})`; [cite: 36]
Explanation:
The HTML provides input fields for Book ID and Member ID, and buttons for issuing and
returning books
. The JavaScript for
issueBookButton
verifies the existence of the book and member, and checks if the book is already issued
before adding it to the
issuedBooks
array
. The
returnBookButton
logic removes the book from the
issuedBooks
array if found
. The
renderIssuedBooksList()
function dynamically displays all currently issued books with their details and a "Return"
button
.
Book Management:
Add new book records (Title, Author, ISBN)
.
Member Management:
Book Issue/Return:
User-Friendly Interface:
The system leverages Tailwind CSS for a modern, clean, and responsive design, ensuring a
good user experience across different screen sizes
.
Basic Validation:
Includes simple validation checks, such as ensuring all input fields are filled before adding
new records
and preventing a book from being issued if it's already out
.
9. Testing
Login Test: Verified that the "admin" / "password" credentials grant access, and incorrect
credentials display an error.
Book Management Test: Tested adding new books, verifying their appearance in the list, and
successfully deleting books.
Member Management Test: Tested adding new members, verifying their appearance in the
list, and successfully deleting members.
Issue/Return Test:
To enhance this Library Management System, the following features could be implemented in the
future:
Persistent Data Storage: Integrate with a backend database (e.g., MySQL, PostgreSQL,
MongoDB) to ensure data persistence even after the application is closed.
Advanced Search Functionality: Implement more robust search filters for books (by genre,
publication year) and members.
User Roles and Permissions: Develop a more sophisticated user management system with
different roles (e.g., librarian, administrator) and fine-grained access control.
Due Dates and Fine Calculation: Implement functionality to set due dates for issued books
and automatically calculate fines for overdue returns.
Reporting: Generate reports on popular books, overdue books, member activity, etc.
Notifications: Implement email or SMS notifications for overdue books or new arrivals.
Frontend Framework: Transition to a more advanced JavaScript framework (e.g., React, Vue,
Angular) for better component management and scalability.
Barcode Integration: Allow for scanning barcodes to quickly manage books.
11. Conclusion
This Library Management System project successfully demonstrates the fundamental principles
of web application development using HTML, CSS, and JavaScript. It provides a functional and
intuitive interface for managing key library operations, from user authentication to book and
member management, and the crucial process of issuing and returning books. While currently
utilizing in-memory data storage, it lays a strong foundation for future expansion into a more
robust and scalable solution with persistent data and advanced features.
12. Bibliography/References
Tailwind CSS Documentation (
https://tailwindcss.com/
)
Google Fonts (
https://fonts.google.com/
)
you have the project and now do all the necessary things for the project and make the file look
awesome and make it atleast more than 50 to 60 pages file and it should be clear and clean.fill
all details and you have the file also so attach some screen shots in between the file and tell
about screen shot what will it do?
To create a project file that's 50-60 pages long and looks "awesome, clear, and clean" with
screenshots and detailed explanations, we'll need to significantly expand on each section I
previously outlined. Since I cannot directly generate a multi-page document with embedded
images and precise formatting like a PDF or Word document, I will provide you with the content
and structure that you can then use to assemble your final file.
I'll elaborate on each section, provide specific details based on your library mngmnt sytem.txt file,
and indicate where you should insert your own screenshots, along with the accompanying
descriptions.
Generate your own screenshots: You will need to run your library mngmnt sytem.txt (rename
it to index.html to run in a browser) and take screenshots of each functionality.
Use a Word Processor or LaTeX: To achieve the desired page count, professional look, and
easy embedding of images, I highly recommend using a word processor like Microsoft Word,
Google Docs, or LibreOffice Writer. For a truly professional and clean look, especially if you're
comfortable with it, LaTeX is an excellent choice.
Font and Styling: Stick to a consistent font (e.g., Arial, Calibri, Times New Roman for
professional documents; Inter, as used in your code, could also be a good choice if available
and legible in print). Use clear headings and subheadings.
Page Numbers: Ensure page numbers are included.
Table of Contents: Generate an automatic Table of Contents in your word processor once the
document is finalized, as page numbers will shift.
Submitted To: Mr. Rajat Dixit [Teacher's Designation, e.g., Assistant Professor, Department of
Computer Science]
2. Acknowledgement
I would like to express my sincere gratitude to my esteemed teacher, Mr. Rajat Dixit, for his
invaluable guidance, continuous support, and insightful feedback throughout the duration of this
project. His expertise and encouragement were instrumental in the successful completion of the
Library Management System.
I also extend my heartfelt thanks to my friends and family for their unwavering support and
motivation, which helped me overcome challenges and stay focused on my goals. Their belief in
my abilities truly made a difference.
3. Certificate
This is to certify that the project entitled "Library Management System" is a bonafide work carried
out by Prashant Chauhan, Bharat Chauhan, and Dhruv Chauhan, students of BCA 3rd Year, R.B.S
College Technical Campus, Agra, during the academic year 2024-2025. This project has been
prepared under my direct supervision and guidance and is submitted in partial fulfillment of the
requirements for the award of the Bachelor of Computer Applications degree.
To the best of my knowledge, the work presented herein is original and has not been submitted
earlier for the award of any degree or diploma.
Mr. Rajat Dixit [Teacher's Designation] [Department Name] R.B.S College Technical Campus, Agra
Date: May 23, 2025
4. Table of Contents
(Generate this automatically in your word processor after all content is placed and page numbers
are stable.)
1. Title Page
2. Acknowledgement
3. Certificate
4. Table of Contents
5. List of Figures (If you add many diagrams/screenshots)
6. Abstract
7. Chapter 1: Introduction 1.1. Project Overview 1.2. Purpose of the Project 1.3. Objectives 1.4.
Scope of the Project 1.5. Target Audience
8. Chapter 2: System Analysis 2.1. Existing System and its Limitations 2.2. Proposed System
and its Benefits 2.3. Functional Requirements 2.4. Non-Functional Requirements 2.5.
Feasibility Study 2.5.1. Technical Feasibility 2.5.2. Operational Feasibility 2.5.3. Economic
Feasibility
9. Chapter 3: System Design 3.1. User Interface Design 3.2. System Architecture 3.3. Module
Breakdown 3.4. Data Design (In-Memory Structures) 3.5. Workflow Diagrams (e.g., Use Case
Diagram, Activity Diagram)
10. Chapter 4: Implementation 4.1. Technologies Used 4.2. Development Environment 4.3. Key
Code Snippets and Explanations 4.3.1. Main Structure (HTML & CSS) 4.3.2. Login Mechanism
4.3.3. Book Management Module 4.3.4. Member Management Module 4.3.5. Issue/Return
Book Module 4.3.6. Data Storage and Manipulation
11. Chapter 5: Features and Functionality 5.1. Core Features 5.2. Unique and Advanced Features
12. Chapter 6: Testing 6.1. Testing Methodology 6.2. Test Cases and Scenarios 6.3. Screenshots
of Test Results (Optional)
13. Chapter 7: Future Scope and Enhancements
14. Chapter 8: Conclusion
15. Bibliography/References
16. Appendix (Optional - e.g., full source code, detailed ER diagrams)
5. List of Figures
(This section will be populated with Figure numbers and titles once you've inserted all your
screenshots and labelled them. For example:)
Figure 4.1: Login Page Interface Figure 4.2: Code Snippet for Login Validation Figure 4.3: Main
Dashboard View Figure 4.4: Add Book Form and Book List Figure 4.5: Code Snippet for Adding
and Rendering Books Figure 4.6: Member Management Interface Figure 4.7: Code Snippet for
Adding and Rendering Members Figure 4.8: Issue/Return Book Section Figure 4.9: Code Snippet
for Book Issuance Logic Figure 4.10: Code Snippet for Book Return Logic Figure 4.11: Issued
Books List Display
6. Abstract
This project report details the development of a web-based Library Management System, a
digital solution designed to simplify and automate the core operations of a library. The system
provides functionalities for user authentication, comprehensive book management (adding,
displaying, and deleting records), member management (registration, display, and removal), and
efficient handling of book issuance and returns. Developed using HTML5, CSS3 (with Tailwind
CSS for modern styling), and JavaScript, the application operates with in-memory data storage,
offering a robust and intuitive user interface. This report covers the system's analysis, design,
implementation, and future enhancements, aiming to present a clear understanding of its
architecture and practical utility in a library setting.
Chapter 1: Introduction
The primary purpose of this project is to create a functional and user-friendly digital system
capable of handling the fundamental tasks involved in library management. This includes
registering new books and members, managing their respective records, and facilitating the
process of books being issued to and returned by members. The system aims to replace
cumbersome manual processes with a streamlined, digital workflow, thereby improving accuracy,
accessibility, and operational efficiency within a library environment. It serves as a practical
demonstration of front-end web development principles applied to a real-world problem.
1.3. Objectives
The specific objectives defined for the development of this Library Management System are:
To design and implement a secure login module that authenticates library personnel, ensuring
authorized access to the system.
To enable efficient creation (addition), retrieval (display), and deletion of book records,
including essential details such as title, author, and ISBN.
To facilitate the seamless management of library member records, allowing for the addition,
display, and removal of member profiles with unique IDs and names.
To develop a mechanism for accurately tracking book issuance to members, recording both
the book and member identifiers along with the issue date.
To implement a reliable process for managing the return of books, updating their status and
removing them from the list of currently issued items.
To ensure the application has a clear, intuitive, and responsive user interface using modern
web design principles (Tailwind CSS) to enhance usability.
To manage all operational data (books, members, issued transactions) using in-memory
JavaScript data structures, providing immediate feedback and simplifying development for a
client-side application.
The current scope of this Library Management System project is focused on the core
functionalities necessary for basic library operations. It encompasses:
The primary target audience for this Library Management System is the library staff responsible
for daily operations such as managing book inventory, registering new members, and handling
the circulation of books. The system's intuitive design aims to simplify their tasks and improve
efficiency. It can also serve as an educational tool for students learning about front-end web
development and basic system design principles.
Physical Registers: Large ledgers or notebooks used to record book acquisitions, member
registrations, and issue/return transactions.
Card Catalogs: Index cards for organizing books by title, author, and subject.
Manual Tracking: Librarians physically inspect shelves to determine book availability or
manually check registers for overdue items.
While these methods have been functional for centuries, they come with significant limitations in
the modern era:
Time Consumption: Searching for a specific book or member record can be extremely slow
and tedious, especially with a large collection.
Error Proneness: Manual data entry and calculations (e.g., for issue dates, overdue periods)
are highly susceptible to human error.
Lack of Real-time Information: It's difficult to quickly ascertain the real-time availability of a
book or the current borrowing status of a member.
Data Redundancy and Inconsistency: Information might be duplicated across different
registers, leading to inconsistencies if not updated uniformly.
Security Risks: Physical records are vulnerable to damage, loss, or unauthorized access.
Inefficient Reporting: Generating reports (e.g., list of overdue books, most popular books) is a
time-consuming and manual aggregation process.
Storage Issues: Physical records require significant storage space and can become
cumbersome to manage as the library grows.
These limitations collectively impact the efficiency of library operations and can lead to a less
satisfactory experience for both library staff and users.
Increased Efficiency: Automation of tasks like book addition, member registration, and issue/
return processes significantly reduces the time and effort required.
Improved Accuracy: Digital data entry minimizes manual errors, ensuring consistency and
reliability of records.
Real-time Data Access: Information on book availability, member status, and issued items is
updated instantly and accessible at a glance.
Simplified Search: Quick search capabilities (though currently basic, the foundation is set)
allow for rapid retrieval of book or member information.
Enhanced Organization: Data is structured and stored in a consistent format, making
management more logical and less prone to disarray.
Reduced Manual Workload: Frees up library staff to focus on more value-added activities,
such as assisting patrons or organizing events.
Scalability (Conceptual): While currently in-memory, the modular design allows for future
integration with a robust database, enabling the system to handle larger volumes of data and
users.
User-Friendly Interface: The intuitive design ensures that even staff with limited technical
expertise can quickly learn and use the system effectively.
Functional requirements describe what the system must do. For the Library Management
System, these include:
Book Management:
The system shall allow library staff to add new book records with details such as Title,
Author, and ISBN.
The system shall display a comprehensive list of all added books.
The system shall allow library staff to delete existing book records.
Member Management:
The system shall allow library staff to add new member records with details such as
Member ID and Name.
The system shall display a comprehensive list of all registered members.
The system shall allow library staff to delete existing member records.
Issue Book:
The system shall allow library staff to issue a book to a member by providing the Book ID
and Member ID.
The system shall verify if both the Book ID and Member ID exist before issuing.
The system shall prevent a book from being issued if it is already issued to another
member.
The system shall record the issue date for each transaction.
The system shall display a list of currently issued books.
Return Book:
The system shall allow library staff to process the return of a book by providing the Book
ID.
The system shall remove the returned book from the list of issued books.
The system shall handle cases where a book ID is entered for a book that is not currently
issued.
Usability:
Performance:
The system shall respond to user inputs within a reasonable time frame (e.g., less than 2
seconds for typical operations).
List rendering and data updates shall be near-instantaneous for the expected volume of
in-memory data.
Maintainability:
The code shall be modular and well-structured, making it easy to understand and modify.
The use of standard web technologies (HTML, CSS, JavaScript) ensures ease of
maintenance.
Security (Basic):
The system shall implement a basic login mechanism to restrict unauthorized access to
library operations.
Client-side validation will be used to prevent empty submissions.
Compatibility:
The web application shall be accessible and functional across modern web browsers
(e.g., Chrome, Firefox, Edge).
The responsive design (via Tailwind CSS) shall ensure decent usability on various screen
sizes.
Reliability:
The system shall handle basic error conditions (e.g., invalid input, book already issued)
gracefully with alert messages.
A feasibility study assesses the practicality and viability of developing the proposed system.
This assesses whether the project can be implemented with existing technology and resources.
Assessment: The project is highly technically feasible. It relies on standard and widely
supported web technologies: HTML for structure, CSS (specifically Tailwind CSS) for styling,
and JavaScript for client-side logic and interaction. All necessary tools (web browser, text
editor/IDE) are readily available and free. The in-memory data storage simplifies the technical
stack by removing the need for a backend server or complex database setup for this proof-of-
concept.
This evaluates whether the proposed system will be effectively used once developed.
Assessment: For a student project, the economic feasibility is excellent. There are virtually no
direct monetary costs associated with its development, as all technologies used are open-
source or freely available. The primary investment is time and effort in learning and applying
web development skills, which offers significant educational value and skill development
benefits that far outweigh any implicit costs. In a real-world scenario, this system would lead
to long-term cost savings by reducing labor, errors, and physical resource consumption
associated with manual systems.
System design outlines the architecture, components, modules, interfaces, and data for a system
to satisfy specified requirements.
The user interface (UI) is designed to be clean, intuitive, and modern, leveraging the utility-first
CSS framework, Tailwind CSS. This approach ensures a consistent look and feel while promoting
responsiveness.
Overall Layout: A single-page application structure is used, where different sections (login,
dashboard) are shown or hidden based on user interaction.
Login Screen: A central, uncluttered login form prompts for a username and password. Clear
error messages are displayed for invalid credentials.
Dashboard:
After login, the main dashboard provides a hierarchical view of functionalities:
Header: Displays the system title and a prominent "Logout" button.
Sections: Divided into logical sections for "Book Management," "Member Management,"
and "Issue/Return Book." Each section has its own set of input fields and action buttons.
Lists: Dynamic lists (<ul> elements) are used to display current books, members, and
issued books, providing immediate visual feedback of additions and deletions. Each list
item includes a "Delete" or "Return" button for direct interaction.
Styling: Tailwind CSS classes are extensively used for layout (flexbox, grid), spacing (padding,
margin), typography (font sizes, weights), colors (backgrounds, text), and responsiveness.
This ensures a professional and aesthetically pleasing design.
3.2. System Architecture
The Library Management System follows a Client-Side Single Page Application (SPA)
architecture.
Client-Side (Browser): This is where the entire application code (HTML, CSS, JavaScript)
resides and executes.
HTML (Structure):
Defines the content and layout of the web page
.
CSS (Styling):
Uses Tailwind CSS to apply visual styles and responsive design
.
JavaScript (Logic):
Handles user interactions, manages data in memory, updates the DOM, and implements
all core business logic (e.g., login, adding books, issuing books)
.
In-Memory Data Storage: All application data (books, members, issued transactions) is
stored within JavaScript arrays (books, members, issuedBooks). This means data is volatile
and will be lost when the browser tab is closed or refreshed.
Architectural Diagram:
+---------------------+
| |
| User (Browser) |
| |
+----------+----------+
|
| HTTP/S (Request/Response)
|
+----------V----------+
| |
| Web Server |
| (Serves index.html, CSS, JS files)
| |
+----------+----------+
|
| (Initial File Delivery)
|
+----------V----------+
| |
| Client-Side Code |
| (HTML, CSS, JavaScript)
| |
| +----------------+ |
| | ||
| | In-Memory Data | |
| | (JS Arrays) | |
| | ||
| +----------------+ |
| |
+---------------------+
Explanation: The user interacts with the application through a web browser. A simple web
server (or direct file opening) serves the index.html file, which contains all the necessary
HTML, CSS (Tailwind CSS linked), and JavaScript. Once loaded, the JavaScript code takes
over, managing the UI, handling user events, and storing/manipulating data exclusively within
the browser's memory. There is no external database or backend API calls for data operations
in this version.
The system is logically divided into several modules, each responsible for a specific set of
functionalities:
1. Authentication Module:
Purpose: Handles the circulation of books between the library and its members.
Components: Input fields for book ID and member ID; "Issue Book" button; "Return Book"
button; dynamic list of issued books; "Return" button for each issued item.
Key Functionality:
Verifies book and member existence, checks if a book is already issued, records issue date
, adds/removes transactions from the
issuedBooks
array
, and renders the issued books list
.
The system utilizes simple JavaScript arrays and objects to store data in the browser's memory.
This design choice is suitable for a client-side prototype where persistent storage is not a
primary requirement.
books Array:
id: String (e.g., "1", "2") - A unique identifier for the book.
title: String (e.g., "Bhagavad Gita") - The title of the book.
author: String (e.g., "Unknown") - The author of the book.
isbn: String (e.g., "978-0143064793") - The International Standard Book Number.
let books = [
{ id: "1", title: "Bhagavad Gita", author: "Unknown", isbn: "978-0143064793" },
{ id: "2", title: "Ramayana", author: "Valmiki", isbn: "978-0143039681" },
// ... more books [cite: 18, 19]
];
members Array:
id: String (e.g., "101", "102") - A unique identifier for the member.
name: String (e.g., "Alice Smith") - The full name of the member.
JavaScript
let members = [
{ id: "101", name: "Alice Smith" },
{ id: "102", name: "Bob Johnson" },
];
issuedBooks Array:
JavaScript
(For a 50-60 page document, it's highly recommended to include at least one or two simple
diagrams. You can create these using drawing tools like Lucidchart, draw.io, or even PowerPoint/
Google Slides.)
A Use Case Diagram illustrates the interactions between users (actors) and the system.
Actors:
Use Cases:
Login to System
Logout from System
Add Book
Delete Book
Display Books
Add Member
Delete Member
Display Members
Issue Book
Return Book
(Diagram placeholder: Create a simple Use Case Diagram showing 'Librarian' actor and
connecting lines to all the listed use cases.)
An Activity Diagram shows the flow of control from one activity to another.
(Diagram placeholder: Create a simple Activity Diagram for the "Issue Book" process):
Start Node
Activity: Enter Book ID and Member ID
Decision Node:
Are Book ID and Member ID valid?
No Path: Display "Invalid ID" alert.
Yes Path:
Decision Node:
Is Book Already Issued?
Yes Path: Display "Book Already Issued" alert.
No Path:
Activity: Record Issue Transaction (Add to issuedBooks array).
Activity: Update Issued Books List.
Activity: Clear Input Fields.
End Node
Chapter 4: Implementation
This chapter details the technologies used and presents key parts of the source code with
explanations, showcasing how the system functionalities are built.
The Library Management System is built entirely using standard front-end web technologies,
making it highly accessible and requiring no complex server-side setup for its operation.
Role:
Provides the fundamental structure and content of the web pages
. It defines elements like headings, forms, buttons, lists, and input fields that constitute the
user interface. Semantic HTML5 tags are used to ensure proper structure and
accessibility.
Role:
Responsible for the visual presentation and styling of the HTML elements
. It controls colors, fonts, layout, spacing, and responsiveness.
Tailwind CSS:
A utility-first CSS framework linked via CDN
. It allowed for rapid UI development by providing a vast collection of pre-defined utility
classes that can be directly applied to HTML elements to style them (e.g.,
bg-gray-100
,
text-3xl
,
font-semibold
,
p-6
,
rounded-lg
,
shadow-md
)
. This approach significantly sped up the styling process and ensures consistency in the
design.
Role:
The core programming language that provides interactivity and dynamic behavior to the
web application. It handles all the business logic, data manipulation, and DOM (Document
Object Model) updates
.
Key Uses:
In-memory data storage and manipulation (adding, deleting, filtering data in arrays)
.
Dynamic content generation and updates (e.g., rendering lists of books, members, and
issued items)
.
Basic form validation and error handling (e.g., alerts for missing fields, invalid IDs)
.
4.2. Development Environment
Code Editor: Visual Studio Code (VS Code) was used for writing and managing the HTML,
CSS, and JavaScript files.
Browser: Google Chrome (or any modern web browser) was used for testing and running the
application. The application can be run directly by opening the index.html file in the browser.
Internet Connection: Required initially to fetch Tailwind CSS and Google Fonts via CDN.
This section provides visual representations of the system's interface and the underlying code
that powers its core functionalities.
Description: This shows the basic HTML structure with meta-information, title, and the
integration of Google Fonts and Tailwind CSS. The body tag's classes demonstrate initial
global styling.
Screenshot (Code - head and body start):
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Library Management System</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?
family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<script src="https://cdn.tailwindcss.com"></script>
<style>
body {
font-family: 'Inter', sans-serif;
}
</style>
</head>
<body class="bg-gray-100 p-6">
<h1 class="text-3xl font-semibold text-center text-blue-700 mb-8">Library Management
System</h1>
</body>
</html>
Explanation:
The
<head>
section defines the document's character set, viewport settings for responsiveness, and the
page title. It links to Google Fonts for custom typography and includes the Tailwind CSS CDN
script, making all Tailwind utility classes available for styling
. The
<body>
tag applies a light gray background (
bg-gray-100
) and universal padding (
p-6
) to the entire page, ensuring a consistent aesthetic. The main title
<h1>
is centrally aligned and styled with a bold blue color.
Description: The login section is the entry point of the application. It features input fields for
username and password, a login button, and an error message area that remains hidden until
incorrect credentials are provided.
Screenshot (GUI - Login Page):
[YOUR SCREENSHOT HERE: Take a screenshot of the initial login page before logging in.]
Figure 4.1: Login Page Interface
HTML
Figure 4.2: HTML Structure for Login Form and Error Message
JavaScript
// Login Form Submission
loginForm.addEventListener("submit", (event) => {
event.preventDefault();
const username = event.target.username.value;
const password = event.target.password.value;
Explanation:
The HTML code defines the form elements for username and password entry, and a submit
button
. The JavaScript event listener for the login form's submission captures the entered
credentials
. It then compares them to a hardcoded "admin" username and "password"
. If they match, the login section is hidden, the main content becomes visible, and the lists are
rendered
. Otherwise, a predefined error message (
login-error
) is displayed
.
Description: This module provides the interface for librarians to add new books, view the
existing collection, and remove books from the library's inventory.
Screenshot (GUI - Dashboard with Book Management):
[YOUR SCREENSHOT HERE: Take a screenshot of the main dashboard, specifically
highlighting or focusing on the "Book Management" section with some books already
added and the input fields visible.]
Figure 4.4: Main Dashboard and Book Management Section
HTML
<section class="mb-8">
<h3 class="text-xl font-semibold text-gray-700 mb-4">Book Management</h3>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4">
<div class="bg-gray-50 rounded-md p-4">
<label for="add-book-title" class="block text-gray-700 text-sm font-bold mb-2">Title:</
label>
<input type="text" id="add-book-title" class="shadow appearance-none border rounded w-
full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
<div class="bg-gray-50 rounded-md p-4">
<label for="add-book-author" class="block text-gray-700 text-sm font-bold mb-2">Author:</
label>
<input type="text" id="add-book-author" class="shadow appearance-none border rounded
w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
<div class="bg-gray-50 rounded-md p-4">
<label for="add-book-isbn" class="block text-gray-700 text-sm font-bold mb-2">ISBN:</
label>
<input type="text" id="add-book-isbn" class="shadow appearance-none border rounded w-
full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
</div>
<button id="add-book-button" class="bg-green-500 hover:bg-green-700 text-white font-bold
py-2 px-4 rounded focus:outline-none focus:shadow-outline">Add Book</button>
</section>
JavaScript
listItem.appendChild(deleteButton);
bookList.appendChild(listItem);
});
}
Figure 4.6: JavaScript Logic for Adding and Managing Books
Explanation:
The HTML provides input fields for a book's title, author, and ISBN
. The "Add Book" button's click event triggers a JavaScript function
. This function collects the input values, performs a basic validation to ensure all fields are
filled
, creates a new book object, assigns it a simple ID
, and pushes it into the
books
array
. The
renderBookList()
function then dynamically updates the displayed list of books
. This function iterates through the
books
array, creates an
<li>
element for each book, and adds a "Delete" button that, when clicked, removes the
corresponding book from the
books
array and re-renders the list
.
Description: This module allows librarians to register new library members, view a list of all
registered members, and remove members from the system.
Screenshot (GUI - Dashboard with Member Management):
<section class="mb-8">
<h3 class="text-xl font-semibold text-gray-700 mb-4">Member Management</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
<div class="bg-gray-50 rounded-md p-4">
<label for="add-member-name" class="block text-gray-700 text-sm font-bold
mb-2">Name:</label>
<input type="text" id="add-member-name" class="shadow appearance-none border
rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-
outline">
</div>
<div class="bg-gray-50 rounded-md p-4">
<label for="add-member-id" class="block text-gray-700 text-sm font-bold mb-2">Member
ID:</label>
<input type="text" id="add-member-id" class="shadow appearance-none border rounded w-
full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
</div>
<button id="add-member-button" class="bg-green-500 hover:bg-green-700 text-white font-
bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">Add Member</button>
</section>
JavaScript
listItem.appendChild(deleteButton);
memberList.appendChild(listItem);
});
}
Explanation:
Similar to book management, the HTML provides input fields for member name and ID
. The "Add Member" button's JavaScript listener captures these inputs, validates them,
creates a new member object, and adds it to the
members
array
. The
renderMemberList()
function dynamically updates the list of members displayed on the page, including a "Delete"
button for each, enabling removal of member records
.
4.3.5. Issue/Return Book Module
Description: This critical module handles the core library circulation functions: issuing books
to members and recording their returns. It includes validation to prevent re-issuing an already
issued book.
Screenshot (GUI - Dashboard with Issue/Return Section):
HTML
<section>
<h3 class="text-xl font-semibold text-gray-700 mb-4">Issue/Return Book</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
<div class="bg-gray-50 rounded-md p-4">
<label for="issue-book-id" class="block text-gray-700 text-sm font-bold mb-2">Book ID:</
label>
<input type="text" id="issue-book-id" class="shadow appearance-none border rounded w-
full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
<div class="bg-gray-50 rounded-md p-4">
<label for="issue-member-id" class="block text-gray-700 text-sm font-bold mb-2">Member
ID:</label>
<input type="text" id="issue-member-id" class="shadow appearance-none border rounded
w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
</div>
<button id="issue-book-button" class="bg-purple-500 hover:bg-purple-700 text-white font-
bold py-2 px-4 rounded focus:outline-none focus:shadow-outline mr-2">Issue Book</
button>
<button id="return-book-button" class="bg-yellow-500 hover:bg-yellow-700 text-white font-
bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">Return Book</button>
</section>
Figure 4.11: HTML Structure for Issue/Return Operations
JavaScript
const bookExists = books.some(b => b.id === bookId); // Check if book ID exists [cite: 52]
const memberExists = members.some(m => m.id === memberId); // Check if member ID
exists [cite: 52]
JavaScript
function renderIssuedBooksList() {
issuedBooksList.innerHTML = ""; // Clear the list [cite: 35]
issuedBooks.forEach(item => {
const book = books.find(b => b.id === item.bookId); // Find book details
const member = members.find(m => m.id === item.memberId); // Find member details
listItem.appendChild(returnButton);
issuedBooksList.appendChild(listItem); [cite: 40]
}
});
}
Figure 4.13: JavaScript Logic for Returning a Book and Rendering Issued List
Explanation:
The HTML section provides input fields for Book ID and Member ID, and distinct buttons for
"Issue Book" and "Return Book"
. The
issueBookButton
's event listener first validates if the entered Book ID and Member ID exist in their respective
arrays
. Crucially, it then checks if the specific book is
already
present in the
issuedBooks
array
, preventing double-issuance. If valid and not already issued, a new issue record (with the
current date) is added to
issuedBooks
. The
returnBookButton
's logic finds the specified book in the
issuedBooks
array and removes it
. Both issue and return operations trigger
renderIssuedBooksList()
, which dynamically updates the "Issued Books" display. This function iterates through
issuedBooks
, fetches corresponding book and member details, and creates list items with a "Return"
button for each
.
Description: This snippet showcases the initial in-memory data arrays for books, members,
and issued books. This data is loaded directly into the browser's memory when the page
loads.
Screenshot (Code - Data Arrays):
Explanation:
These JavaScript arrays (
books
,
members
,
issuedBooks
) serve as the temporary database for the application
.
books
and
members
are initialized with some sample data to populate the lists on startup.
issuedBooks
starts empty, as no books are issued initially. All subsequent add, delete, issue, and return
operations directly modify these arrays. The in-memory nature means that any changes made
will be lost when the page is closed or refreshed, which is a common characteristic of client-
side-only applications.
Chapter 5: Features and Functionality
This chapter provides a detailed overview of the capabilities of the Library Management System,
highlighting both its core functionalities and any unique aspects.
The system implements the fundamental operations expected from a basic library management
solution:
User Authentication: A simple, yet effective, login system that gates access to the library's
management interface. This ensures that only authorized personnel can perform operations
like adding, deleting, or issuing books.
Book Inventory Management:
Add Books: Librarians can easily add new books to the system by providing essential
details such as the book's title, author, and ISBN. This process is straightforward and
provides immediate visual feedback.
View Books: The system displays a clear, dynamically updated list of all books currently in
the collection, making it easy to see the available inventory.
Delete Books: Functionality to remove book records from the system is provided, useful
for weeding out damaged, lost, or outdated books.
Add Members: New library members can be registered by inputting their name and a
unique member ID.
View Members: A comprehensive list of all registered library members is displayed,
allowing for quick reference.
Delete Members: The system supports the removal of member records, for instance, if a
member leaves or duplicates need to be corrected.
Issue Books: Librarians can issue books to registered members by simply entering the
book's ID and the member's ID. The system validates these IDs and ensures the book is
not already issued before recording the transaction.
Return Books: The system facilitates the return of books, removing them from the "Issued
Books" list and conceptually making them available again.
Issued Books Tracking: A dedicated section displays all currently issued books, along with
the member they are issued to and the issue date, providing an immediate overview of
active loans.
5.2. Unique and Advanced Features
While designed for simplicity, the project incorporates several features that enhance its usability
and efficiency, particularly within the context of a client-side application:
Chapter 6: Testing
Testing is a crucial phase in software development to ensure that the system functions correctly
according to its requirements and is free of defects. For this project, a manual testing approach
was adopted, covering various functionalities and user interactions.
The testing methodology employed was primarily Manual Testing and Black-Box Testing.
Manual Testing: All functionalities were tested by a human tester (the developer) interacting
directly with the user interface. Each feature was exercised by inputting data, clicking buttons,
and observing the system's response.
Black-Box Testing: This approach focuses on testing the system's functionalities without
knowledge of the internal code structure. The tester interacted with the UI as an end-user
would, providing inputs and verifying outputs against the expected behavior as defined in the
functional requirements.
(For each passed test case or a representative one, you could include a screenshot. This would
greatly expand your page count. For example:)
[YOUR SCREENSHOT HERE: Take a screenshot of the login page with the "Invalid
username or password" error message displayed after an incorrect login attempt.]
Figure 6.1: Login Failure - Error Message Display
Explanation: This screenshot demonstrates the system's error handling for incorrect login
credentials, providing immediate feedback to the user.
[YOUR SCREENSHOT HERE: Take a screenshot of the Book Management section after
successfully adding a new book, showing the new book appearing in the list.]
Figure 6.2: Successful Book Addition
Explanation: This image verifies that the "Add Book" functionality works as expected, with
the new record being dynamically added to the displayed book inventory.
[YOUR SCREENSHOT HERE: Take a screenshot of the Issue/Return Book section after
successfully issuing a book, showing the book added to the "Issued Books" list.]
Figure 6.3: Successful Book Issuance Record
Explanation: This visual confirms that the system correctly records and displays books
that have been issued, including details about the member and the issue date.
The current Library Management System provides a foundational set of functionalities for basic
library operations. However, there is significant scope for expansion and improvement to
transform it into a more robust, scalable, and feature-rich application. Future enhancements
could include:
Backend Integration: Moving from in-memory data storage to a persistent database (e.g.,
MySQL, PostgreSQL, SQLite, or a NoSQL database like MongoDB). This would require a
backend server (e.g., Node.js with Express, Python with Flask/Django, Java with Spring
Boot) to manage API endpoints for data operations, ensuring that data is retained even
after the application is closed or refreshed.
Local Storage/IndexedDB: For purely client-side persistence without a server, using
browser's Local Storage or IndexedDB could be an intermediate step, though less scalable
for large datasets.
Implement distinct user roles (e.g., Administrator, Librarian, Patron) with different access
levels and permissions. For example, patrons might only be able to view books and their
own borrowing history, while librarians have full CRUD access.
User registration and password management (hashing, salting) would be crucial for a real-
world system.
Implement advanced search capabilities for books (by genre, publication year, keywords in
descriptions) and members (by contact details, membership status).
Add filtering options to view specific subsets of data (e.g., all fiction books, members with
overdue books).
Visualize data through charts and graphs for better insights into library usage.
Integrate SMS or email notification services to send reminders for overdue books, new
book arrivals, or membership renewals.
In-app notifications for library staff about critical events.
Add more attributes to book records, such as publication year, publisher, genre, book
description, cover image URL, and number of copies available.
Implement a copy management system for books with multiple copies.
Transition to a modern JavaScript framework like React, Vue.js, or Angular for more
complex component management and state handling, especially as the application grows.
Implement responsive tables for better display of large datasets.
Add sorting capabilities to lists (e.g., sort books by title, author, or ISBN).
Barcode Integration:
Allow direct input from barcode scanners for quicker book issue and return processes,
reducing manual entry errors.
Multi-branch Support:
Extend the system to manage multiple library branches, with centralized or distributed
data.
API Integration:
Integrate with external APIs (e.g., Google Books API) to automatically fetch book details
(like cover images, summaries) using ISBN.
Accessibility Enhancements:
Ensure the application adheres to WCAG (Web Content Accessibility Guidelines) for users
with disabilities.
These future enhancements would significantly increase the complexity, robustness, and real-
world applicability of the Library Management System, making it a more comprehensive and
powerful tool for modern libraries.
Chapter 8: Conclusion
The Library Management System project, developed using HTML, CSS (Tailwind CSS), and
JavaScript, successfully demonstrates the fundamental principles of client-side web application
development applied to a practical, real-world scenario. This project effectively addresses the
basic needs of library operations by providing intuitive interfaces for user authentication,
comprehensive management of book inventory, member registration, and efficient handling of
book issuance and returns.
By adopting an in-memory data storage approach, the project elegantly showcases the core
functionalities without the overhead of a complex backend, making it highly portable and easy to
run. The use of Tailwind CSS has resulted in a clean, responsive, and visually appealing user
interface, enhancing the overall user experience.
Through its design and implementation, the project has met all its defined objectives, offering a
clear, functional, and maintainable solution for basic library management. It serves as a strong
foundation, with significant potential for future expansion into a more sophisticated and fully-
featured system with persistent data storage, advanced search capabilities, and richer reporting
functionalities. This project has not only solidified our understanding of front-end web
technologies but also provided valuable insights into system analysis, design, and practical
problem-solving.
9. Bibliography/References
MDN Web Docs (Mozilla Developer Network). (Ongoing). HTML, CSS, JavaScript
Documentation. Available at: https://developer.mozilla.org/
Tailwind CSS. (Ongoing). Official Documentation. Available at: https://tailwindcss.com/
Google Fonts. (Ongoing). Official Website. Available at: https://fonts.google.com/
W3Schools. (Ongoing). HTML, CSS, JavaScript Tutorials. Available at: https://
www.w3schools.com/
Appendix (Optional)
(Paste your entire library mngmnt sytem.txt content here. Make sure it's formatted clearly, perhaps
in a code block or with line numbers if your word processor supports it.)
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Library Management System</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?
family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<script src="https://cdn.tailwindcss.com"></script>
<style>
body {
font-family: 'Inter', sans-serif;
}
</style>
</head>
<body class="bg-gray-100 p-6">
<h1 class="text-3xl font-semibold text-center text-blue-700 mb-8">Library Management System</
h1>
<section class="mb-8">
<h3 class="text-xl font-semibold text-gray-700 mb-4">Book Management</h3>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4">
<div class="bg-gray-50 rounded-md p-4">
<label for="add-book-title" class="block text-gray-700 text-sm font-bold mb-2">Title:</label>
<input type="text" id="add-book-title" class="shadow appearance-none border rounded w-full py-2
px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
<div class="bg-gray-50 rounded-md p-4">
<label for="add-book-author" class="block text-gray-700 text-sm font-bold mb-2">Author:</label>
<input type="text" id="add-book-author" class="shadow appearance-none border rounded w-full
py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
<div class="bg-gray-50 rounded-md p-4">
<label for="add-book-isbn" class="block text-gray-700 text-sm font-bold mb-2">ISBN:</label>
<input type="text" id="add-book-isbn" class="shadow appearance-none border rounded w-full py-2
px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
</div>
<button id="add-book-button" class="bg-green-500 hover:bg-green-700 text-white font-bold py-2
px-4 rounded focus:outline-none focus:shadow-outline">Add Book</button>
<section class="mb-8">
<h3 class="text-xl font-semibold text-gray-700 mb-4">Member Management</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
<div class="bg-gray-50 rounded-md p-4">
<label for="add-member-name" class="block text-gray-700 text-sm font-bold mb-2">Name:</
label>
<input type="text" id="add-member-name" class="shadow appearance-none border rounded w-
full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
<div class="bg-gray-50 rounded-md p-4">
<label for="add-member-id" class="block text-gray-700 text-sm font-bold mb-2">Member ID:</
label>
<input type="text" id="add-member-id" class="shadow appearance-none border rounded w-full
py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
</div>
<button id="add-member-button" class="bg-green-500 hover:bg-green-700 text-white font-bold
py-2 px-4 rounded focus:outline-none focus:shadow-outline">Add Member</button>
<div id="member-list-container" class="mt-6">
<h4 class="text-lg font-semibold text-gray-700 mb-2">Members:</h4>
<ul id="member-list" class="border rounded-md p-4">
</ul>
</div>
</section>
<section>
<h3 class="text-xl font-semibold text-gray-700 mb-4">Issue/Return Book</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
<div class="bg-gray-50 rounded-md p-4">
<label for="issue-book-id" class="block text-gray-700 text-sm font-bold mb-2">Book ID:</label>
<input type="text" id="issue-book-id" class="shadow appearance-none border rounded w-full py-2
px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
<div class="bg-gray-50 rounded-md p-4">
<label for="issue-member-id" class="block text-gray-700 text-sm font-bold mb-2">Member ID:</
label>
<input type="text" id="issue-member-id" class="shadow appearance-none border rounded w-full
py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
</div>
<button id="issue-book-button" class="bg-purple-500 hover:bg-purple-700 text-white font-bold
py-2 px-4 rounded focus:outline-none focus:shadow-outline mr-2">Issue Book</button>
<button id="return-book-button" class="bg-yellow-500 hover:bg-yellow-700 text-white font-bold
py-2 px-4 rounded focus:outline-none focus:shadow-outline">Return Book</button>
<script>
// --- Data Storage (In-Memory) ---
let books = [
{ id: "1", title: "Bhagavad Gita", author: "Unknown", isbn: "978-0143064793" },
{ id: "2", title: "Ramayana", author: "Valmiki", isbn: "978-0143039681" },
{ id: "3", title: "Mahabharata", author: "Vyasa", isbn: "978-0143100045" },
{ id: "4", title: "Upanishads", author: "Various", isbn: "978-0140444493" },
{ id: "5", title: "Aesop's Fables", author: "Aesop", isbn: "978-0140350091" },
{ id: "6", title: "Panchatantra", author: "Vishnu Sharma", isbn: "978-0143330962" },
{ id: "7", title: "The Power of Positive Thinking", author: "Norman Vincent Peale", isbn:
"978-0061236237" },
{ id: "8", title: "Seven Habits of Highly Effective People", author: "Stephen Covey", isbn:
"978-0743272453" },
];
let members = [
{ id: "101", name: "Alice Smith" },
{ id: "102", name: "Bob Johnson" },
];
let issuedBooks = [];
listItem.appendChild(deleteButton);
bookList.appendChild(listItem);
});
}
listItem.appendChild(deleteButton);
memberList.appendChild(listItem);
});
}
function renderIssuedBooksList() {
issuedBooksList.innerHTML = "";
issuedBooks.forEach(item => {
const book = books.find(b => b.id === item.bookId);
const member = members.find(m => m.id === item.memberId);
// Logout Button
logoutButton.addEventListener("click", () => {
loginSection.classList.remove("hidden");
mainContent.classList.add("hidden");
loginForm.reset();
loginError.classList.add("hidden");
});
} else {
alert("Invalid Book ID or Member ID.");
}
});
</script>
</body>
</html>