KidLit Swap, derived from Kids' Literature Swap, is a vibrant online community where parents unite to share and exchange children's books.
Originating from conversations among parents at my kids' school, it serves as a virtual clubhouse celebrating the enchantment of storytelling in the digital era. Our initial concept involves gathering every first Saturday of the month at the school to kick off our tradition of swapping children's books. Soon, I plan to introduce a feature where the book's owner will be notified about a loan request and can coordinate a convenient location and time for both parties.
KidLit Swap's purpose is clear – to encourage the sharing and borrowing of kids' literature, fostering a love for reading in young minds. You can share your favorite stories, borrow books from others, and be part of our growing library. It's a fun way to help your kids become great readers.
Join KidLit Swap and let's make reading magical for our little ones!
The KidLit Swap project was developed with the following goals in mind:
Create Account & Log In: Easily set up an account and log in to access KidLit Swap's vibrant community.
Add Books: Share your favorite children's books by adding them to our virtual library.
Check Book Details: Explore detailed information about each book to find the perfect story for your child.
Borrow Books: Borrow books from other parents, promoting a sense of community and sharing.
Select Return Date: Choose a return date that suits you, making the borrowing process flexible and convenient.
Return Borrowed Books: Easily return the books you've borrowed, ensuring a smooth exchange process.
Log Out: Safely log out when you're done, knowing your account is secure.
KidLit Swap aims to create a welcoming space for parents to share children's books, fostering a love for reading, and simplifying the process of swapping stories to make it both enjoyable and easy.
KidLit Swap is designed to cater to the following target audience:
Parents and Families: Looking for an easy way to share and borrow children's books.
Kids' Book Fans: Those who love children's literature and want to be part of a sharing community.
Story Lovers: People who enjoy stories and want to make reading fun for kids.
Community-minded Individuals: Anyone who likes connecting with others, sharing stories, and being part of a cheerful community focused on children's books.
User Requirements: KidLit Swap caters to users who seek a straightforward platform to effortlessly share and borrow children's books. Whether parents, kids' book enthusiasts, or community-minded individuals, the requirement is a love for children's literature and a desire to be part of a collaborative reading space.
User Expectations: Users can anticipate a user-friendly platform that simplifies the process of sharing and borrowing children's books. The interface is designed to be intuitive, making book exchange enjoyable and stress-free. Expect a welcoming community and a growing library of diverse children's literature, fostering a love for reading in a fun and engaging way.
As a first-time visitor to KidLit Swap, I aim to:
Understand KidLit Swap's purpose: Learn how to navigate the platform, create an account, and add books.
Explore diverse book categories: Find and choose books that align with your children's interests or personal preferences.
Experience a user-friendly interface: Engage with an intuitive and interactive platform that simplifies the process of sharing and borrowing children's books.
As a returning visitor to KidLit Swap, I aim to:
Easily log in to my account and access my added books, borrow new books, and check the status of my borrowed books.
Discover newly added books or categories since my last visit, enhancing my book-sharing experience.
Explore and contribute to the growing community by adding more books, fostering a collaborative space for children's literature enthusiasts.
As a frequent visitor to KidLit Swap, my goals include:
Seamlessly navigate the platform, utilizing advanced features for efficient book sharing and borrowing.
Regularly contribute to the community by adding new books, and fostering a dynamic exchange of children's literature.
KidLit Swap aims to provide an accessible and engaging platform where users can seamlessly explore, share, and connect over a diverse collection of children's books. The development process will be guided by several EPIC stories, each addressing specific aspects of the platform. Key features will include:
EPIC - Mentor Sessions: Code Institute PP4
EPIC: User Experience (UX) Design
EPIC: Future Features This milestone centers on the ongoing enhancement and maintenance of KidLit Swap, specifically prioritizing the integration of upcoming features. Some user stories have been excluded from the current project scope due to time constraints and have been labeled as "Won't Have" on the GitHub project board. The intention is to implement these user stories at a later date.
KidLit Swap's design is intentionally crafted to be simple and clean, ensuring a user-friendly virtual library for sharing children's books and creating an enjoyable experience.
The color scheme for KidLit Swap features lively shades of green, blue, and red, creating a vibrant and playful atmosphere for the children's literature-sharing website.
In my CSS file, I employed variables to define colors and consistently applied them across the entire stylesheet. It enables easy color updates throughout the website by modifying the color once in the variable, maintaining consistency across the design.
Great care was taken to establish a good contrast between background colors and text at all times to ensure maximum user accessibility, confirmed through the WebAIM Contrast Checker.
The color palette was generated using the Coolors website.
The images utilized in KidLit Swap were generated by Lexica Art and sourced from Oxford Owl. Additionally, users will be able to upload their own images for their respective books. Moreover, I created the logo using Canva. Credits for the images can be found in the "Credits" section.
In KidLit Swap, the following fonts, obtained from Google Fonts, were carefully chosen to enhance the overall visual appeal:
These font choices, with a focus on being kid-friendly and playful, aim to create a visually appealing and enjoyable interface for users engaging with KidLit Swap.
I utilized Balsamiq to design the wireframes for the website.
GitHub Projects was utilized to facilitate the development process following an agile methodology. You can refer to the project board through this link.
The 7 Epics mentioned earlier were documented as Milestones within the GitHub project. Each User Story was represented by a GitHub Issue, which was subsequently assigned to a milestone (Epic). Clear acceptance criteria were defined for each User Story to indicate when it is considered complete. Furthermore, these acceptance criteria were detailed into tasks, streamlining the execution of each User Story.
The data model for the KidLit Swap project follows principles of Object-Oriented Programming and leverages Django’s Class-Based Generic Views. Django AllAuth is employed for the user authentication system.
To enable users to contribute to the community, a custom Book model was implemented. Each book entry includes details such as title, author, description, image, and category. The 'added_by' field links to the User model, ensuring that each book has a dedicated owner.
Additionally, the project incorporates features such as borrowing and returning books. The Book model includes fields for 'status,' 'borrower,' and 'return_date,' facilitating a streamlined book borrowing system. Users can view their borrowed books and manage their book inventory through dedicated views.
The database schema is structured to provide a robust foundation for the KidLit Swap platform:
In the KidLit Swap project, robust user authentication and security features have been implemented to ensure a secure and reliable user experience.
In KidLit Swap, I've implemented robust security measures for user authentication.
LoginRequiredMixin: Employing Django's LoginRequiredMixin
, any attempt by non-authenticated users to access secure pages results in an automatic redirection to the login page. This ensures that sensitive sections of the application are accessible only to authenticated users.
UserPassesTestMixin: To finely control access based on specific permissions, I utilize Django's UserPassesTestMixin
. For example, users can only perform actions like adding books, borrowing books, or returning books if they meet certain criteria. If a user fails these tests, a clear HTTP 403 Forbidden error is displayed, maintaining a secure environment.
I've implemented thorough form validation mechanisms to enhance data integrity.
My approach to database security prioritizes confidentiality and protection against unauthorized access.
KidLit Swap employs CSRF tokens on all forms throughout the site, providing an additional layer of defense against cross-site request forgery attacks.
Custom Error Pages were created to give the user more information on the error and to provide them with buttons to guide them back to the site.
The website features a favicon that is visible in the browser tab.
Logo
Navigation Bar
The navigation bar is consistently located at the top of each page, providing easy access to various sections.
For Users Not Logged In:
For users who are not logged in, navigation options include 'Home,' 'Books,' and 'My Account.'
The 'My Account' link expands into a dropdown menu offering 'Sign up' and 'Log in' choices.
For Logged-In Users:
Upon logging in, the navigation options expand to 'Home,' 'Books,' 'Manage Books,' and 'User's name with a profile icon.'
'Manage Books' features a dropdown menu with 'My Books,' 'Borrowed Books,' and 'Add Book' options.
'User's name with a profile icon' includes a dropdown with 'Profile' and 'Log out' choices. Sign-up or Log-in options change to 'Log out' after user login.
The navigation bar is fully responsive, transitioning into a hamburger menu on smaller screens.
Hovering over links triggers a color change to blue accompanied by a zoom effect.
Moreover, when 'Home' and 'Books' are active, they will be highlighted as light blue rounded boxes for visual emphasis.
The home page features a hero call-to-action with the title 'KidLit Swap: Exchange the Magic of Kids' Literature' and an animated jumping image.
The 'About' section provides a concise overview of the site's offerings, summarizing key features through three simple steps accompanied by Font Awesome icons.
The Book List page in this project showcases an organized collection of books, arranged alphabetically, with a priority on available books.
Pagination breaks down the book cards into sets of eight for user-friendly navigation.
Each card provides key details such as the book's image, title, author, status (available or borrowed), and the book's owner (added by).
A simple click anywhere on a book card directs users to the detailed page for that specific book.
Located at the top left is a category box, offering users the convenience of selecting a category and being redirected to a dedicated page for filtered book results.
Towards the bottom of the page, an engaging section encourages users to actively participate in the community by adding more books. If a user is logged in, a personalized greeting saying 'Hello username! Do you want to add a book to our library?' is prominently displayed. This makes it easier for users and encourages them to be a part of the community.
The Book Details page displays comprehensive information about the book, including title, author, description, category, status, and the owner of the book (added by).
Additionally, the page features four types of messages in the bottom corner:
If the user is not logged in and the status is Available, a prompt will appear: "Do you want to borrow this book?" along with a Log In button to redirect the user to the log in page.
If the logged-in user is the owner of the book (added by) and the status is Available, a message will express gratitude for sharing the book ("Thank you for sharing your book on KidLit Swap!").
If the logged-in user is not the owner of the book and the status is Available, a "Borrow This Book" button will appear.
Clicking this button redirects the user to a modal for confirming borrowing details, including selecting a return date. Upon confirmation, the book's status changes from Available to Borrowed, and the message updates accordingly.
If the logged-in user has borrowed the book, the message will state, "This book is currently borrowed by [username] and is expected to be returned on [date selected in the modal]."
Finally, there is a button labeled "Back to Book List" to redirect the user back to the Book List page.
The My Books page can be accessed within the "Manage Books" dropdown, available only to logged-in users.
Initially, my project aimed to include both "Added Books" and "Borrowed Books" on the same page. However, as users added more books, the page became cluttered, impacting user experience. Throughout the project, I chose to use large cards with prominent images, given the child-oriented nature of the site. Consequently, I decided to separate the sections.
The My Books page now displays all books added by the logged-in user, featuring three buttons with associated Font Awesome icons: "View Details," "Edit," and "Delete."
Clicking "View Details":
Clicking "Edit":
Clicking "Delete":
When the book status is available, redirects the user to the "Delete Book" page. A red alert message prompts the user to confirm the deletion: "Are you sure you want to delete the book 'TITLE OF THE BOOK'?"
The page includes buttons with Font Awesome icons: "Delete" and "Cancel." Clicking "Delete" removes the book from the database, while clicking "Cancel" redirects the user to the "My Books" page.
If the book is borrowed, attempting to delete will display an error message: "You cannot delete this book because it is borrowed to {username}."
The Borrowed Books page is personalized for each logged-in user, displaying the borrowed books.
The information presented includes the book title, the owner of the book (added by), and the return date (previously selected by the logged user in the modal).
At the bottom of each card, there is a "Return Book" button with its respective Font Awesome icon.
Upon clicking, a success message appears at the top of the page, stating "You have successfully returned the book 'TITLE OF THE BOOK'."
Additionally, the book will be removed from the "Borrowed Books" section, and its status will be changed from "Borrowed" back to "Available."
The Add Book page presents a form for users to contribute a new book to KidLit Swap.
The required fields include title, author, and description, while image and category are optional.
If the user wishes to add a new image, they can choose one from their files, which will be stored on Cloudinary. In the absence of a user-selected image, a default image, created by me and featuring the title "KidLit Swap," will be displayed.
Regarding the category, users can pick from a dropdown menu containing previously added categories or introduce a new one by filling in the "Do you want to add a new category?" field. If no category is selected, the default category will be set to "None."
Clicking the "Add Book" button will insert the book into the Book List.
The profile page consists of three sections:
Welcome, username!
Books Added: Displays a message "You've added x books to the library," where x represents the number of books the user has added to KidLit Swap. Additionally, there is a "View My Books" button that redirects the user to the "My Books" page.
Books Borrowed: Displays a message "You've borrowed x books," where x represents the number of books the user has borrowed from other users. There is also a "View Borrowed Books" button that redirects the user to the "Borrowed Books" page.
As mentioned earlier, Custom Error Pages were designed to offer users additional information about the error and provide them with buttons for navigating back to the site.
400 Bad Request:
403 Forbidden:
404 Not Found:
500 Internal Server Error:
As mentioned earlier in EPIC: Future Features, certain user stories have been omitted from the current project due to time constraints. They are marked as "Won't Have" on the GitHub project board with plans for future implementation.
In addition to the user stories outlined in the "Future Features," I also plan to implement two additional features in the future:
Develop an alert system to notify the owner of a book (added by) when someone requests to borrow the book and suggest a loan date. This way, the owner can approve or reject the loan, provide details about the book's pickup location, and the response will be sent back to the logged-in user.
Create a search bar to allow users to easily locate a book in the Book List.
Please refer to TESTING.md file for a comprehensive overview of all conducted testing procedures.
The website has been successfully deployed on Heroku. You can access the live site here.
To create a terminal-based user interface using the Code Institute Template:
GitHub Setup
Heroku Setup
Attach the Postgres database:
Prepare the environment and settings.py file:
Create files / directories
Update Heroku Config Vars Add the following Config Vars in Heroku:
Deploy
The site is now live and operational.
To fork the repository:
To clone the repository:
I would like to express my gratitude to the following individuals who played significant roles in the successful completion of my fourth project: