Skip to content

arpanAdhikari6/Library-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library Management System

Java Spring Boot Maven License

A Spring Boot REST API project for managing a library system. It provides full CRUD functionality for books, global exception handling, validation, and interactive API documentation using Swagger.


Features

  • Add, update, delete, and retrieve books
  • Fetch book by ID
  • Global exception handling (@ControllerAdvice)
  • Input validation with meaningful error messages
  • RESTful API design
  • Swagger API documentation
  • Layered architecture (Controller, Service, Repository)

Tech Stack

  • Java 17+
  • Spring Boot
  • Spring Web
  • Spring Data JPA
  • Hibernate
  • Maven
  • H2 / MySQL (based on configuration)
  • Swagger / OpenAPI

Project Structure

Library-Management-System/
│
├── src/
│   ├── main/
│   │   ├── java/
│   │   │   └── com/library/demo/
│   │   │       ├── controller/
│   │   │       ├── service/
│   │   │       ├── repository/
│   │   │       ├── model/
│   │   │       ├── exception/
│   │   │       └── config/
│   │   └── resources/
│   │       ├── application.properties
│
├── pom.xml
├── mvnw
├── mvnw.cmd
└── README.md


Getting Started

1️ Clone the Repository

git clone https://github.com/your-username/Library-Management-System.git
cd Library-Management-System

2️ Build the Project

mvn clean install

3️ Run the Application

mvn spring-boot:run

API Endpoints

Book APIs:

Method Endpoint Description
GET /api/books Get all books
GET /api/books/{id} Get book by ID
POST /api/books Add a new book
PUT /api/books/{id} Update book
DELETE /api/books/{id} Delete book

Swagger Documentation

Once the application is running, access API docs:

http://localhost:8080/swagger-ui/index.html


Exception Handling

This project includes robust error handling for:

  • Resource Not Found,
  • Validation Errors,
  • Generic Server Errors

All errors return structured and meaningful JSON responses.


Author:

Arpan Adhikari

  • Washburn University
  • Computer Information Science & Business Data Analytics

About

A Spring Boot REST API for managing library books with full CRUD functionality, input validation, global exception handling, and interactive Swagger documentation. Built using Java, Spring Boot, Spring Data JPA, Hibernate, and H2/MySQL, following a layered architecture (Controller → Service → Repository).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages