This project provides a simple REST API for a library management system, developed using Spring Boot. The API allows for efficient management of books, authors, and copies, enabling operations such as adding, updating, deleting, and retrieving information.
- Full CRUD Functionality
- Comprehensive Create, Read, Update, and Delete operations
- Data Transfer Object (DTO) Pattern
- Efficient data exchange between layers
- PostgreSQL Database Integration
- Robust and scalable data storage solution
- Advanced Error Handling
- Custom exceptions for specific scenarios
- Global error handling for consistent responses
- Comprehensive Testing Suite
- Integration tests using TestContainers for realistic database interactions
- Unit tests with Mockito and JUnit 5 for thorough code coverage
- API Documentation
- Interactive API documentation using Swagger/OpenAPI
- Best Practices Implementation
- Adherence to software design principles and industry standards
- Clone the repository:
git clone https://github.com/RehanChalana/library-management-system.git
- Running PostgreSQL for Integration Testing with Docker Desktop
To run a PostgreSQL image for integration testing, you need to use Docker Desktop. You can download Docker Desktop from the official website: Docker Desktop - Configure the application properties:
To connect your application to the PostgreSQL database, update the following properties in your application configuration file:spring.datasource.url=jdbc:postgresql://<HOST>:<PORT>/<DATABASE_NAME> spring.datasource.username=<USERNAME> spring.datasource.password=<PASSWORD>
- Start The Application
./mvnw spring-boot:run
- Start The Application
./mvnw spring-boot:run
- Access API Documentation
Open your web browser and navigate to
http://localhost:8080/swagger-ui/index.html