π Library Management System
A full-stack Library Management System built using Node.js , Express.js , SQLite3 , EJS , and Express Session . The system allows librarians to manage books, students, borrowing records, and library visit tracking through an intuitive web interface.
Deployed Application:
https://library-management-system-o9zd.onrender.com
Secure login system
Session-based authentication
Protected routes
Logout functionality
Add new books
Edit existing books
Delete books
View all books
Track available quantity
Add new students
View student records
Delete students
Manage student information using USN
Issue books to students
Automatic return date generation
Prevent duplicate book issues
Mark books as returned
Automatic quantity updates
Student entry registration
Student exit registration
Automatic duration calculation
Real-time visitor tracking
Complete visit history
Displays:
Total Books
Total Borrowed Books
Total Library Visits
Students Currently Inside Library
Technology
Usage
Node.js
Backend Runtime
Express.js
Server Framework
SQLite3
Database
EJS
Template Engine
Express Session
Authentication
HTML/CSS
Frontend UI
Column
Type
id
INTEGER (PK)
name
TEXT
email
TEXT
password
TEXT
Column
Type
usn
TEXT (PK)
name
TEXT
branch
TEXT
Column
Type
id
INTEGER (PK)
title
TEXT
author
TEXT
quantity
INTEGER
Column
Type
id
INTEGER (PK)
usn
TEXT
bookid
INTEGER
borrow_date
DATE
return_date
DATE
status
TEXT
Column
Type
id
INTEGER (PK)
usn
TEXT
entry_time
TEXT
exit_time
TEXT
duration
TEXT
status
TEXT
library-management-system
β
βββ public
β βββ style.css
β βββ hero.png
β
βββ views
β βββ login.ejs
β βββ dashboard.ejs
β βββ books.ejs
β βββ addbook.ejs
β βββ editbook.ejs
β βββ borrowedbooks.ejs
β βββ studentrecord.ejs
β βββ addstudent.ejs
β βββ issueform.ejs
β βββ studentlogin.ejs
β βββ libraryvisits.ejs
β
βββ app.js
βββ db.js
βββ library.db
βββ package.json
βββ .env
βββ README.md
git clone https://github.com/atharvaajoshii/Library-management-system.git
cd Library-management-system
Create a .env file in the root directory:
SESSION_SECRET = your_secret_key
PORT = 5002
or
Default Librarian Credentials
Email: [email protected]
Password: pass123
Change these credentials before deploying to production.
Method
Route
GET
/
POST
/login
GET
/logout
Method
Route
GET
/dashboard
Method
Route
GET
/books
GET
/books/add
POST
/books/add
GET
/books/edit/:id
POST
/books/edit/:id
GET
/books/delete/:id
Method
Route
GET
/students
GET
/students/add
POST
/students/add
GET
/student/delete/:usn
Method
Route
GET
/borrowedbooks
GET
/books/issue/:bookid
POST
/books/issue/:bookid
GET
/borrowedbooks/returned/:usn/:bookid
Method
Route
GET
/studentlogin
POST
/studentlogin
GET
/visits
π Library Visit Workflow
Student enters USN.
System validates student record.
Entry time is recorded.
Status changes to IN .
Student enters the same USN.
Latest visit record is fetched.
Exit time is recorded.
Duration is calculated automatically.
Status changes to OUT .
Password hashing using bcrypt
Search and filter functionality
Fine calculation for overdue books
QR Code based student entry
Email notifications
Admin analytics dashboard
Export reports as PDF/Excel
Book reservation system
Multi-librarian roles
Computer Science Student & Full Stack Developer
GitHub:
https://github.com/atharvaajoshii
If you found this project useful, consider giving it a star β on GitHub.