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
| 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 |
- β Java JDK 17 or higher
- ποΈ Microsoft SQL Server
- π± Apache Tomcat 10.1.44
- π§ Apache NetBeans 17 (recommended)
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
This project uses GitHub Actions for automated testing:
- β Automated unit tests on every push
- π Code quality checks
- π¦ Build verification
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
This project is licensed under the terms specified in the LICENSE file.