VIL-MASYS
Virtual Library Management System
Welcome to VIL-MASYS, the Virtual Library Management System designed to streamline the management of libraries by providing a robust, user-friendly platform. Whether you are a librarian or a book lover, VIL-MASYS is built to enhance your library experience by bringing all the essential functionalities online.
Link to VIL-MASYS - Virtual Library Management System
Table of Contents
Project Overview
Purpose:
This project serves as an educational resource, demonstrating the application of Python development skills in building a comprehensive web-based book issuance system. The project showcases how Django can be leveraged to create a scalable and interactive application, with a focus on user experience, data management, and thorough testing. In general, this project exemplifies how Python, Django, Bootstrap, and Cloudinary can be combined to build a functional, secure, and visually appealing web application.
Existing Features
Navigation bar
Main Page - Top 3 Books
- The "3 Most Issued Books" section enhances user engagement by showcasing popular titles and guiding users toward trending books, while also promoting the circulation of these frequently borrowed items.
Top 5 Issued Books
Main Page - Website Introduction Features
- The "Why issue with us" section highlights the benefits of using the booking system on this online platform.
- The "How to issue a book" section shows new users how simple it is to issue a book on our platform.
- The button to join the library, shown after the features are explained, encourages users to join the website.
Main Page Features Introduction
About Page
- The About page provides an overview of VIL-MASYS, our Virtual Library Management System, highlighting its purpose and key features.
About Page
Sign up/Login page
Book Suggestions Forms
-
Open the Suggestion book page in case anyone wants to suggest new books.
Book Suggestion Form
-
Thank you submission page.
Thank you page
-
Easy and clean admin interface to view the book suggestions.
Admin Interface
Book Issuance System
-
Easy issuance when you click on a book cover, you will be directed to book details where, if logged in, it will show the option to book it; otherwise, it will show the login button.
Book Detail No User
<details><summary>Book Detail User Connected</summary><img src="https://github.com/Volneirj/project_iv_ci/raw/main/documentation/readme_images/features/book-detail-user.jpg"></details>
-
Confirmation screen showing the details of your issuance.
Issuance Details
-
You can see your history and return the books on the My Issued Books Link on the Navigation bar.
My Issued Books
-
When returning a book, as a good practice, it has a confirmation.
Return Book Confirmation
<details><summary>Book Return Notification</summary><img src="https://github.com/Volneirj/project_iv_ci/raw/main/documentation/readme_images/features/book-return-notify.jpg"></details>
Book Collection
-
The book collection has a search bar to search a title and shows the book cover and book name for easy visualization.
Book Collection
-
When logged in as an admin, it shows the option at the top to add new books.
Admin Book Collection Interface
Administrator CRUD Function
- As a web administrator, it is possible to add, update, or delete books.
- Adding a book:
- On the Book Collection page as an Administrator, a button labeled "Add book" will be shown.
Add a book
- The link will bring you to a page where you can fill out the form to add a book.
Add a book form
- If a book cover is not loaded, it will automatically add a placeholder image saying "Book image not available."
Book Image not Available
- As a web administrator, when on book details, the buttons to update and delete the book will be visible.
CRUD Options
- Updating a book:
- Click on "Edit book."
- The "Update Book" page will open where you can change all book information.
Update Book
- Deleting a book:
- Click on "Delete book."
- You will be directed to a deletion page for confirmation.
Delete Book
Footer with Social Media Links
- The footer has social media links that open in a new page.
Footer
Error Pages.
Extra Functions
- Late fee function: If the book is not returned in 14 days, a $1 fee will be applied for each day of delay.
Late Fee
- You cannot issue two copies of the same title at once.
Book Already Issued Notification
- You can only issue 3 books at once.
Max Issue Notification
- Book out of stock.
Book Out of Stock Notification
Technical Design
WireFrames
-
When the VIL-MASYS project began, I created basic wireframes to outline the initial design and functionality of the application. These wireframes served as a starting point to visualize the core structure and user flow. However, as development progressed, significant changes were made to improve the user experience, functionality, and overall design.
-
Initial WireFrame Design:
Home
<details><summary>Book Info</summary><img src="https://github.com/Volneirj/project_iv_ci/raw/main/documentation/readme_images/wireframes/book-info.jpg"></details>
<details><summary>Login</summary><img src="https://github.com/Volneirj/project_iv_ci/raw/main/documentation/readme_images/wireframes/login.jpg"></details>
<details><summary>Issued Book</summary><img src="https://github.com/Volneirj/project_iv_ci/raw/main/documentation/readme_images/wireframes/issue-book-page.jpg"></details>
<details><summary>About</summary><img src="https://github.com/Volneirj/project_iv_ci/raw/main/documentation/readme_images/wireframes/about.jpg"></details>
-
Key Changes:
-
Enhanced User Interface: The initial wireframes were simple and lacked the visual appeal needed for a modern web application. As the project evolved, I introduced a more polished and intuitive interface, incorporating feedback and best practices in UI/UX design.
-
Expanded Features: Originally, the wireframes focused on basic functionalities. During development, new features were added, such as personalized book recommendations, late fees, notifications, and advanced search capabilities, which were not part of the initial plan.
-
Improved Navigation and Layout: The initial wireframes had a straightforward but somewhat limited navigation structure. I restructured the layout to provide a more seamless and logical flow, making it easier for users to navigate between different sections of the application.
Models Relationships
-
Key Relationships:
- Book and IssuedBook Relationship
- Relationship Type: One-to-Many (ForeignKey)
Explanation:
- The Book model represents each book in the library's collection.
- The IssuedBook model keeps track of each instance where a book is issued to a user.
- A single Book can be issued multiple times, hence the one-to-many relationship. This is implemented using a ForeignKey in the IssuedBook model that references the Book model.
- The related_name='issued_books' allows you to access all issued records for a particular book using book.issued_books.all().
- User and IssuedBook Relationship
- Relationship Type: One-to-Many (ForeignKey)
Explanation:
- The User model (from Django’s built-in authentication system) represents the users of the library system.
- Each user can issue multiple books over time. Therefore, there is a one-to-many relationship between User and IssuedBook.
- The ForeignKey in the IssuedBook model links each issued book to the specific user who has borrowed it.
- The related_name='issued_books' allows you to retrieve all the books issued by a particular user using user.issued_books.all().
- BookSuggestion Model
- Standalone Entity:
- The BookSuggestion model is independent of the Book and IssuedBook models. It captures suggestions for new books that users want to see in the library.
- This model contains information about the suggested book's title and author, as well as optional fields for the user’s name, email, and reason for suggesting the book.
- While this model is not directly related to the Book or User models through foreign keys, it plays an important role in allowing users to contribute to the library’s growth.
Relations
Technologies
Backend and Frameworks:
- Python: Core programming language used for the project.
- Django: Web framework for building the application's backend, handling models, views, and forms.
- Django ORM: For database interactions and queries.
Frontend:
- HTML/CSS: For structuring and styling the web pages.
- Bootstrap: CSS framework for responsive design and UI components like the navbar and forms.
Database:
- SQLite: Default database used by Django for development/tests.
- PostgreSQL: Database for production.
Storage:
- Cloudinary: For managing and storing media files such as images.
User Authentication:
- Django's Authentication System: For handling user registration, login, and permissions.
Testing:
-
Django Test Framework: For unit and integration testing of models, views, and forms.
-
Unittest: Python's standard library for writing and running tests.
-
Visual Studio Code: Local IDE.
Tools and Utilities:
- Git: Version control system for tracking changes and collaborating.
- GitHub: Platform for hosting the project repository.
Deployment:
- Heroku: Cloud Deployment.
Others:
- Timezone and Date/Time Handling: Managing timezones and datetime objects for accurate timestamps.
- Coverage: Generate automated test reports.
Main used Libraries
- Django: The main web framework used to build your application.
- Django Rest Framework (DRF): for building APIs.
- Bootstrap: For frontend styling and responsive design.
- Pillow: For image handling in Django.
- Cloudinary: For storing and serving media files (images) in the cloud.
- Unittest: For writing and running tests in Django application.
- Django Messages Framework: For displaying flash messages to users.
- Django Paginator: For handling pagination in your views.
- PostgreSQL: As the database backend.
- Django Crispy Forms: To make Django forms more elegant and manageable.
- Gunicorn: As a Python WSGI HTTP Server for serving your application.
- Whitenoise: For serving static files in production.
- Django Storage: For managing storage in cloud environments.
Testing and Fixing Bugs
Debugging
-
For debugging the python code, print
statements were used together with debugging tools and console logs to help identify bugs, loops, and condition interactions.
Debugging Tools
Testing
Deployment
Github Forking
Heroku Deployment
- After creating the new app, you need to configure the settings.
- The first setting that needs to be done is to add your environment info to the platform so it will be able to access outside sources.
- Add the Buildpacks necessary to run the application, in this case, Python and Node.js in this sequence.
- After completing the settings, move to the deploy tab where you will configure the deployment setup.
- Connect your GitHub.
- Select your repository on GitHub.
- Connect to the repository.
- After all the settings above have been done, you can select to deploy automatically or manually.
- After pressing deploy, if all settings are correct, you should see it building the application.
- After all steps of deployment, a button labeled "View" will be shown, where you can click to open a new tab with the application.
Credits
Mentor: Harry Dhillon
Base template: Code Instutute: I Think Therefore I Blog
Book Covers: Created Using Canva
Book/Title Descriptions: Generated with ChatGPT