Library Management System
Project Overview
The Library Management System is a Django-based web application designed to manage various aspects of a library. This project includes functionalities to handle authors, books, members, loans, and librarians using Django REST framework for API development.
Features
- Authors: Manage author details including name and biography.
- Books: Manage book details including title, author, publication date, and ISBN.
- Members: Manage library members with personal details.
- Loans: Track book loans including loan date and return date.
- Librarians: Manage librarian details including user name and employee number.
Technologies Used
- Django: Framework for building the web application.
- Django REST framework: Toolkit for creating RESTful APIs.
- Python: Programming language.
Installation
-
Clone the Repository:
git clone <your-github-repo-url> cd LibraryManagementSystem
-
Set Up a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install Dependencies:
pip install -r requirements.txt
-
Run Migrations:
python manage.py migrate
-
Run the Development Server:
python manage.py runserver
Access the application at
http://127.0.0.1:8000/.
API Endpoints
-
Authors
GET /api/authors/- List all authorsPOST /api/authors/- Create a new authorGET /api/authors/{id}/- Retrieve a specific authorPUT /api/authors/{id}/- Update a specific authorDELETE /api/authors/{id}/- Delete a specific author
-
Books
GET /api/books/- List all booksPOST /api/books/- Create a new bookGET /api/books/{id}/- Retrieve a specific bookPUT /api/books/{id}/- Update a specific bookDELETE /api/books/{id}/- Delete a specific book
-
Members
GET /api/members/- List all membersPOST /api/members/- Create a new memberGET /api/members/{id}/- Retrieve a specific memberPUT /api/members/{id}/- Update a specific memberDELETE /api/members/{id}/- Delete a specific member
-
Loans
GET /api/loans/- List all loansPOST /api/loans/- Create a new loanGET /api/loans/{id}/- Retrieve a specific loanPUT /api/loans/{id}/- Update a specific loanDELETE /api/loans/{id}/- Delete a specific loan
-
Librarians
GET /api/librarians/- List all librariansPOST /api/librarians/- Create a new librarianGET /api/librarians/{id}/- Retrieve a specific librarianPUT /api/librarians/{id}/- Update a specific librarianDELETE /api/librarians/{id}/- Delete a specific librarian
Testing
To ensure the API works as expected, unit tests have been implemented. You can run the tests with:
python manage.py testTest Results
Testing was performed using Django’s inbuilt test framework. The results of the tests are as follows:
- Authors: All CRUD operations tested successfully.
- Books: All CRUD operations tested successfully.
- Members: All CRUD operations tested successfully.
- Loans: All CRUD operations tested successfully.
- Librarians: All CRUD operations tested successfully.
Screenshots and detailed test logs are included in the testing_evidence folder.
Contributing
Feel free to fork the repository and submit pull requests for improvements or bug fixes. Please ensure that any changes made are well-documented and tested.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Authors
- Godwill Kiplagat - Initial work - Godwill Kiplagat
Feel free to customize the details to match your specific project requirements and include any additional sections you find necessary.