This repository contains the source code for a fictional online bookstore built with Django. It includes models for books, categories, subcategories, publishers, authors, and a contact form. The bookstore application allows users to browse, search, and purchase books, and includes an admin interface for managing book listings and user accounts.
As an admin user, I want to be able to view and manage the books in the system in the admin interface, so that I can keep the book inventory up to date.
Acceptance Criteria:
I can view a list of all books in the system in the admin interface.
I can search for books by ISBN, title, and author name in the list view.
I can filter books by category, subcategory, and publisher in the list view.
I can view the details of a specific book, including its ISBN, title, author, price, rating, stock, category, subcategory, and publisher, in the admin interface.
I can add new books to the system in the admin interface.
I can edit the details of an existing book in the system in the admin interface.
I can delete a book from the system in the admin interface.
As a user, I want to be able to sort books based on different criteria, such as title, price, and rating, so that I can easily find the book I am looking for.
Acceptance Criteria:
The sort dropdown menu should only be displayed if there is more than one book in the paginator.
The sort dropdown menu should have three options: "Title", "Price", and "Rating".
When the user clicks on a sorting option, the books displayed should be sorted according to the chosen option.
The selected sorting option should be displayed in the dropdown menu.
The currently selected sorting option should have an arrow icon indicating the sort direction (ascending or descending).
When the user clicks on a sorting option, the sort direction should be toggled between ascending and descending.
As an admin user, I can view and manage orders in the admin interface.
Acceptance Criteria:
I can view a list of all orders in the admin interface, sorted by date.
I can view the order number, date, full name, order total, delivery cost, and the grand total for each order.
I can click on the order to view its details, including the customer's name, email, phone number, shipping address, billing address, and a list of line items with quantities and prices.
I can update an order's status and other details if needed.
As a user, I want to be able to search for books based on their title, author name or ISBN so that I can quickly find the books I am interested in.
Acceptance Criteria:
The user should be able to see a search box on the book list page.
The search box should allow the user to enter a search term.
The search should be triggered when the user enters a search term, presses the "Search" button, or hits the Enter key.
The search should only return books whose title, author name or ISBN contain the search term (case insensitive).
The search results should be displayed on the same page as the search box.
The search results should be displayed paginated, with a maximum of 6 books per page.
The user should be able to navigate between pages of search results.
The user should be able to sort the search results by title, price or rating.
The user should be able to select a category or subcategory to filter the search results.
The search results should be updated using AJAX without requiring a page reload when the user enters a search term or selects a sort order, category or subcategory.
As an admin, I want to ensure that the fields of the Contact model are validated properly so that users can submit valid information through the contact form.
Acceptance criteria:
The name field should only allow letters and spaces and should be required.
The email field should only allow valid email addresses, and should be required.
The subject field should only allow letters, numbers, and common punctuation marks, and should be required.
The message field should not allow line breaks or tabs, and should be required.
Invalid submissions should not be saved to the database.
As a user of the online bookstore website, I want to be able to easily navigate to different sections of the website, so that I can find what I am looking for quickly and efficiently.
Acceptance Criteria:
The main navigation menu should be visible at the top of every page on the website.
The main navigation menu should include links to the Home page, Books page, About Us page, FAQs page, and Contact Us page.
The Books link in the main navigation menu should have a dropdown menu that displays a link to view all books and links to view books by category.
The mobile header should include a search bar that allows the user to search for books by title, author, or ISBN.
The mobile header should include a link to the user's account page and a link to view their cart, which should be hidden on larger screens.
The user's account dropdown menu should include links to their profile, favourites, and the ability to log out if they are logged in. If the user is an admin, there should also be a link to the admin panel.
The link to view the user's cart should display the total cost of the items in their cart.
As a user, I want to view my shopping cart with all the items I have added to it, along with their prices and quantities, so that I can review my purchases before checkout and make any necessary adjustments to my order.
Acceptance criteria:
The page displays a header with the text "Shopping Cart"
If the user has items in their cart, the page displays a table showing the cart contents with columns for item image, title, price per unit, quantity, total, and edit/delete buttons.
The table also displays the total cost of the cart and checkout buttons
The user can edit the quantity of items in their cart and see the updated total cost
The user can delete items from their cart and see the updated total cost
If the user has no items in their cart, the page displays a message saying "Your cart is empty" and a button to continue shopping.
As an admin user, I want to be able to view and manage the categories in the system in the admin interface, so that I can keep the category information up to date.
Acceptance Criteria:
I can view a list of all categories in the system in the admin interface.
I can search for categories by name and friendly name in the list view.
I can view the details of a specific category, including its name, friendly name, and description, in the admin interface.
I can add new categories to the system in the admin interface.
I can edit the details of an existing category in the system in the admin interface.
I can delete a category from the system in the admin interface.
As a user, I want to receive toast messages for certain events, such as adding or removing items from my favourites, creating or updating a book, or adding an item to my cart.
Toast messages should be displayed for certain user actions, such as adding or removing a book from favourites, creating a book, and adding a book to the cart.
Toast messages should also be displayed for other actions like login, logout, and errors produced.
The toast messages should provide clear information about the action taken and whether it was successful.
To make them easily distinguishable, different toast messages should have different colours and icons.
The toast messages should be responsive and work well on desktop and mobile devices.
As a user, I want to see a responsive book list layout that adjusts based on the number of books displayed, so that I can easily view and navigate the book list on different devices and screen sizes.
Acceptance Criteria:
The layout should adjust the number of columns and rows based on the number of books displayed.
The columns should have different widths for different breakpoints, and the number of rows should adjust accordingly.
The layout should be implemented using Django filters and Bootstrap classes.
As a user, I want to view the details of a specific book so that I can make an informed decision on whether to purchase the book or not.
Acceptance Criteria:
The book title, cover image, ISBN number, description, category, subcategory, author, publisher, publication date, number of pages, language, price, stock availability, and rating should be displayed.
If the user is authenticated and is staff, edit and delete buttons should be displayed.
If the user is authenticated, a heart icon should be displayed to allow them to add or remove the book from their favourites list.
A form should be displayed if the book is in stock to allow users to add it to their cart.
If the book is not in stock, a message should be displayed indicating that the book is not currently available.
The page should have a "Go Back" button to allow the user to return to the previous page.
As an admin user, I can manage the contact messages submitted by users in the website's contact form, so that I can respond to them or take necessary actions.
Acceptance Criteria:
I can view a list of all contact messages submitted by users.
I can see the ID, name, email, subject, and message for each contact message in the list.
I can click on a contact message's subject to view its details.
I can search for contact messages using the name, email, subject, or message fields.
The list of contact messages is paginated, with 25 messages per page.
As an admin user, I want to be able to view and manage the subcategories in the system in the admin interface, so that I can keep the subcategory information up to date.
Acceptance Criteria:
I can view a list of all subcategories in the system in the admin interface.
I can search for subcategories by name and friendly name in the list view.
I can filter subcategories by their parent category in the list view.
I can view the details of a specific subcategory, including its name, friendly name, description, and parent category, in the admin interface.
I can add new subcategories to the system in the admin interface.
I can edit the details of an existing subcategory in the system in the admin interface.
I can delete a subcategory from the system in the admin interface.
As a user, I want to browse through the list of books available on the website to find books that interest me.
Acceptance Criteria:
The list of books should be displayed in a responsive grid layout, with each book displayed in a card format.
Each card should display the book's cover image, title, author, a short description (for larger screens), price, rating, and action buttons.
The action buttons should allow the user to view more details about the book, add the book to their favourites, and add the book to their shopping cart (if the book is in stock).
The book list should be sorted by title, price, and rating in ascending or descending order.
The list of books should be filterable by category and subcategory.
The user should be able to search for books by title, author, or ISBN.
The user should be able to view a paginated list of books, with a default of 6 books per page.
As an admin user, I want to be able to view and manage the authors in the system in the admin interface, so that I can keep the author information up to date.
Acceptance Criteria:
I can view a list of all authors in the system in the admin interface.
I can search for authors by name in the list view.
I can view the details of a specific author, including its name and description, in the admin interface.
I can add new authors to the system in the admin interface.
I can edit the details of an existing author in the system in the admin interface.
I can delete an author from the system in the admin interface.
As a user, I want to be able to search for books on the website using AJAX so that I can quickly find the book I am looking for without having to reload the page.
Acceptance Criteria:
The user input in the search field should trigger the search functionality.
The book list should be cleared if the search input is empty.
The book search should be performed using an AJAX GET request to the URL for the book search view.
The response from the search request should be parsed as JSON, and the first five books should be displayed in a list.
If more than five books match the search term, a "Show more..." link should be displayed at the bottom of the list.
The "Show more..." link should direct the user to the book list view with the search term as a query parameter.
As a user, I want to be able to subscribe to a monthly newsletter through a signup form, so that I can stay up to date with the latest news and updates from the website.
Acceptance criteria:
The form must have a user's email address field.
The user must be able to submit the form to subscribe to the newsletter.
The form must be visually appealing and user-friendly.
The form must be connected to the website's Mailchimp account to ensure successful subscriptions.