The Smart Library System aims to modernize library operations by providing a comprehensive platform for managing physical and digital resources, facilitating member interactions, and offering enhanced services.
This system will enable:
- Efficient management of books, journals, and digital media.
- Streamlined member registration and borrowing processes.
- Online access to digital content and library resources.
- Automated notifications and reminders.
The Kanban board for this project was customized to align with the specific workflow and quality assurance requirements of the Smart Library System. The following columns were added to the base template:
-
To Do: This column represents the initial stage of tasks that are ready for development but have not yet been started.
-
In Progress: This column tracks tasks that are currently being worked on by the development team.
-
Testing: This column was added to explicitly track tasks that are undergoing quality assurance. This allows the development team to visualize which tasks have been completed from a development standpoint but still require validation before deployment.
-
Blocked: This column is used to highlight tasks that are currently impeded or cannot progress due to external dependencies or unresolved issues. This provides visibility into any bottlenecks or delays in the workflow, enabling the team to address them promptly.
-
Done: This column represents the final stage of tasks that have been completed, tested, and are ready for deployment.
These customizations enhance the board's utility by providing a more detailed view of the task lifecycle and supporting a more robust Agile development process.
- Object State Modeling.md
- Activity Workflow Modeling.md
- Integration with Prior Work.md
- Reflection Assignment 8.md
- Class Implementation Details Assignment 10.md - For details on the language choice and key design decisions
- Source Code Directory - Contains the source code files.
- Creational Patterns Justification.md - For details on the creational design patterns used
- Creational Patterns Directory - Implementation of various creational design patterns.
- Tests Directory - Contains all test files
- Test Coverage Report.md - View test coverage metrics
- CHANGELOG.md - Version history and updates
The repository layer is implemented using a generic Repository interface (repositories/repository.py). This approach leverages Python's typing system (specifically, TypeVar and Generic) to avoid code duplication across entity-specific repositories. For example, instead of writing separate CRUD implementations for Book, LibraryMember, etc., we define the common operations once in the Repository interface and then create entity-specific interfaces (e.g., BookRepository) that inherit from it. This promotes code reuse and maintainability. Each entity-specific repository interface can also define methods unique to that entity (e.g., BookRepository's find_by_title).
- Storage Abstraction Mechanism - For explanation of Abstraction Mechanism choice.
The system is designed to easily add new storage backends in the future. As an example, we have created a stub implementation for a DatabaseBookRepository that will save book data to an SQLite database.
You can find the stub implementation here:
For SQLite storage, we have also provided a basic database.db file that can be used for storing the data. You can refer to it in the projectβs database integration section:
The Smart Library API is documented using FastAPI's Swagger UI, providing interactive and auto-generated docs at runtime.
Start your FastAPI server and open:
π http://127.0.0.1:8000/docs
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/books/ |
List all books |
| POST | /api/books/ |
Add a new book |
| GET | /api/books/{id} |
Get a book by ID |
| DELETE | /api/books/{id} |
Delete a book by ID |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/members/ |
List all members |
| POST | /api/members/ |
Register a new member |
| GET | /api/members/{id} |
Get a member by ID |
| DELETE | /api/members/{id} |
Delete a member by ID |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/reservations/ |
List all reservations |
| POST | /api/reservations/ |
Make a new reservation |
This FastAPI-based Smart Library System offers RESTful endpoints to manage books, library members, and reservations.
http://localhost:8000
- POST
/api/books/ - Request Body:
BookRequest - Response:
BookResponse - Error: 422 (Validation Error)
- GET
/api/books/ - Response:
List[BookResponse]
- GET
/api/books/{book_id} - Response:
BookResponse - Error: 404 (Book not found)
- DELETE
/api/books/{book_id} - Response: Success message
- Error: 404 (Book not found)
- POST
/api/members/ - Request Body:
MemberRequest - Response:
MemberResponse - Error: 422 (Validation Error)
- GET
/api/members/ - Response:
List[MemberResponse]
- GET
/api/members/{member_id} - Response:
MemberResponse - Error: 404 (Member not found)
- DELETE
/api/members/{member_id} - Response: Success message
- Error: 404 (Member not found)
- POST
/api/reservations/ - Request Body:
ReservationRequest - Response:
ReservationResponse - Error: 422 (Validation Error)
- GET
/api/reservations/ - Response:
List[ReservationResponse]
- GET
/api/reservations/{reservation_id} - Response:
ReservationResponse - Error: 404 (Reservation not found)
- DELETE
/api/reservations/{reservation_id} - Response: Success message
- Error: 404 (Reservation not found)
{
"isbn": "978-1234567890",
"title": "Sample Book",
"publication_year": 2020,
"authors": ["Author One", "Author Two"],
"genre": "Fiction",
"edition": 1,
"publisher": "Book Publisher",
"total_copies": 10,
"available_copies": 10,
"description": "Optional book description"
}{
"book_id": "B001",
"isbn": "978-1234567890",
"title": "Sample Book",
"publication_year": 2020,
"authors": ["Author One", "Author Two"],
"genre": "Fiction",
"edition": 1,
"publisher": "Book Publisher",
"total_copies": 10,
"available_copies": 10,
"description": "Optional book description"
}{
"member_id": "M001",
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1995-08-15",
"email": "john@example.com",
"phone_number": "1234567890",
"address": "123 Main St",
"membership_date": "2024-01-01",
"membership_type": "Regular",
"status": "Active"
}{
"member_id": "M001",
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1995-08-15",
"email": "john@example.com",
"phone_number": "1234567890",
"address": "123 Main St",
"membership_date": "2024-01-01",
"membership_type": "Regular",
"status": "Active"
}{
"reservation_id": "R001",
"book_id": "B001",
"member_id": "M001",
"reservation_date": "2024-05-05"
}{
"reservation_id": "R001",
"book_id": "B001",
"member_id": "M001",
"reservation_date": "2024-05-05"
}{
"detail": [
{
"loc": ["body", "title"],
"msg": "field required",
"type": "value_error.missing"
}
]
}β Launch the server and visit:
http://localhost:8000/docsπΈ Take a screenshot and save it under your
/docsdirectory asswagger_ui.png
If you're exporting the OpenAPI spec:
- JSON:
http://localhost:8000/openapi.json - Save it as:
/docs/openapi.jsonor/docs/openapi.yaml
api/book_routes.pyβ Book API endpointsapi/member_routes.pyβ Member API endpointsapi/reservation_routes.pyβ Reservation API endpoints
repositories/services/book_service.pyrepositories/services/member_service.pyrepositories/services/reservation_service.py


