Skip to content

SepehrKalantariSol/java-library-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interactive Library Management System (Java)

A full-featured Java library management system with CLI and GUI, built using OOP principles.

Overview

This project is a Java-based interactive library management system developed using object-oriented programming principles.

It provides both a command-line interface (CLI) and a graphical user interface (GUI) to manage books, patrons, and loans. The system simulates real-world library operations including borrowing, returning, renewing books, and maintaining persistent data storage.


Demo

GUI Demo


Key Features

  • Add, view, and manage books and patrons
  • Borrow, return, and renew books
  • Loan tracking with due dates
  • Loan history per patron
  • Soft delete for books and patrons (data preserved)
  • Borrowing limit enforcement
  • Command-based architecture
  • GUI using Java Swing
  • Persistent storage using text files
  • Unit testing with JUnit

Project Structure

.
├── src
│   ├── commands        # Command logic (operations)
│   ├── data            # Data persistence and management
│   ├── gui             # GUI components (Swing)
│   ├── main            # Entry point and parser
│   ├── model           # Core entities (Book, Patron, Loan)
│   └── test            # Unit tests
│
├── resources
│   └── data
│       ├── books.txt
│       ├── patrons.txt
│       └── loans.txt
│
├── lib
│   ├── junit-4.13.2.jar
│   └── hamcrest-core-1.3.jar
│
├── docs
│   └── demo.png
│
└── README_lib.md

Architecture

CLI / GUI
   ↓
Command Layer (commands)
   ↓
Core Model (model)
   ↓
Data Layer (data)
   ↓
File Storage (resources/data)

How It Works

  1. The system loads existing data from text files at startup
  2. User interacts via CLI or GUI
  3. Commands are parsed and executed
  4. Changes are applied to the in-memory model
  5. Data is saved immediately after successful operations
  6. If saving fails, the system rolls back to the last valid state

How to Run

Requirements:

  • Java 17+
  • IntelliJ IDEA

Steps:

  1. Open the project in IntelliJ
  2. Mark src as Sources Root
  3. Add lib/ as project dependency
  4. Run:

main.Main


Dependencies

  • JUnit 4.13.2
  • Hamcrest Core 1.3

Notes

  • Data is stored in resources/data/
  • System supports rollback if file saving fails
  • Designed to be modular and extendable

Author

  • Sepehr Kalantari Soltanieh
  • Seyed Atta Rahimi

About

Java-based library management system with CLI, GUI (Swing), persistent storage, loan handling, and unit testing.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages