A Spring Boot application for managing a library's books, members, and borrowing records.
- Book Management (add, update, delete, search books)
- Member Management (register, update, remove members)
- Borrowing System (check out books, return books, track due dates)
- RESTful API endpoints for all operations
- Java 17
- Spring Boot
- Spring Data JPA
- H2 Database (can be configured for other databases)
- Maven
- Java 17 or higher
- Maven 3.6 or higher
- Clone the repository:
git clone [repository-url]- Navigate to the project directory:
cd library- Build the project:
./mvnw clean install- Run the application:
./mvnw spring-boot:runThe application will start running at http://localhost:8080
- 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 a book - DELETE
/api/books/{id}- Delete a book
- GET
/api/members- Get all members - GET
/api/members/{id}- Get member by ID - POST
/api/members- Register a new member - PUT
/api/members/{id}- Update member information - DELETE
/api/members/{id}- Remove a member
- POST
/api/borrow- Borrow a book - PUT
/api/return/{id}- Return a book - GET
/api/borrowing-records- Get all borrowing records - GET
/api/borrowing-records/member/{id}- Get member's borrowing history
The application uses H2 database by default. The database configuration can be found in src/main/resources/application.properties.
src/
├── main/
│ ├── java/
│ │ └── com/app/library/
│ │ ├── controller/
│ │ ├── model/
│ │ └── service/
│ └── resources/
│ └── application.properties
└── test/
└── java/
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.