A simple Library Management System built with Spring Boot.
This RESTful API allows you to manage books: add, view, update availability, and delete records.
- Add new books
- Retrieve all books
- Get book details by ID
- Update book availability
- Delete books
- RESTful endpoints using Spring Boot
- Postman collection for API testing
- Java 17 or above
- Maven 3.8+
- (Optional) Postman for API testing
-
Clone the repository
git clone https://github.com/7TIN/Library-Management.git cd Library-Management -
Build the project
./mvnw clean install
-
Run the application
./mvnw spring-boot:run
The API will start at:
http://localhost:8080
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/books |
Add a new book |
| GET | /api/books |
Get all books |
| GET | /api/books/{id} |
Get book by ID |
| PATCH | /api/books/avail/{id} |
Update book availability |
| DELETE | /api/books/{id} |
Delete book by ID |
{
"title": "Clean Code",
"author": "Robert C. Martin",
"isbn": "9780132350884"
}PATCH /api/books/avail/{id}- Use the sample requests to test all endpoints.
src/
└── main/
├── java/
│ └── com/prasad/library/
│ ├── Beans/
│ ├── Controller/
│ ├── Repository/
│ ├── Service/
│ └── dto/
└── resources/
└── application.properties
- Uses DTOs for request/response mapping
- Follows RESTful resource naming conventions
- Proper HTTP status codes and error handling
- Separation of concerns: Controller, Service, Repository layers
This project is open source and available under the MIT License.