Skip to content

Mahith28/Library-Managment-System

Repository files navigation

Library Management System

A Java Swing desktop application for managing a small library — borrowing books, managing students, and tracking borrow history — with CSV-based persistence.


Features

Admin

  • Add and remove books
  • Add new students
  • View library statistics (total books, available, borrowed, total students)
  • View full borrowing history across all students

Student

  • Register and log in with a secure password
  • Browse all books with availability status
  • Borrow a book with a custom due date
  • Return a borrowed book
  • View personal borrowing history

Project Structure

├── MainFrame.java         # Entry point; login/registration screen
├── AdminFrame.java        # Admin panel GUI
├── StudentFrame.java      # Student panel GUI
├── LibraryManager.java    # Core business logic
├── CSVHandler.java        # CSV read/write operations
├── Book.java              # Book model
├── Student.java           # Student model
├── Borrow.java            # Borrow record model
├── LibraryItem.java       # Abstract base class for library items
├── Borrowable.java        # Interface for borrowable items
├── books.csv              # Book data store
├── students.csv           # Student data store
└── borrows.csv            # Borrow record data store

Requirements

  • Java 11 or higher
  • No external libraries — uses only the Java standard library and Swing

How to Run

1. Compile all Java files:

javac *.java

2. Run the application:

java MainFrame

The main window will open with options for Student Login, Student Registration, and Admin Login.


Default Credentials

Admin

  • Username: admin
  • Password: admin123

Student — Register via the main screen, or use any existing entry in students.csv.


CSV File Formats

books.csv

id,title,available
B1,Java Programming,true

students.csv

rollNo,password
27,Vaibhav123

borrows.csv

rollNo,bookId,borrowedDate,dueDate,returnedDate,status
27,B1,2026-03-01,2026-03-15,,Active

If books.csv is empty on startup, the application seeds it with five default books (Java Programming, Data Structures, Algorithms, Operating Systems, Database Systems).


Password Policy

Student passwords must be:

  • At least 7 characters long
  • Contain at least one uppercase letter
  • Contain at least one lowercase letter
  • Contain at least one number

Notes

  • All data is saved automatically to CSV files after every action.
  • A book cannot be removed while it has an active borrow record.
  • Due dates must be in YYYY-MM-DD format and must be after today's date.
  • The application is backward-compatible with old 3-column borrow records (rollNo,bookId,dueDate), estimating the borrow date as 14 days before the due date.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages