Skip to content

Shane-Donlon/ci-pp5-bobs-and-babs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

link to deployed site

Bob & Bab's e-commerce website

Bob & Babs website is a store that sells freshly baked goods in the Dublin Area. This lovely couple own a small bakery and are happy to keep it like that, with regular customers that always pop in for the "chat". They are looking to setup their first website to be an e-commerce store and if going well a Progressive Web App (to be implemented in the future)

Site goals:

  • Sell freshly baked goods to the Dublin Area
  • Provide delivery and collection services
  • Provide a user-friendly experience
  • Provide a secure payment system

Technologies used

  • Languages:

    • Python 3.11: the primary language used to develop the server-side of the website.

    • JS: the primary language used to develop interactive components of the website.

    • HTML: the markup language used to create the website.

    • CSS: the styling language used to style the website.

    • Frameworks and libraries:

    • Django: python framework used to create all the logic.

  • Databases:

    • SQLite: was used as a development database.
    • PostgreSQL: the database used to store all the data.
  • Other tools:

    • Git: the version control system used to manage the code.
    • Pip3: the package manager used to install the dependencies.
    • Gunicorn: the webserver used to run the website.
    • Spycopg2: the database driver used to connect to the database.
    • Django-allauth: the authentication library used to create the user accounts.
    • ElephantSQL: the cloud database used to store all the data.
    • GitHub: used to host the website's source code.
    • VSCode: the IDE used to develop the website.
    • Chrome DevTools: was used to debug the website.
    • W3C Validator: was used to validate HTML5 code for the website.
    • W3C CSS validator: was used to validate CSS code for the website.
    • JShint: was used to validate JS code for the website.
    • PEP8: was used to validate Python code for the website.
    • Cloudinary: used to store images uploaded to site.
    • django-tables2: used to provide responsive tables.
    • whitenoise: used to serve the static files
    • bootstrap css: used for table responsiveness
    • stripe: used to handle payments
    • AdobeXD: used to create wireframes
    • Photoshop: used to create assets
    • Heroku: used to host the website.
    • Page Speed Insights: used to check the website's performance.
    • Wave: used to check the website's accessibility.
    • Web Aim: used to check the website's accessibility.
    • Node.JS: used to create bespoke VSCode Extensions
    • Powershell: used to create githooks

Node.JS was used to create bespoke VSCode Extensions to improve my Developer Experience with Django. Django Custom Commands Extension was created to allow me to run Django Custom Commands from within VSCode.

Django Custom Commands Extension:

This allowed me to utilise Python to create and update Apps with ease. On new app creation the extension will automatically create the necessary files, and folders for the app. As well as migrate all the template tags from the base.html file into the current HTML file.

Code Snippet from Custom Extension

VSCode Extension input asking for app name VSCode Extension input appname testing VSCode Extension Files Created VSCode Extension Files HTML File input

The extension would also update the base urls.py file to include the new app's url. This would then update my settings.py file installed apps to include the new application This also allowed me to create custom commands to run from the terminal in VSCode, and adding keyboard shortcuts to run these commands.

As well as to automatically comment on closing divs, and section tags in html files using beautiful soup as the HTML parser.

Githooks:

Custom githooks were created for commit-msg and pre-push hooks The purpose of these hooks were to ensure that the commit message was in the correct format, and that I was informed of an attempt to push debug code, conosle.log(), print() statements appropriately.

Powershell was used to create the hooks, and the hooks were stored in the hooks folder in the root directory of the project.

error message for print statement used

Hooks Folder with sample hooks and commit-msg and pre-push hooks being used

commit-msg error

Tools:

  • Github
  • Githooks

Hosting:

Heroku

Features:

Homepage

Homepage of website

Shop

Shop page of website

Product It was important to route to this page as part of the add to cart option to ensure the allergin information is seen

Shop page of website Loading Spinner of website Add to cart success message Add to cart success message Add to cart failure message

Cart

Cart page of website

Checkout Page Delivery

checkout page of website delivery status

Checkout Page Collection

