Giter VIP home page Giter VIP logo

ecabanasv / ci-pp5-ecommerce Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 10.26 MB

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.

Home Page: http://ecabanas-bookstore.herokuapp.com/

License: GNU General Public License v3.0

Python 47.28% HTML 45.90% CSS 4.97% JavaScript 1.84% Procfile 0.02%
authentication authorization bootstrap5 crispy-forms crud css django elephantsql forms git github heroku html5 javascript mvc-framework posgresql python regex routing templates

ci-pp5-ecommerce's People

Contributors

ecabanasv avatar

Watchers

 avatar  avatar  avatar

ci-pp5-ecommerce's Issues

USER STORY: Admin (Book)

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.

USER STORY: Sort Books

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.

USER STORY: View Order Confirmation

As a user, I want to view my order confirmation information after placing an order.

Acceptance Criteria:

  • The page should display the order number, order date, order details, delivery address, billing information, and order total information.
  • The page should include a link to return to the profile page (if logged in) or to the product list page (if not logged in).
  • The confirmation email should be sent to the email address associated with the order.

USER STORY: Admin (Orders)

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.

USER STORY: Book CRUD functionality

As an admin user who wants to manage books, I want a Book CRUD (Create, Read, Update, Delete) functionality.

Acceptance Criteria for admin:

  • I can add a new book to the system by filling out a form with the book details.
  • I can view a list of all the books in the system.
  • I can view the details of a specific book.
  • I can update the details of a specific book.
  • I can delete a book from the system.
  • The system provides appropriate messages after each operation (e.g. added, updated, removed).

USER STORY: Categories/Subcategories

As a user of the bookstore website, I want to browse books by category and subcategory so that I can easily find the books I am interested in.

Criteria Acceptance:

  • The website should display a list of categories, each representing a broad book genre.
  • The website should display a list of subcategories for each category, each representing a more specific type of book within that genre.
  • The website should display the number of books in each subcategory.
  • The website should allow users to browse books by category and subcategory.
  • The website should display the books in the selected subcategory when the user selects a subcategory.
  • If the user selects a category but does not select a subcategory, the website should display all books in that category.
  • If the user does not select a category, the website should display all books in all categories.
  • The website should display the current category and subcategory being viewed.

USER STORY: Search Books

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.

USER STORY: Contact fields validation

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.

USER STORY: Site Navigation

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.

USER STORY: Payment info details

As a user, I want to be able to enter my payment information so that I can complete my order.

Acceptance criteria:

  • The payment form should include fields for the user's name, email, phone number, street address, town/city, county, postcode, and country.
  • The form should include a checkbox allowing users to save their delivery information to their profile if logged in.
  • The form should include a section for payment details, including a Stripe card element and a button to submit the payment.
  • The form should display the total amount charged to the customer's card.
  • The form should display any errors during payment processing.
  • The form should include a button to allow the user to return to the cart to change their order.

USER STORY: View Shopping 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.

USER STORY: Login and Logout

As a user, I want to be able to log in and log out of my account so that I can access my account information and ensure the security of my account.

When the user is not logged in:

  • The login page should display a form for email and password inputs and a "Sign In" button.
  • The page should display a message asking the user to sign up first if they still need an account.
  • The page should have a link to the "Forgot Password" page.

When the user enters incorrect login credentials:

  • An error message informing the user that their credentials are incorrect should be displayed.

When the user enters the correct login credentials:

  • The user should be redirected to the home page.

When the user is logged in:

  • The user should be able to see a "Log out" button on the navigation bar.

When the user clicks on the "Log out" button:

  • If the user clicks the "Log out" button, they should be logged out and redirected to the home page.

USER STORY: Guest Checkout

As a guest user, I want to be able to checkout and purchase items without having to create an account.

Acceptance criteria:

  • The checkout page should allow guest users to fill out their billing and shipping information.
  • Guest users should be able to securely enter their credit card details.
  • After completing the checkout process, the user should receive an email confirmation of their purchase.
  • The order should be processed successfully and appear in the store's order management system.

USER STORY: Admin (Category)

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.

USER STORY: Password recovery

As a user who has forgotten their password, I want to be able to reset it so that I can regain access to my account.

Acceptance Criteria:

  • Users can access the password reset page
  • Users can enter the email address associated with their account
  • The user receives an email with a link to reset their password
  • Users can click on the link in the email and be redirected to a page to create a new password
  • Users can successfully create a new password and access their account

USER STORY: Toast messages

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.

USER STORY: Book list title

As a user, I want to see a descriptive title at the top of the book list page, so that I can quickly understand what I'm looking at.

Acceptance Criteria:

  • The title should change depending on the page's context, such as search results, category, or subcategory.
  • If a search term is provided, the title should indicate the number of search results found.
  • A button to add a new book should be displayed if the user is authenticated as a staff member.

USER STORY: Responsive book list layout

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.

USER STORY: Adjust Book Quantity

As a user, I want to be able to adjust the quantity of books in my shopping cart.

Acceptance Criteria:

  • The user can increase or decrease the book quantity in their cart using the +/- buttons.
  • The quantity input field only allows positive integers within the range of 1 to 99.
  • The +/- buttons are disabled when the quantity is at the minimum or maximum limits.
  • An error message is displayed if the user tries to increase the quantity beyond the book's stock limit.
  • The updated quantity is saved to the shopping cart when the user adjusts the quantity.

USER STORY: Profile - Order history

As a registered user, I want to view my order history on my profile page.

