A RESTful API for managing a library's book collection, built with Flask and Docker.
- Add/Update/Delete books
- Search by author, year, or genre
- Swagger documentation
- Docker containerization
- AWS EC2 deployment
The API is deployed and accessible at: http://ec2-52-59-226-250.eu-central-1.compute.amazonaws.com
- Docker
- Git
- Python 3.9+
# Clone repository
git clone https://github.com/yourusername/LibraryManagementAPI.git
cd LibraryManagementAPI
# Build Docker image
docker build -t library-api .
# Run container
docker run -d -p 5000:5000 library-api- Local: http://localhost:5000/api-docs
- Production: http://ec2-52-59-226-250.eu-central-1.compute.amazonaws.com/api-docs/
The main branch is protected with:
- Required PR reviews
- Pre-merge checks must pass:
- Unit tests
- Linting (min score: 9.0)
- API endpoint verification
# Run tests
python -m pytest -v
# Run linting
pylint app/*.py tests/*.py --fail-under=9.0POST /api/books- Add new bookGET /api/books- List all booksGET /api/books?author=&year=&genre=- Search booksPUT /api/books/{isbn}- Update bookDELETE /api/books/{isbn}- Delete book
# Build image
docker build -t library-api .
# Run container
docker run -d -p 4000:4000 library-api
# View logs
docker logs library-api
# Stop container
docker stop library-apiPORT- API port (default: 5000)DEBUG- Enable debug mode (default: False)
The API is deployed on AWS EC2. You can:
- Access Swagger docs: http://ec2-52-59-226-250.eu-central-1.compute.amazonaws.com
- Test endpoints directly through Swagger UI
- Use standard HTTP clients like curl or Postman