https://github.com/junaid-ashraf-56/library_management_system-spring-
A modular Library Management System built using Java, Spring MVC, Spring JDBC, Spring AOP, JUnit5, Mockito, PostgreSQL, and Mavenβfeaturing clean architecture, robust testing, and interactive console routing for admin and user operations.
https://github.com/junaid-ashraf-56/library_management_system-spring-
java junit5 maven mockito postgresql spring spring-aop spring-jdbc spring-mvc
Last synced: 4 months ago
JSON representation
A modular Library Management System built using Java, Spring MVC, Spring JDBC, Spring AOP, JUnit5, Mockito, PostgreSQL, and Mavenβfeaturing clean architecture, robust testing, and interactive console routing for admin and user operations.
- Host: GitHub
- URL: https://github.com/junaid-ashraf-56/library_management_system-spring-
- Owner: Junaid-Ashraf-56
- Created: 2025-09-15T20:18:43.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-09-20T08:53:50.000Z (10 months ago)
- Last Synced: 2025-09-20T10:22:08.615Z (10 months ago)
- Topics: java, junit5, maven, mockito, postgresql, spring, spring-aop, spring-jdbc, spring-mvc
- Language: Java
- Homepage:
- Size: 191 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Tech Stack





A **modular Library Management System** built using **Java, Spring MVC, Spring JDBC, Spring AOP, JUnit5, Mockito, PostgreSQL, and Maven**βfeaturing **clean architecture, robust testing, and interactive console routing** for both admin and user operations.
---
## Quick Start
Get the project running in just a few steps:
```bash
# Clone the repo
git clone git@github.com:Junaid-Ashraf-56/Library_Management_System-Spring-.git
cd Library_Management_System-Spring-
# Build the project
mvn clean install
# Run the application
java -jar target/library-management-system-0.0.1-SNAPSHOT.jar
````
---
Blog Posts
For a deeper understanding of the concepts used in this project, check out my Hashnode blogs:
---
## Table of Contents
* [Features](#features)
* [Tech Stack](#tech-stack)
* [Architecture Overview](#architecture-overview)
* [Screenshots](#screenshots)
* [Installation](#installation)
* [Usage](#usage)
* [Testing](#testing)
* [Console Navigation](#console-navigation)
* [Project Structure](#project-structure)
* [Contributing](#contributing)
* [Acknowledgments](#acknowledgments)
---
## Features
* **Book Management**: Add, update, delete, and list books.
* **User Management**: Manage library members and librarians.
* **Search**: Find books by title, author, ISBN, or category.
* **Borrow/Return Workflow**: Track checkouts and returns with due dates.
* **Role-Based Access**: Admins manage inventory/users; patrons borrow books.
* **Audit Logging (AOP)**: Automatic logging of key operations.
* **Data Validation**: Ensures integrity (e.g., unique ISBNs, valid logins).
---
## Clean Architecture
This project is structured following **Clean Architecture** principles, ensuring modularity, maintainability, and clear separation of concerns:
- **Model Layer**
Defines core domain entities such as `Book`, `Person`, and `Borrow`.
- **Service Layer**
Encapsulates business logic, including borrowing workflows and user registration.
- **Repository Layer**
Handles persistence with **Spring JDBC**, ensuring reliable communication with the PostgreSQL database.
- **Controller / UI Layer**
Provides console-driven interfaces for both Admin and User operations.
Spring AOP handles **cross-cutting concerns** like logging, ensuring clean and maintainable code.
---
## Screenshots
### Welcome to the Library Management System ###
### Main Menu

### Admin Dashboard

### User Dashboard

---
## Installation
1. **Install prerequisites**: Java (11+), Maven, PostgreSQL.
2. **Database setup**:
* Create a PostgreSQL database (e.g., `librarydb`).
3. **Build the project**:
```bash
mvn clean install
```
---
## Usage
Run the application:
Or run the packaged JAR:
```bash
java -jar target/library-management-system-0.0.1-SNAPSHOT.jar
```
---
## Testing
Run all tests:
```bash
mvn test
```
Run a single test:
```bash
mvn test -Dtest=BookServiceTest
```
---
## Console Navigation
**Admin Menu**
```
1. Add Person
2. Add Book
3. Manage Books
4. List Persons
5. List Books
6. Delete Person
7. Delete Book
8. Logout
```
**User Menu**
```
1. Borrow a Book
2. Return Book
3. View Borrowed Books
4. Search Books
5. Logout
```
---
## π Project Structure
```
LibraryManagementSystem/
ββ src/
β ββ main/java/
β β ββ aspect/
β β ββ config/
β β ββ controller/
β β ββ dao/
β β ββ model/
β β ββ service/
β β ββ terminal_ui/
β β ββ Main.java
β ββ main/resources/
β ββ test/java/
β ββ controller/
β ββ dao/
β ββ service/
ββ pom.xml
ββ README.md
```
---
## Contributing
Contributions are welcome!
* Fork the repo & create a branch
* Add tests for new features
* Follow coding standards
* Submit a PR with a clear description
---
## Acknowledgments
* **Spring Framework** β for modular development
* **JUnit & Mockito** β for testing support
* **Clean Architecture (Robert C. Martin)** β design inspiration
* **Baeldung** β helpful Spring/JUnit
---
β¨ **Thank you for using and contributing to this Library Management System!**