markdown
This project is a Library Management System API built using Spring Boot. It allows librarians to manage books, patrons, and borrowing records.
- Book: Includes attributes like ID, title, author, publication year, ISBN, etc.
- Patron: Contains details like ID, name, contact information, etc.
- Borrowing Record: Tracks the association between books and patrons, including borrowing and return dates.
- GET
/api/books: Retrieve a list of all books. - GET
/api/books/{id}: Retrieve details of a specific book by ID. - POST
/api/books: Add a new book to the library. - PUT
/api/books/{id}: Update an existing book's information. - DELETE
/api/books/{id}: Remove a book from the library.
- GET
/api/patrons: Retrieve a list of all patrons. - GET
/api/patrons/{id}: Retrieve details of a specific patron by ID. - POST
/api/patrons: Add a new patron to the system. - PUT
/api/patrons/{id}: Update an existing patron's information. - DELETE
/api/patrons/{id}: Remove a patron from the system.
- POST
/api/borrow/{bookId}/patron/{patronId}: Allow a patron to borrow a book. - PUT
/api/return/{bookId}/patron/{patronId}: Record the return of a borrowed book by a patron.
- Java 17 or higher
- Maven or Gradle
- VS Code with Java extensions
-
Clone the Repository
git clone https://github.com/your-username/your-repository.git cd your-repository Open the Project in VS Code
Launch VS Code and open the project directory.
Build the Project
If you're using Maven:
mvn clean installIf you're using Gradle:
./gradlew buildRun the Application
You can run the Spring Boot application from the command line:
mvn spring-boot:runor
./gradlew bootRunAccess the Application
Open your web browser and navigate to http://localhost:8080/swagger-ui.html to view the Swagger UI and interact with the API.
Testing Run the unit tests to validate the functionality of API endpoints:
mvn testor
./gradlew testDocumentation For detailed API documentation, refer to the Swagger UI and the OpenAPI JSON description linked above.