The Library Management System is a RESTful API built using Spring Boot. It allows librarians to manage books, patrons, and borrowing records efficiently. The system provides endpoints for creating, retrieving, updating, and deleting book and patron records, as well as managing the borrowing and returning of books.
- Book Management: CRUD operations for managing books in the library.
- Patron Management: CRUD operations for managing patrons.
- Borrowing Records: Track and manage the borrowing and returning of books by patrons.
- Validation and Error Handling: Ensure proper input validation and handle exceptions gracefully.
- Transaction Management: Ensure data integrity during critical operations.
- Basic authentication or JWT-based authorization.
- Aspect-Oriented Programming (AOP) for logging.
- Caching to improve performance.
- Spring Boot: Framework for building the API.
- Database: PostgreSQL.
- JPA/Hibernate: For ORM and database interactions.
- JUnit/Mockito: For unit testing.
- Spring Security: For authentication and authorization.
- Swagger: For API documentation.
- Lombok: For reducing boilerplate code.
- WebFlux: For reactive programming.
- Docker: For containerization (optional).
- Docker :)
git clone https://github.com/anas-stuff/booky-api.git
cd booky-api
docker build --network=host -t booky-api-db -f db.dockerfile .
docker run --name booky-api-db -d -p 5432:5432 booky-api-db
docker build --network=host -t booky-api-boot-app -f Dockerfile .
docker run --network=host --name booky-api-boot-app -d -p 8080:8080 booky-api-boot-app
The API will be accessible at http://localhost:8080/
.
The API documentation is available at http://localhost:8080/swagger-ui/index.html
.
- Login to the system using the
/login
endpoint.At the start of the application, there is only one super admin user with the following credentials:
- Username:
[email protected]
- Password:
root
- Username:
- Use the token received from the login response to access other endpoints.
- Create another low privileged admin using the
/api/admin/add
endpoint. - Use the new admin credentials to login and access the system.
- Create books and patrons using the
/api/books
and/api/patrons
endpoints. - Borrow and return books using the
/api/borrow
and/api/return
endpoints. - View borrowing records using the
/api/borrow/records
endpoint.