Skip to content

atharvaajoshii/Library-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š 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.

Node.js SQLite EJS License


Live Demo

Deployed Application:
https://library-management-system-o9zd.onrender.com


Features

Librarian Authentication

  • Secure login system
  • Session-based authentication
  • Protected routes
  • Logout functionality

Book Management

  • Add new books
  • Edit existing books
  • Delete books
  • View all books
  • Track available quantity

Student Management

  • Add new students
  • View student records
  • Delete students
  • Manage student information using USN

Book Borrowing System

  • Issue books to students
  • Automatic return date generation
  • Prevent duplicate book issues
  • Mark books as returned
  • Automatic quantity updates

Library Visit Tracking

  • Student entry registration
  • Student exit registration
  • Automatic duration calculation
  • Real-time visitor tracking
  • Complete visit history

Dashboard Analytics

Displays:

  • Total Books
  • Total Borrowed Books
  • Total Library Visits
  • Students Currently Inside Library

πŸ› οΈ Tech Stack

Technology Usage
Node.js Backend Runtime
Express.js Server Framework
SQLite3 Database
EJS Template Engine
Express Session Authentication
HTML/CSS Frontend UI

πŸ“· Screenshots

Login Page

Dashboard

Books Management

Borrowed Books

Student Records

Library Visits

Student Login Portal


πŸ—„οΈ Database Schema

LIBRARIANS

Column Type
id INTEGER (PK)
name TEXT
email TEXT
password TEXT

STUDENTS

Column Type
usn TEXT (PK)
name TEXT
branch TEXT

BOOKS

Column Type
id INTEGER (PK)
title TEXT
author TEXT
quantity INTEGER

BORROWEDBOOKS

Column Type
id INTEGER (PK)
usn TEXT
bookid INTEGER
borrow_date DATE
return_date DATE
status TEXT

LIBRARYVISITS

Column Type
id INTEGER (PK)
usn TEXT
entry_time TEXT
exit_time TEXT
duration TEXT
status TEXT

πŸ“‚ Project Structure

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

βš™οΈ Installation

Clone Repository

git clone https://github.com/atharvaajoshii/Library-management-system.git
cd Library-management-system

Install Dependencies

npm install

Create Environment File

Create a .env file in the root directory:

SESSION_SECRET=your_secret_key
PORT=5002

Run Application

node app.js

or

nodemon app.js

Default Librarian Credentials

Email: [email protected]
Password: pass123

Change these credentials before deploying to production.


πŸ›£οΈ Routes

Authentication

Method Route
GET /
POST /login
GET /logout

Dashboard

Method Route
GET /dashboard

Books

Method Route
GET /books
GET /books/add
POST /books/add
GET /books/edit/:id
POST /books/edit/:id
GET /books/delete/:id

Students

Method Route
GET /students
GET /students/add
POST /students/add
GET /student/delete/:usn

Borrowed Books

Method Route
GET /borrowedbooks
GET /books/issue/:bookid
POST /books/issue/:bookid
GET /borrowedbooks/returned/:usn/:bookid

Library Visits

Method Route
GET /studentlogin
POST /studentlogin
GET /visits

πŸ”„ Library Visit Workflow

Student Entry

  1. Student enters USN.
  2. System validates student record.
  3. Entry time is recorded.
  4. Status changes to IN.

Student Exit

  1. Student enters the same USN.
  2. Latest visit record is fetched.
  3. Exit time is recorded.
  4. Duration is calculated automatically.
  5. Status changes to OUT.

Future Enhancements

  • 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

Author

Atharva Joshi

Computer Science Student & Full Stack Developer

GitHub:
https://github.com/atharvaajoshii


Support

If you found this project useful, consider giving it a star ⭐ on GitHub.


About

A full-stack Library Management System built with Node.js, Express.js, SQLite, and EJS that enables librarians to manage books, students, borrowing transactions, and library visits through an intuitive web interface.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors