A RESTful API built with Java and Spring Boot for managing a library's book inventory and lending system. Users can perform various operations such as managing books, users, and book loans.
- Installation
- Running the Application
- Testing the Application
- API Endpoints
- Data Structures
- Algorithm
- Technologies Used
- License
To set up the Library Management System API, follow these steps:
- Clone the repository:
git clone https://github.com/codecharlan/library.git
- Navigate to the project directory:
cd library
- Install the required dependencies using Maven:
mvn clean install
- Build the application
mvn clean package
Input and output data are formatted in JSON.
To begin using the Library Application, follow these steps:
- Start the application with:
The application will start on the default port (8080)
mvn spring-boot:run
The API exposes the following endpoints:
Endpoint | HTTP Method | Description |
---|---|---|
/books |
GET | Retrieve a list of all books |
/books |
POST | Add a new book to the library |
/books/{id} |
GET | Retrieve details of a specific book |
/books/{id} |
PUT | Update details of a specific book |
/books/{id} |
DELETE | Remove a book from the library |
/users |
GET | Retrieve a list of all users |
/users |
POST | Add a new user |
/users/{id} |
GET | Retrieve details of a specific user |
/users/{id} |
PUT | Update details of a specific user |
/users/{id} |
DELETE | Remove a user from the system |
/loans |
POST | Record a new loan |
/loans |
GET | Retrieve a list of all loans |
/loans/{id} |
GET | Retrieve details of a specific loan |
/loans/{id}/return?returnDate={returnDate} |
PUT | Mark a loan as returned |
For comprehensive API usage details, refer to our
Swagger: Swagger Documentation.
Postman: Postman Documentation.
The Library application includes a set of unit tests to ensure the functionality of the application. To run the tests, use the following command:
mvn test
- Java 17
- SpringBoot
- Maven
- Spring Security
- Spring Data JPA
- Docker
- Lombok
- CI/CD
- Junit & Mockito
- Git
- Swagger
- Postman
- Email address is unique for every user in the application.
- Isbn is unique for every book created.
- Return date should not be before loan date.
The Library application is licensed under the MIT License.
Feel free to reach out with any questions, feedback, or suggestions.