checkout page of website collection status

Order Success

checkout page of website collection status

Order Failure

checkout page of website collection status

Form Validation

form validation phone number error

form validation eircode error

Sign up

Sign-up page

Verify Email Page

Verify Email Received

Verify Email Site ID

Sign In

Sign in page

Profile Page Where "Prefilled" is the email address used to sign up (hidden for screenshots)

Profile Page

Profile Page success

Logout Page

Sign-out page

Customer Orders

Customer Orders Page

Order in progress page

Order Complete Delivery page

Order Complete Collection page

Admin Add Products

Admin Add products form Note product name was "test"

Admin Add products named test

Admin Add products added sucecss

Admin Update Products

Admin update products form Admin update products success

Admin Remove Products

Admin Delete products table Admin Delete products form Admin Delete products confirmation Admin Delete products success

Admin Order Fulfillment

Admin Orders table Admin Orders form page Admin Orders fulfilled success

Wireframes & Styling

Adobe XD Wireframes

Adobe XD Styles

Entity Relationship Diagram (ERD)

ERD Diagram

  • Order Items holds the indiviaul products per order
  • Shipping information holds all shipping information (which may or may not include a customer) The reason for this is to support unauthenticated users

Unauthenticated Users

This site supports purchases from unauthenticated users.

This is supported by creating and storing a session key This session key is stored in the 'users session', and is used to store the cart items for the user If the user starts unauthenticated then logs in or creates an account the order is transferred over to the customer order if a current order exists the items are added to the current order and the unauthenticated order is removed

The use of session keys also works along with closing browser or navigating away from the page

Please note this feature will not work in incognito mode as this clears the session key on browser exit

Improvements:

I would like to add the GDPR Banner for cookies, While all cookies are purely functional it is still a requirement to add this, also the fact that the site uses authentication is another reason to include this banner as Django uses session keys to track authenticated users

Python validation:

While the Python code has been validated an error persists on the validation tool This error is due to the fact that I'm using this to render a pattern in HTML using Django and Regex.

While this is invalid for python the code is valid HTML REGEX Pattern

Python validation error

Offending Code: This code is for Client Side Validation of Eircodes Not strictly needed, but this client-side validation was a struggle with Project 4 and wanted to implement again for Project 5. As I have more experience and wanted to re-visit some implementations from the past.

The regex is to allow 1231234 and 123 1234 to be accepted as eircode.

'pattern': '[A-Za-z0-9]{3}\s*[A-Za-z0-9]{4}'

CSS Validation:

I opted to use container queries in this project in order to gain a better understanding of them, this has led to some css validation issues with the validator the CSS used is valid, but the validator has not yet been upated to inspect this level 3 CSS

base.css file

CSS validation error

home.css file

CSS validation error

checkout.css file

CSS validation error

cart.css file

CSS validation error

All other css files are clear of errors

HTML Validation:

home.html

This error is from Adobe In-design product

HTML validation error

Under accessibility guidelines decorative images can either have a blank alt attribute or role presentation, this is for the grey svg on the homepage and is not an error, it's more that the context isn't checked

HTML validation error

sign up page

Error is from allauth templates this happened for Project 4 and I was unable to resolve this

HTML validation error

sign in page

Error is from allauth templates this happened for Project 4 and I was unable to resolve this

HTML validation error

profile update page

empty option is coming from Django loop street address autocomplete is valid for this context of using "Town"

HTML validation error

Page Speed Insights

Page Speed Insights

Page speed insights mobile Page speed insights desktop

Home page accessibility issues

When running Wave accessibility checker the contrast ratio appears to be incorrect, But when I manually check it in web aim everything passes.

Contrast Ratio Wave Contrast Ratio Web Aim

Wave accessibility is also incorrectly reporting that labels are missing from the newsletter form.

Deployment markdown Testing markdown

Business Page:

I would like to add more to this, but within hours the account was suspended

Facebook page for the store Facebook page suspended

Privacy Policy:

Privacy Policy for the site

Credits

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published