A secure and role-based backend application to efficiently manage library operations, including books, members, and staff, built with Spring Boot & MySQL.
The system is developed using Spring MVC, Spring Data JPA, and Spring Security, providing a clean layered architecture, secure authentication, and robust data persistence.
This project demonstrates key backend development skills such as RESTful API design, JPA/Hibernate integration, role-based access control, and secure user authentication.
Designed to showcase practical skills in Java backend development and database management, following clean architecture and best practices.
- ✅ Role-based access control: Administrator, Librarian, Staff
- 📘 Book management: CRUD operations with extended metadata (title, authors, publisher, categories, language, ISBN, edition, summary, cover image)
- 👩💼 Member management: Register, login, update profiles
- 🏢 System user management: Role-based permissions, secure password storage, authentication, activity logging
- 📊 Borrowing & return functionality: Track book loans, due dates, return status, and fines
- 🔁 Database integration: JPA/Hibernate ORM for all entities
- 🔐 Validation & error handling: Input validation, structured API responses, exception handling
- 📂 SQL scripts included: Sample data and database initialization
- 📦 Clean architecture: Layered structure (Controller → Service → Repository)
- 🧭 API documentation: Interactive Swagger UI for exploring and testing endpoints
The database schema is designed to support a scalable and flexible library management system, handling books, users, and borrowing transactions efficiently while ensuring data consistency and security.
-
Books
- Stores extended metadata: title, ISBN, edition, publication year, summary, language, cover image
- Tracks total and available copies
- Relationships:
- Many-to-Many with Authors
- Many-to-Many with Categories
- Many-to-One with Publisher
-
Authors:
- Stores author details such as name and biography
-
Categories:
- Supports hierarchical structure (parent-child) for genre classification
- Example: Fiction → Mystery
-
Borrowers:
- Represents library members
- Stores personal information (name, email, phone, address)
-
BorrowRecords:
- Tracks borrowing transactions
- Includes borrow date, due date, return date, status, and fines
- Links borrowers with books
-
Users:
- Represents system users (Administrator, Librarian, Staff)
- Implements role-based access control using ENUM roles
-
UserActivityLogs:
- Logs system activities such as create, update, delete, login, borrow, and return
- Ensures auditing and accountability
- Normalized schema ensures data consistency and avoids duplication
- Flexible Many-to-Many relationships support multiple authors and categories per book
- Role-based access control enhances system security
BorrowRecordsdecouples borrowing logic from books and users- Activity logging provides transparency and auditability
- Language: Java
- Framework: Spring Boot
- Web Layer: Spring MVC
- Security: Spring Security (Authentication & Role-Based Authorization)
- Data Access: Spring Data JPA
- ORM: Hibernate
- Database: MySQL
- Build Tool: Maven
- Architecture: Layered Architecture (Controller, Service, Repository)
- API Style: RESTful APIs
- API Documentation: Swagger (OpenAPI 3)
- Java 21
- MySQL
- Maven
- Clone the repository:
git clone https://github.com/ayaHathout/LibraryManagmentSystem.git- Create a MySQL database (e.g.,
library_db) and update the database configuration insrc/main/resources/application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/library_db
spring.datasource.username=YOUR_USERNAME
spring.datasource.password=YOUR_PASSWORD-
Initialize the database (optional):
You can use the provided SQL scripts to create the schema and insert sample data:
-
Build and run the application using Maven:
mvn clean install
mvn spring-boot:run-
Access the application at: http://localhost:8086
-
Test the REST APIs using Postman or any REST client.
All API endpoints are included in the Postman collection.
You can import it into Postman to test the application easily:
After running the application, you can explore and test all REST APIs using Swagger UI:
👉 http://localhost:8086/swagger-ui/index.html
Swagger provides an interactive interface to view, test, and understand the available endpoints.
Aya Hathout – Java Software Engineer | ITI 9-Month Graduate | Enterprise & Web Apps Development (Java)
- 🌐 LinkedIn: https://www.linkedin.com/in/aya-hathout
- 🐙 GitHub: https://github.com/ayaHathout
💬 Feel free to reach out for questions, collaboration, or feedback!