How mudasir21/library_management_system works
The product is a SQLite-backed library-management application with a shared business service exposed through a CLI and REST API. Users browse and search the catalog, register members, borrow and return books, and review member or overdue-loan information; configurable employee-specific rules govern genres, limits, and fines. The service coordinates domain workflows and repository persistence. The graph preserves documented capabilities, but some subsystem links rely on README architecture statements because the relevant source excerpts are incomplete.
Main entry points: library_service.py Library service · cli.py Command-line interface · api.py REST API · repositories.py Repository contracts
Components 18
Delivery adapters
- Command-line interface
library/delivery/cli.py - REST API
library/delivery/api.py
Business and rules
- Library service
library/service/library_service.py - Personalized rules
library/config.py - Input validators
library/validators.py - Application errors
library/exceptions.py
Library domain
- Book catalog entity
library/domain/book.py - Member entity
library/domain/member.py - Loan and fines
library/domain/loan.py
Persistence
- Repository contracts
library/interfaces/repositories.py - SQLite repositories
library/infrastructure/sqlite_repos.py - Database manager
library/infrastructure/database.py - SQLite database
Shared facilities
- Transaction contexts
library/context_managers.py - Audit decorators
library/decorators.py - Logging setup
library/infrastructure/logging_config.py
Other components
- CLI user
- API client
Connections 27
- CLI user → Command-line interface: runs commands
README.md - API client → REST API: sends requests
README.md - Command-line interface → Library service: delegates operations
README.md - REST API → Library service: delegates endpoints
library/delivery/api.py - Command-line interface → Personalized rules: loads settings
library/delivery/cli.py - REST API → Personalized rules: uses configured rules
README.md - Command-line interface → Logging setup: sets up logging
library/delivery/cli.py - REST API → Logging setup: uses logging setup
library/delivery/api.py - Library service → Input validators: validates input
library/service/library_service.py - Library service → Personalized rules: applies rules
library/service/library_service.py - Library service → Book catalog entity: coordinates catalog
README.md - Library service → Member entity: coordinates membership
README.md - Library service → Loan and fines: coordinates loans
README.md - Library service → Repository contracts: uses repository contracts
library/service/library_service.py - Library service → SQLite repositories: creates repositories
library/service/library_service.py - Library service → Database manager: opens transactions
library/service/library_service.py - Library service → Audit decorators: uses audit decorators
library/service/library_service.py - Repository contracts → Book catalog entity: defines book operations
library/interfaces/repositories.py - Repository contracts → Member entity: defines member operations
library/interfaces/repositories.py - Repository contracts → Loan and fines: defines loan operations
library/interfaces/repositories.py - SQLite repositories → Repository contracts: implements contracts
library/infrastructure/sqlite_repos.py - SQLite repositories → SQLite database: reads and writes
library/infrastructure/sqlite_repos.py - Database manager → SQLite database: initializes schema
library/infrastructure/database.py - Database manager → Transaction contexts: creates transaction
library/infrastructure/database.py - Transaction contexts → SQLite database: commits or rolls back
library/context_managers.py - REST API → Application errors: translates domain errors
README.md - Command-line interface → Application errors: handles application errors
library/delivery/cli.py