A full-featured Library Management System built with Java Swing and MySQL. Features a modern Glass UI, Admin/Student dashboards, book inventory management, and real-time issue/return tracking. Developed by S P Madhusanka.
Developed By: S P Madhusanka
Faculty: Faculty of Management and Commerce, SEUSL
- Secure Login: Role-based authentication (Admin vs. Student).
- User Management: Register new Students and Admins with profile details.
- Book Inventory: Add, Update, and Delete books.
- Issue System: Issue books to students and track due dates.
- Real-time Availability: Auto-updates book quantities upon issuing.
- Personal Dashboard: View currently borrowed books and due dates.
- Catalog Search: Search for books by Title or Author.
- Availability Checker: See if a book is in stock or out of stock.
- Language: Java (JDK 8+)
- GUI Framework: Java Swing (WindowBuilder)
- Database: MySQL
- IDE: Eclipse IDE
- Design: Custom "Glass UI" with transparent panels and background images.
Follow these steps to run the project on your local machine.
Open MySQL Workbench and run the following script to create the database and required tables:
CREATE DATABASE library_db;
USE library_db;
-- 1. Users Table (Login Credentials)
CREATE TABLE users (
user_id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) UNIQUE NOT NULL,
password VARCHAR(50) NOT NULL,
role VARCHAR(20) NOT NULL -- 'ADMIN' or 'STUDENT'
);
-- 2. Book Inventory
CREATE TABLE books (
book_id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100),
author VARCHAR(100),
isbn VARCHAR(20),
genre VARCHAR(50),
quantity INT,
available_qty INT
);
-- 3. Student Details Profile
CREATE TABLE student_details (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT,
full_name VARCHAR(100),
address VARCHAR(255),
email VARCHAR(100),
contact_number VARCHAR(20),
dob DATE,
nic VARCHAR(20),
FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
);
-- 4. Admin Details Profile
CREATE TABLE admin_details (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT,
full_name VARCHAR(100),
email VARCHAR(100),
contact_number VARCHAR(20),
FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
);
-- 5. Transactions (Borrowing Logic)
CREATE TABLE transactions (
transaction_id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT,
book_id INT,
issue_date DATE,
due_date DATE,
return_date DATE,
status VARCHAR(20), -- 'ISSUED' or 'RETURNED'
FOREIGN KEY (user_id) REFERENCES users(user_id),
FOREIGN KEY (book_id) REFERENCES books(book_id)
);
-- 6. Insert Default Admin
INSERT INTO users (username, password, role) VALUES ('admin', 'admin123', 'ADMIN');
-- Note: You must manually add a row to admin_details for this user if needed.