This project is a Python-based Library Management Application containerized with Docker Compose.
It demonstrates a microservices architecture with separate services for authentication, book management, borrowing system, and a frontend, all connected through custom Docker networks.
- Database (MySQL) for storing user, book, and borrowing data.
- Authentication Service for managing user logins and sessions.
- Book Service for managing available books.
- Borrow Service for handling borrow/return transactions.
- Frontend App Service to interact with the system.
- Uses Docker volumes for persistent database storage.
- Custom Docker bridge networks for secure service communication.
The system consists of the following services:
-
Database (
db
)- Runs MySQL
- Persists data with a named Docker volume
- Exposes port
3306
-
Auth Service (
auth_service
)- Handles user authentication
- Connects to both
db
andapp
networks - Runs on port
5001
-
Book Service (
book_service
)- Manages book records
- Connects with the database
- Runs on port
5002
-
Borrow Service (
borrow_service
)- Manages borrowing and returning of books
- Connects with the database
- Runs on port
5003
-
Frontend App (
frontend
)- Main entry point for users
- Connects with
auth_service
,book_service
, andborrow_service
- Runs on port
5000
βββ docker-compose.yml βββ database/ # MySQL Dockerfile & init scripts βββ auth/ # Auth service code & Dockerfile βββ book/ # Book service code & Dockerfile βββ borrow/ # Borrow service code & Dockerfile βββ frontend/ # Frontend app code & Dockerfile
π Networks
dbnet β Used for communication with the database.
middlenet β Internal communication between backend services.
appnet β Connects the frontend with backend services.
πΎ Volumes
db_volume β Persists MySQL data so it is not lost when containers are restarted or removed.