Acceptance Criteria:

  • When registered users navigate to their profile page, they can see a section for "Order History".
  • If the user has no order history, they see a message that says "No Orders Found".
  • If the user has an order history, they see a table that displays the order number, date, number of items, and order total for each order.
  • The order number is a clickable link that takes the user to the order detail page.
  • The order total is displayed in Euros.
  • The user can view the order history for their previous orders.

USER STORY: Book fields validation

As an admin, I want to ensure that all fields for the Book model are properly validated, so that the database contains accurate and reliable data.

Acceptance criteria:

  • The ISBN field should only accept valid ISBN-10 or ISBN-13 codes.
  • The price field should only accept positive decimal values up to 10000.
  • The stock field should only accept positive integer values up to 10000.
  • The rating field should only accept float values between 0 and 5.
  • The publication date field should only accept a valid date.
  • Pages field should only accept positive integer values up to 10000.
  • The language field should only accept alphabetic characters.

USER STORY: Book details

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.

USER STORY: Display current shopping cart

As a user, I want to view the current content of the shopping cart page when adding/removing books.

Acceptance Criteria:

  • The cart_items list must be displayed, showing the image, title, author, price, quantity, and total price for each book in the cart.
  • The total price of all books in the cart must be displayed.
  • The delivery fee (if any) must be displayed.
  • The total price plus delivery fee (if any) must be displayed as the grand total.
  • If the total price is less than the free delivery limit, the amount needed to be eligible for free delivery must be displayed.
  • The free delivery limit and the related percentage must be displayed.

USER STORY: Add books to shopping cart

As a user, I want to be able to add books to my shopping cart, so that I can purchase them later.

Acceptance Criteria:

  • The user can add a book to their cart by clicking the "Add to Cart" button on the book's detail page.
  • The user can specify the book quantity they want to add to their cart or leave it at the default value of 1.
  • If the selected quantity exceeds the available stock for the book, an error message will be displayed, and the book will not be added to the cart.
  • If the book is already in the cart, the quantity of the book in the cart will be updated.
  • If the book is not in the cart, it will be added with the specified quantity.
  • The user should be redirected to the previous page after adding the book to the cart.

USER STORY: Signup form

As a user who does not have an account, I want to be able to fill out a form to sign up for a new account.

Acceptance criteria:

  • The signup form should have fields for the user's email address, username, and password.
  • All form fields should have appropriate validation to prevent incorrect or incomplete input.
  • Upon submitting the form, a new user account should be created with the user's information.
  • If there are any errors in the form, the user should be notified of the error and prompted to correct it.

USER STORY: Admin (Publisher)

As an admin user, I want to be able to manage publishers in the system so that I can add, edit, or delete them as necessary.

Acceptance Criteria:

  • I can view a list of all existing publishers.
  • The list should display the name and description of each publisher.
  • I can search for publishers by name.
  • I can add new publishers by entering their names and description.
  • I can edit the name and description of existing publishers.
  • I can delete publishers.

USER STORY: Admin (Contact)

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.

USER STORY: Admin (SubCategory)

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.

USER STORY: Book list pagination

As a user, when I view the book list page, I want to be able to see a pagination section that allows me to navigate through the list of books.

Acceptance Criteria:

  • The pagination section should be displayed only when the total number of books in the list is greater than the number of books per page.
  • The pagination section should display links to the previous and next pages when applicable.
  • The pagination section should display page numbers with links to each page.
  • Clicking on a page number should take the user to the corresponding page.

USER STORY: Add/Remove favorite books

As a registered user, I want to be able to add books to my favourites list so that I can easily find and access them later.

Criteria:

  • The user must be logged in to add or remove books from their favourites list.
  • A success message should be displayed when users add a book to their favourite list.
  • A warning message should be displayed if the book is already in the user's favourite list.
  • An error message should be displayed when users remove a book from their favourite list.
  • After a book is added or removed from the favourites list, the user should be redirected to the previous page.
  • Registered users can see their favourite listview "My favourites" in the login navbar menu. If they are added, they can remove from the view.

USER STORY: Profile details

As a user, I want to view and update my profile details, so that my personal information is accurate and up-to-date.

Acceptance Criteria:

  • User can view their default delivery information
  • User can update their delivery information using a form
  • User can submit the updated information for their profile
  • User can see a success message upon submitting the updated information.

USER STORY: Cart summary of items

As a user, I want to view a summary of the items in my shopping cart so that I can review my order before proceeding to checkout.

Acceptance criteria:

  • When I navigate the shopping cart page, I should see a list of all the items I have added.
  • Each item in the list should display its title, image, price per unit, quantity, and total price.
  • The page should display the total cost of all items in my cart.
  • If my cart is empty, I should see a message indicating that my cart is empty.
  • The page should include a button to return to the book list if I want to continue shopping.
  • The page should include buttons to update the quantity or remove items from my cart.
  • The page should display the delivery fee, if applicable, and the free delivery threshold.
  • The page should display the grand total cost of my order, including any delivery fees.

USER STORY: Browse books

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.

USER STORY: Admin (Author)

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.

USER STORY: AJAX book search

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.

STORY USER: Mailchimp signup form

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.

STORY USER: Social media

As a user, I want to be able to access the company's social media profiles so that I can follow them and stay updated on their news and products.

Acceptance Criteria:

  • The social media links should be visible on the webpage.
  • Each link should lead to the corresponding social media page.
  • The links should be clickable.
  • The links should be styled and aligned properly on the webpage.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.