Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Suzune705/Library-Management-System

Repository files navigation

πŸ“š Library Management System

Tests License Java 17 Ant Tomcat 10.1 MSSQL

A Library Management System (LMS) built with Java Servlets, JSP, and Microsoft SQL Server, following the MVC pattern. This project demonstrates concepts like dependency injection, MVC architecture, singleton , simple factory patterns , lazy and eager initialization, SOLID principles such as SRP DIP , RBAC authentication with session and autholization with filter , including integration testing as well as CI automation testing via GitHub Actions


✨ Features

πŸ‘€ User Features

πŸ” Authentication & Account Management

  • Secure user registration and login with BCrypt password hashing
  • Password change
  • Forgot password with email recovery

πŸ“– Book Discovery & Management

  • Search books by title
  • Filter books by category (Action, English, Romance, Skill, Technology)
  • View detailed book information

πŸ“š Borrowing System

  • Borrow available books
  • Extend borrowing period
  • Return books
  • View borrowing and return history

❀️ Favorites

  • Add books to personal favorites list
  • Quick access to favorite books

πŸ‘€ Profile Management

  • Update personal information (name, email, avatar)
  • View personal dashboard with statistics
  • Track total borrowed and returned books

πŸ›‘οΈ Admin Features

πŸ“ˆ Dashboard & Analytics

  • Online user count
  • Total books statistics
  • Borrowed books by category
  • Latest activity logs (login, profile updates, borrowing, returns)

πŸ“š Book Management (CRUD)

  • Add new books
  • Edit book details
  • Delete books
  • Search books
  • View all books

πŸ‘₯ User Management

  • View all registered users
  • Monitor user status (active/inactive)
  • View user borrowing records
  • Delete user accounts
  • Force logout individual users
  • Logout all users

πŸ”’ Access Control

  • RBAC (admin/user)
  • Enhance Security Page JSP

🧩 Technologies Used

Layer Technology / Library Version / Notes
Frontend HTML5, CSS3, JSP JSP 3.0 (Jakarta EE 10)
Backend Java Servlet (Jakarta Servlet API) 6.0 (EE 10)
Database Microsoft SQL Server : (mssql-jdbc-13.2.0.jre11.jar) JDBC driver
Version Control Git + GitHub QuαΊ£n lΓ½ mΓ£ nguα»“n
CI/CD GitHub Actions (Continuous Integration) Tα»± Δ‘α»™ng hΓ³a build vΓ  test Java project
Mail Service Jakarta Mail (jakarta.mail-2.0.1.jar), Jakarta Activation (jakarta.activation-api-2.1.3.jar) Gα»­i email qua SMTP
Security BCrypt (jbcrypt-0.4.jar) Mã hóa mật khẩu người dùng
Logging SLF4J (slf4j-api-2.0.17.jar), Logback (logback-core-1.5.19.jar, logback-classic-1.5.19.jar) Ghi log hệ thα»‘ng
Testing JUnit (junit-4.13.2.jar), Hamcrest (hamcrest-core-1.3.jar) Integration testing
In-Memory DB (Testing) H2 Database (h2-1.3.176.jar) Database cho testing
JSP Tag Library JSTL (jakarta.servlet.jsp.jstl-3.0.1.jar) ThΖ° viện thαΊ» JSP chuαΊ©n

πŸš€ Quick Start

Prerequisites

  • β˜• Java JDK 17 or higher
  • πŸ—„οΈ Microsoft SQL Server
  • 🐱 Apache Tomcat 10.1.44
  • πŸ”§ Apache NetBeans 17 (recommended)

πŸ“ Project Structure

LibraryManagement/
β”‚
β”œβ”€β”€ πŸ“‚ Web Pages/
β”‚  β”œβ”€β”€ πŸ“‚ META-INF/
β”‚  β”œβ”€β”€ πŸ“‚ WEB-INF/
β”‚  β”‚  β”œβ”€β”€ πŸ“‚ lib/
β”‚  β”‚  └── πŸ“‚ views/
β”‚  β”‚    β”œβ”€β”€ πŸ“‚ admin/
β”‚  β”‚    β”œβ”€β”€ πŸ“‚ book/
β”‚  β”‚    β”œβ”€β”€ πŸ“‚ borrowing/
β”‚  β”‚    β”œβ”€β”€ πŸ“‚ components/
β”‚  β”‚    β”œβ”€β”€ πŸ“‚ favorite/
β”‚  β”‚    β”œβ”€β”€ πŸ“‚ user/
β”‚  β”‚    └── πŸ“„ homepage.jsp
β”‚  β”‚
β”‚  └── πŸ“‚ resources/
β”‚    β”œβ”€β”€ πŸ“‚ css/
β”‚    └── πŸ“‚ images/
β”‚
β”œβ”€β”€ πŸ“‚ Source Packages/
β”‚  └── πŸ“‚ com/
β”‚    └── πŸ“‚ library/
β”‚      β”œβ”€β”€ πŸ“‚ controller/
β”‚      β”‚  β”œβ”€β”€ πŸ“‚ admin/
β”‚      β”‚  β”œβ”€β”€ πŸ“‚ book/
β”‚      β”‚  β”œβ”€β”€ πŸ“‚ borrowing/
β”‚      β”‚  β”œβ”€β”€ πŸ“‚ favorite/
β”‚      β”‚  β”œβ”€β”€ πŸ“‚ filter/
β”‚      β”‚  └── πŸ“‚ user/
β”‚      β”‚
β”‚      β”œβ”€β”€ πŸ“‚ dao/
β”‚      β”œβ”€β”€ πŸ“‚ enums/
β”‚      β”œβ”€β”€ πŸ“‚ exception/
β”‚      β”œβ”€β”€ πŸ“‚ factory/
β”‚      β”œβ”€β”€ πŸ“‚ model/
β”‚      β”‚  β”œβ”€β”€ πŸ“‚ dto/
β”‚      β”‚  └── πŸ“‚ entity/
β”‚      β”œβ”€β”€ πŸ“‚ service/
β”‚      └── πŸ“‚ util/
β”‚
└── πŸ“‚ Test Packages/
  └── πŸ“‚ com/
    └── πŸ“‚ library/
      β”œβ”€β”€ πŸ“‚ dao/
      β”œβ”€β”€ πŸ“‚ util/
      └── πŸ“„ Library_Management_v7.sql

πŸ”„ CI/CD Pipeline

This project uses GitHub Actions for automated testing:

  • βœ… Automated unit tests on every push
  • πŸ” Code quality checks
  • πŸ“¦ Build verification

🎨 Design Patterns

The project implements several design patterns to ensure clean, maintainable, and scalable code:

  • 🏭 Factory Pattern - Centralized object creation (DaoFactory, ServiceFactory)
  • 🎯 MVC Pattern - Separation of Model, View, and Controller
  • πŸ“¦ DTO Pattern - Data transfer between layers
  • πŸ”Œ DAO Pattern - Abstract database operations
  • πŸ›‘οΈ Singleton Pattern - Single instance management (DBConnection, SessionTracker)
  • 🎭 Service Layer Pattern - Business logic separation
  • πŸ”’ Exception Hierarchy Pattern - Structured error handling

πŸ“ License

This project is licensed under the terms specified in the LICENSE file.


Built with ❀️ using Java and Jakarta EE

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /