Skip to content

A fictitious e-commerce for geophysical data to show the use of different languages and technologies. Built with Django, HTML, CSS, JavaScript and Python.

Notifications You must be signed in to change notification settings

csc7/PP5_CI_GDEC

Repository files navigation

GDEC - Geophysical Data E-Commerce (Site Under Construction)

This project is about an e-commerce for geophysical data. It is a FICTITIOUS SITE where the user will be able to buy geophysical data that comprises digital elevation models, gravimetry, resistivity and magnetometry data; along with training, books and software products. Data and products are FICTITIOUS. The project is part of the Code Institute Full-Stack Software Development program.


Index



1 . E-commerce Project Goals

The goal of the project is to develop an e-commerce for geophysical data, where users can find and buy digital elevation models, gravimetry, resistivity and magnetometry data; along with reports, training (courses and books) and software products. In addition, users can register in the site to track their purchases, contact the site owner and/or developer (also available without having an account), navigate to social network sites of the e-commerce, filter and search products, store them in a wish list, comment them, and pay them using Stripe's payment processing platform.

In addition, it is expected to provide a proper management for the site owner, registering order information and history, and administrating tasks like product updates and interaction with users.




2 . Considerations

If opening the project with Gitpod from GitHub (top right green button), please run the following command as new workspaces need to have their dependencies: pip3 install -r requirements.txt

Please keep in mind that the interaction with the database and corresponding display of data is slow, it might take several seconds until the data is displayed.

Generation of the products of the site

As stated at the beginning, the site is a fictitious e-commerce. To generate the products, the Natural Earth quick start kit" (50m raster) was downloaded from Natural Earth's website https://www.naturalearthdata.com/downloads/. This kit contains a planisphere from where QGIS was used to filter it by countries, by running the file "products_database_generation_for_QGIS.py" (in the "/tools" folder in the project root directory) in the Python console of QGIS.

Once all countries were filtered, different scale colours were applied for them, one for each category (digital elevation models, gravimetry, resistivity and magnetometry data), to simulate different products. To simulate some "randomness" of the products, some products were randomly deleted (this way, not all countries have the same products).

Then, free images were downloaded from Pexels (please see Credit section for details) and assigned to the remaining products of the e-commerce (reports, training courses, training books and software products).

A Python file was created to build CSV and JSON structures for the Products and Category models (with fields matching their fields, including the name and URL of the images). This file, "build_csv_and_json.py" (in the "/tools" folder in the project root directory), saves the CSV file in the same "/tools" folder and the JSON file in the "/fixtures" folder of the products Django app.

The file build_csc_and_json.py must run in the project "/media" folder, with this folder containing only the images, and with image names starting with the following names: digital elevation models, gravimetry, resistivity and/or magnetometry (otherwise the program will not work, as it would be reading other file names and therefore the "if" statements should be modified). Run it before adding other files to the "/media" folder, or change the name of the folder in the Python file, or modify the "if" statements to read other names.

Since the generated JSON file is already in the "/fixtures" folder, the data can then be loaded into the Django models using the following commands (in this order, since the products are related to categories and therefore the latter must be defined before):

python3 manage.py loaddata categories

python3 manage.py loaddata products




3 . Project Board

A project board was created in GitHub to help on the planning and follow-up of the work when developing the site; it can be observed here (https://github.com/csc7/PP5_CI_GDEC/projects/1).

In addition, issues can directly be found here (https://github.com/csc7/PP5_CI_GDEC/issues)




4 . User Experience

UX has been addressed around Jesse James Garrett's process and its five planes:

  • STRATEGY: to develop an e-commerce website (product) that makes purchasing of geophysical data simple and intuitive.
  • SCOPE: the minimum viable product needs to include features that allow the user to know the following:
    • Home page that acts as staring point and welcome page for the site.
    • A main navigation menu where, along with a footer, gives access to the main parts of the website, including registration and sign-in for users.
    • Images and the products with their associated price for purchasing.
    • A method to pay the products, for instance, stripe.
    • A database that accounts for all the data in the website and allows interaction of the users with the products (purchase) and their accounts.
  • STRUCTURE: the information is structured as follows:
    • Home page (act as welcome page).
    • Fixed navigation bar on top that allows searching and filtering products for display and buy.
    • A page showing the selected or filtered products.
    • A page for details of a specific product when selected, giving the option to buy and comment it.
    • A bag page with selected products to buy.
    • A wish list page.
    • A checkout page showing the products the user is about to buy, with the final price to pay, linking with the payment method (e.g., Stripe).
    • Footer, showing the main structure of the website and giving access to the social networks of the e-commerce and a field for the user to sign up in the newsletter of the e-commerce (to help on marketing), a contact form, contact information, and general data protection regulation requirements.
    • A profile page, including the option to show the purchase history of the user.
    • Contact form page.
    • Pop-up messages informing the interaction of the user with the website (purchase, sign in, sign out, sign up, errors and success messages as the main ones).
    • Sign-in page.
    • Sign-up page.
    • Sign-out page.
    • 404 page to let the user know of any error while loading the site.
  • SKELETON: the information and products are accessed through a fixed navigation menu on top of the pages and a footer.
  • SURFACE: the website is based on a contrast of different tonalities of blue for the header and footer, light blue for body, and fonts in strong dark blue; with red banners (the top one including advertising messages) separating the fixed navigation menu, the body and the footer.

User Goals

  • To easily find and buy products (geophysical data, and training and software products).
  • To find an interactive website.
  • To navigate through a responsive website.
  • To have the website accessible at all times through a fixed navigation menu and a footer.
  • To have an account on the website for future purchases or review of past purchases, giving the change to store personal data.
  • To be able to contact the site administrator, owner and/or developer if desired.
  • To be informed of the events created when navigating the website as soon as they happen.

Site Owner Goals

  • To sell geophysical data, and training and software products.
  • To promote different products.
  • To have the website helping on the marketing of the e-commerce (e.g., linking to contact information and options, social networks, and giving the option to sign up for a newsletter).
  • To capture clients.
  • To increase the number of users interested in and buying geophysical data, and training and software products.
  • To provide an interactive website.
  • To provide a responsive website.
  • To give users the chance to contact the site administrator, owner and/or developer.

Developer Goals

  • To provide a scalable e-commerce website to show my current development capabilities.

User Stories

User stories are divided into the following three groups:

  • First time users

  1. As a user, I want to find a well-organized and simple site, so I immediately get the whole picture of the site.
  2. As a user, I want to find a responsive site, so I can easily navigate in it in different devices.
  3. As a user, I want to receive a confirmation of registration when I sign up, so I know that the process for creating my account went well.
  4. As a user, I want to be able to contact the site administrator, owner and/or developer, so I can send feedback to them.
  5. As a user, I want to have access to my account easily, so I can quickly sign in.
  • Returning users

  1. As a returning user, I want to be able to contact the site administrator and/or owner and/or developer, so I can send feedback to them.
  2. As a returning user, I want a navigation menu on top, always visible, so I can access the main content on the website from there and do not need to use the back button of the browser.
  3. As a returning user, I want to have access to my account easily, so I can quickly sign in.
  4. As a returning user, I want to have a way to contact the developer so I can contribute and/or indicate errors or bugs.
  5. As a returning user, I want to be informed if the contact form goes through, so I know if my message is being sent or it is not.
  6. As a returning user, I want to recover my password easily if I forget it, so I do not worry about remembering and/or keeping it.
  7. As a returning user, I want to have a history of my purchases, so I know what I have bought and spent through time.
  • Shoppers

  1. As a shopper, I want to have the products to buy visible (without many details so I can see more), so I can select them for purchase.
  2. As a shopper, I want to have access to the product details, so I can access them in case I am not sure about the purchase and/or want to have a better description of the product.
  3. As a shopper, I want to have a detailed view of my shopping cart, so I know what I am buying and have the current purchase details just before paying.
  4. As a shopper, I want to have the amount I am spending always visible, so I know how much I am spending.
  5. As a shopper, I want to have special offers easily accessible, so I can buy them before they disappear if I find them useful.
  6. As a shopper, I want to have a search field, so I do not spend much time finding the product I want to buy
  7. As a shopper, I want to have categories of products, so I find a product easily if I do not know its name.
  8. As a shopper, I want to have prices always visible, so I know the value of the products at all times.
  9. As a shopper, I want to have the different resolutions of the products visible, close to the product it belongs to, so I can easily select it without further action.
  10. As a shopper, I want to have a secure payment method, so I can rest assured that the purchase procedure is safe.
  • Site Owner

  1. As owner, I want to provide an introductory page, so users know what can be found on the website and what can be purchased.
  2. As owner, I want to provide an easy process for registration, so I ensure a connection with a potential buyer.
  3. As owner, I want to provide a search field for products on top, so I require users/shoppers the minimum possible time to find a product (and therefore reduce the risk of leaving).
  4. As owner, I want to organize products in categories, so users find an organized site and can find products easily.
  5. As owner, I want to receive feedback from users, so I can take actions in response to them if needed.
  6. As owner, I want to provide a navigation menu on top and always visible, so users can access any content at any time without needing the back button.
  7. As owner, I want to give as many options to be contacted as possible, so users can choose forms or links in the footer to send their consultations and/or feedback in a very fast way.
  8. As owner, I want to provide a responsive website, so user can access it from any device without any constraint to navigate, find and/or use the website.
  9. As owner, I want to inform users if their consultation/message was successfully sent, so they know if they need to resend it or they do not.
  10. As owner, I want to inform the user, through an error page, if there is any error when loading the website.
  • Developer

  1. As developer, along with other points of this section, I want to show my work and give the option to users to contact me if they wish.

User Requirements and Expectations

  • A home page.
  • A responsive navigation throughout the website.
  • A fixed navigation top that allows searching and filtering products for display and buy.
  • A page showing the selected or filtered products.
  • A page for details of a specific product when selected, giving the option to buy it.
  • A bag page with selected products to buy.
  • A wish list page storing products for a later purchase.
  • A checkout page, showing the final price to pay and linking with the payment method (e.g., Stripe).
  • A Footer, showing the main structure of the website and giving access to the social networks of the e-commerce and a field for the user to sign up in the newsletter of the e-commerce (to help on marketing), a contact form, contact information, and general data protection regulation requirements.
  • A profile page with purchase history.
  • A contact form.
  • Pop-up messages informing the interaction of the user with the website.
  • A Sign-in page.
  • A Sign-up page.
  • A Sign-out page.
  • A 404 page.




5 . Data Model

The e-commerce business model underlying the application is designed in such a way that a "user" (who is uniquely identified by ID) can buy "products" (that are also uniquely identified by ID and SKU) by sending a "order" (that is uniquely identified by ID and order number). Then, since an order can have many products, and simultaneously a product can be requested by many orders, an "order line item" is created to uniquely relate a specific product to a specific order. This "order line item" divides the many-to-many relation between "order" and "product" in two one-to-many relations ("order-order line item" and "order line item-product"). "Product comments" can be added (related) to each product and to the user who comments

Then, a "category" is created and related to the type of product in order to help on the search of them.

Additionally, a "wish list" allows users to store products for a later purchase.

Finally, a "contact" model is created, unrelated to the previous tables, to contact the site owner in any case, regardless of an order being issued or not being a user.

The project database is built with PostgreSQL and deployed in Heroku platform. Its tables or models are built with Django models and follows the models given by the Code Institute "I Think Therefore I Blog" project. The following chart shows the tables and data involved, and how they are related:

Data Model Image Chart created with ERDPlus (https://erdplus.com/standalone).

The following are the tables involved in the relational model and the field types in each of them.

  • ORDER
    • ID: integer, primary key
    • Order Number: char
    • User Profile: integer, foreign key
    • Full Name: char
    • E-mail: e-mail
    • Phone Number: char
    • Country: country
    • Postcode: char
    • Town or City: char
    • Street Address 1: char
    • Street Address 2: char
    • County: char
    • Date: date
    • Delivery Cost: decimal
    • Discount: decimal
    • Order Total: decimal
    • Grand Total: decimal
    • Original Bag: text
    • Stripe PID: char
  • ORDER LINE ITEM
    • ID: integer, primary key
    • Order: integer, foreign key
    • Product: integer, foreign key
    • Product Resolution: char
    • Quantity: integer
    • Line Item Total: decimal
  • CONTACT FORM
    • ID: integer, primary key
    • Date: date
    • Time: custom (time)
    • Full Name: char
    • E-mail: e-mail
    • Description: char
  • CATEGORY
    • ID: integer, primary key
    • Name: char
    • Friendly Name: char
  • PRODUCT
    • ID: integer, primary key
    • Category: integer, foreign key
    • SKU: char
    • Name: char
    • Description: text
    • Price: decimal
    • Resolution: Boolean
    • Rating: decimal
    • Image URL: URL
    • Image Name: image
  • PRODUCT COMMENT
    • ID: integer, primary key
    • User: integer, foreign key
    • Product: integer, foreign key
    • Product Rating Value: integer, foreign key
    • Body: text
    • Created On: date
    • Active: Boolean
  • USER PROFILE
    • ID: integer, primary key
    • User: char
    • Default Phone Number: char
    • Default Street Address 1: char
    • Default Street Address 2: char
    • Default Town or City: char
    • Default County: char
    • Default Postcode: char
    • Default Country: char
  • WISH LIST
    • ID: integer, primary key
    • User Profile: integer, foreign key
    • Product: integer, foreign key
    • Product Resolution: char
    • Quantity: integer
    • Line Item Total: decimal




6 . Design Choices

The design was planned to cover screen sizes from 320x568px to 1920x1370px.

Colours

Colours are based on different tonalities of blue for header (fixed navigation menu) and footer, contrasting with a white background for the body (where products and all other content appear). The header (fixed navigation menu) and body, as well as body and footer, are separated by a red banner (the top one containing moving messages with white fonts).

Fonts

Google fonts (please see credits section below) were implemented on the website; Play (Regular 400 and Bold 700) and Roboto (Regular 400). Play is used for the body; Sans-serif font is used as a back-up in case the previous font cannot be loaded.

Structure

The website consists of a header with fixed navigation menu on top, a body and a footer. It is designed to navigate the e-commerce from the header and footer, having them always available. The header is fixed, while the footer is fixed only for screens whose width is greater than 992px, so it does not use space from the body in smaller screen sizes. There are two banners separating the header and body, and the body and footer. The one below the header contains moving messages to advertise special features of the e-commerce at all times.

The metadata in the head tag of the base HTML includes the following keywords to help search engines to find the website: "DEM books, DEM data, DEM software, DEM training, Geophysical data, Buy DEM data, Geophysical book, Buy Resistivity data, Gravimetry data, Buy Gravimetry data, Resistivity books, Buy Magnetometry data, Magnetometry software, Gravimetry books, Buy geophysical data, Magnetometry books, DEM, Geophysical, Code Institute, software development, and full-stack course, milestone project".

The metadata also includes the following description: "Code Institute Student Milestone Project 5, an e-commerce application that sells digital elevation models, gravimetry, magnetometry and resistivity data; along with training, books and software for data acquisition and processing".

Wireframes were developed at the beginning of the project to have a first structure of the e-commerce site and analyse eventual changes. Please see section 7, Wireframes, for images about these wireframes.

  • Header

In order to achieve the goals related to an easy navigation and finding of products, a fixed navigation menu in the header is implemented, which also contributes on accessibility to the main parts of the e-commerce and on responsiveness. In the same area. The logo of the e-commerce is placed to the left, in the middle there are a search field on top and the navigation menu below, and on the right two icons can be found that link to the account sign-in/sign-up/sign-out and bag.

  • Top banner

It is a thin section (height of 25px), from side to side of the screen, in red colour, that separates the header/fixed navigation menu on top from the body. It contains moving messages to advertise special features of the e-commerce at all times.

  • Body

The products are displayed in this area, from where the products details can be accessed by clicking on the product itself and displayed in the same body.

The body also holds the pages for the bag, the checkout, the success checkout, sign-in, sign-up, sign-out, profile, contact form and 404 pages.

  • Top banner

It is another thin section (height of 25px), from side to side of the screen, in red colour, that separates the body from the footer.

  • Footer

The footer contains links contact information of the e-commerce on the left (below the e-commerce logo), a contact form, social media links, links to product categories, links to account sign-in/sign-up/sign-out, General Data Protection Regulation (GDPR) information about the privacy policy and cookies, and an area on the right to sign up for the e-commerce newsletter.




7 . Wireframes

Wireframes were developed in order to gather goals, user stories, requirements and expectations, and have the design references for desktop, tablet and mobile devices.

Please check the image files for each case in the following links:

Desktop Wireframe Image for Home Page

Desktop Wireframe Image for Home App/Page

Desktop Wireframe Image for Products Page

Desktop Wireframe Image for Products Page

Desktop Wireframe Image for Product Details Page

Desktop Wireframe Image for Product Details Page

Desktop Wireframe Image for Profile Page

Desktop Wireframe Image for Profile App/Page

Desktop Wireframe Image for Wish List Page

Desktop Wireframe Image for Wish List App/Page

Desktop Wireframe Image for Bag Page

Desktop Wireframe Image for Bag App/Page

Desktop Wireframe Image for Checkout Page

Desktop Wireframe Image for Checkout App/Page

Desktop Wireframe Image for Success Checkout Page

Desktop Wireframe Image for Success Checkout App/Page

Desktop Wireframe Image for Contact Page

Desktop Wireframe Image for Contact App/Page

Desktop Wireframe Image for Thank You Page

Desktop Wireframe Image for Thank You Page

Desktop Wireframe Image for Add Product Page

Desktop Wireframe Image for Add Product Page

Desktop Wireframe Image for Edit Product Page

Desktop Wireframe Image for Edit Product Page

Desktop Wireframe Image for 404 Page

Desktop Wireframe Image for 404 Page


Tablet Wireframe Image for Home Page

Tablet Wireframe Image for Home Page

Tablet Wireframe Image for Products Page

Tablet Wireframe Image for Products Page

Tablet Wireframe Image for Product Details Page

Tablet Wireframe Image for Product Details Page

Tablet Wireframe Image for Profile Page

Tablet Wireframe Image for Profile App/Page

Tablet Wireframe Image for Wish List Page

Tablet Wireframe Image for Wish List App/Page

Tablet Wireframe Image for Bag Page

Tablet Wireframe Image for Bag App/Page

Tablet Wireframe Image for Checkout Page

Tablet Wireframe Image for Checkout App/Page

Desktop Wireframe Image for Success Checkout Page

Desktop Wireframe Image for Success Checkout App/Page

Tablet Wireframe Image for Contact Page

Tablet Wireframe Image for Contact App/Page

Tablet Wireframe Image for Thank You Page

Tablet Wireframe Image for Thank You Page

Tablet Wireframe Image for Add Product Page

Tablet Wireframe Image for Add Product Page

Tablet Wireframe Image for Edit Product Page

Tablet Wireframe Image for Edit Product Page

Tablet Wireframe Image for 404 Page

Tablet Wireframe Image for 404 Page


Cell Phone Wireframe Image for Home Page

Cell Phone Wireframe Image for Home App/Page

Cell Phone Wireframe Image for Products, Product Details and My Profile Pages

Cell Phone Wireframe Image for Products, Product Details and My Profile Pages

Cell Phone Wireframe Image for Wish List, Bag and Checkout Pages

Cell Phone Wireframe Image for Wish List, Bag and Checkout Pages

Cell Phone Wireframe Image for Success Checkout, Contact and Thank You Pages

Cell Phone Wireframe Image for Success Checkout, Contact and Thank You Pages

Cell Phone Wireframe Image for Add Product, Edit Product and 404 Pages

Cell Phone Wireframe Image for Add Product, Edit Product and 404 Pages


Please check the PDF files for each case in the following links:

Desktop Wireframes PDF

Desktop Wireframes PDF

Tablet Wireframes PDF

Tablet Wireframes PDF

Cell Phone Wireframes PDF

Cell Phone Wireframes PDF






8 . Technologies Used

The development of the project employed the following languages, software, frameworks, applications and tools:

Languages

  • HTML
  • CSS
  • JavaScript
  • Python

Software, Frameworks, Applications and Other Tools

  • jQuery
  • GitHub
  • Gitpod
  • QGIS 3.18 Zürich (RUN tools/build_csv_and_json.py from inside the project directory)
  • Django 3.2
  • django-allauth 0.41.0
  • dj-database-url (v0.5.0)
  • django-allauth (v0.41.0)
  • django-countries (v7.3.2)
  • django-crispy-forms (v1.14.0)
  • django-storages (v1.12.3)
  • PostgreSQL
  • Font Awesome (v4)
  • Bootstrap (v4.0)
  • unittest
  • asgiref (v3.5.0)
  • backports.zoneinfo (v0.2.1)
  • boto3 (v1.21.33)
  • botocore (v1.24.33)
  • gunicorn (v20.1.0)
  • jmespath (v1.0.0)
  • oauthlib (v3.2.0)
  • Pillow (v9.0.1)
  • psycopg2-binary (v2.9.3)
  • python3-openid (v3.2.0)
  • pytz (v2021.3)
  • requests-oauthlib (v1.3.1)
  • s3transfer (v0.5.2)
  • sqlparse (v0.4.2)
  • https://www.privacypolicygenerator.info/ (to ellaborate the General Data Protection Regulation, GDPR, page)
  • https://www.wordtracker.com/ (to analyze volume and competitors of SEO keywords)
  • https://jsonformatter.org/ (to inspect JSON structures for the product and category data)
  • https://www.xml-sitemaps.com/ (to generate sitemap.xml file)
  • Mailchimp: Marketing Automation & Email Platform, https://mailchimp.com
  • Balsamiq Wireframes (v4.2.4, Editor Version 2.6.0)
  • ERDPlus (to make the data model graph)
  • Google Fonts
  • Stripe (v2.67.0)
  • W3C Markup Validation Service
  • W3C CSS Validation Service
  • JSHint (version 2.13.0)
  • JavaScript AJAX
  • WAVE Web Accessibility Evaluation Tool
  • Coverage.py 6.3.2
  • Google Lighthouse (used in Google, Microsoft Edge and Firefox)
  • Google Chrome, version 97.0.4692.71, Official Build, 64-bit (and its development tool)
  • Microsoft Edge, version 97.0.1072.62, Official build, 64-bit (and its development tool)
  • Firefox, 96.0.3, 64-bit (and its development tool)
  • Microsoft Internet Explorer, version 2004, OS Build 19041.1415, Microsoft Corporation
  • Render




9 . Features

The features are designed to address the goals, user stories, and user requirements and expectations given in section 4, User Experience.

The features of the site are the following ones:

  • Home page
  • Products (with product administration for the site owner)
  • Product details (with product administration for the site owner and option to comment for users)
  • Bag page
  • Checkout page
  • Secure payment method
  • Checkout success page
  • Site access (sign-in and sign-out)
  • Registration (sign-up)
  • Profile with history order
  • Contact form
  • Footer
  • 404 page

These pages are accessible from a fixed navigation menu on top and a footer, and several pop-up messages are included to inform the user of their interactions with the site.

In the second half of the project, two more features were added to improve the user experience and feedback reception:

  • Comments
  • Wish list

Details of these features, including the user story they cover, are the following:

  • Fixed navigation menu

It is in the header, fixed on all pages to facilitate navigation, and responsiveness.

User Stories Addressed by this Feature: 1; 2; 5; 7, 8, 15, 16, 17, 18, 19, 20, 24, 25, 26, 28, 30, and 33.

Please check "11. Testing of User Stories" for more details.

Fixed Navigation Menu for Desktop Image

Fixed Navigation Menu for Desktop Image

Fixed Navigation Menu for Tablet Image

Fixed Navigation Menu for Tablet Image

Fixed Navigation Menu for Cell Phones Image

Fixed Navigation Menu for Cell Phones Image

Fixed Navigation Menu, expanded, for Cell Phones Image

Fixed Navigation Menu, Expanded, for Cell Phones Image


  • Banner with latest news

It separates the fixed navigation menu and the body of the site, and shows advertising messages for the e-commerce.

User Stories Addressed by this Feature: 1; 2; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Banner with Latest News for Desktop Image

Banner with Latest News for Desktop Image

Banner with Latest News for Tablets Image

Banner with Latest News for Tablets Image

Banner with Latest News for Cell Phones Image

Banner with Latest News for Cell Phones Image

Banner with Latest News for Cell Phones Image, expanded

Banner with Latest News for Cell Phones Image, expanded


  • Home page

It is the welcome page, with a world map image and advertising messages in a Bootstrap carousel.

User Stories Addressed by this Feature: 1; 2; 23; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Check Home Page Desktop Image

Home Page Image for Desktop

Check Home Page Tablet Image

Home Page Image for Tablet

Check Home Page Cell Image

Home Page Image for Cell


  • Products (with product administration for the site owner)

Products appear after selecting categories or searching in the fixed navigation menu; they can be ordered by different criteria. The have an image, price, resolution (if applicable), a short description, and it also gives the site owner the option to edit it.

User Stories Addressed by this Feature: 1; 2; 13; 14; 19; 20; 21; 26; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Check Home Page Desktop Image

Products Page

Products Image

Products Management Page


  • Product details ((with product administration for the site owner)

It can be accessed by clicking on a specific product; it provides detailed information about it, including the price, short description and resolutions available if applicable. It also gives the site owner the option to edit it.

User Stories Addressed by this Feature: 1; 2; 13; 14; 20; 21; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Product Details Image

Product Details Image


  • Bag page

It can be accessed through the icon in the fixed navigation menu, top right, and shows the current products being purchased/added to the bag.

User Stories Addressed by this Feature: 1; 2; 15; 16; 20; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Bag Page Image

Bap Page Image


  • Checkout page

It is presented when the user/shopper finishes the purchase process and is ready to pay.

User Stories Addressed by this Feature: 1; 2; 15; 22; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Checkout Image 1

Checkout Page Image 1

Checkout Image 2

Checkout Image 2

Checkout Image - 2nd Page

Checkout Image - 2nd Page


  • Secure payment method

It is the payment process for the e-commerce, powered by Stripe.

User Stories Addressed by this Feature: 1; 2; 22; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Stripe Payment Image

Payment Process Image

Stripe Payment Image - Checkout

Stripe Payment Image - Checkout

Stripe Payment Image - Checkout 2nd Page

Stripe Payment Image - Checkout 2nd Page

Stripe Payment Image - Checkout Success

Stripe Payment Image - Checkout Success


  • Checkout success page

It is presented after a successful payment carried out by the user/shopper.

User Stories Addressed by this Feature: 1; 2; 22; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Checkout Success Image

Checkout Success Image

Checkout Success Image 2

Checkout Success Image 2


  • Site access (sign-in and sign-out)

They are Django complementary tools and pages to have sigh-in and sign-out options in the site for users.

User Stories Addressed by this Feature: 1; 2; 5; 8; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Sign-in Page Image

Sign-in Image

Sign-out Page Image

Sign-out Image


  • Registration (sign-up)

They are Django complementary tools and pages to have a sign-up option for users.

User Stories Addressed by this Feature: 1; 2; 3; 5; 8; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Sign-up Image

Registration Sign-In Images


  • Profile with history order

It is a page that shows the user information and history order after selected the option in the fixed navigation menu when the user is signed in.

User Stories Addressed by this Feature: 1; 2; 8; 12; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Profile with history order on the right

Profile and History Order Image


- ### **Contact form**

It is a contact form in a separate page, accessible from the footer, that gives the option to send a consultation to the site owner, without needing to buy and/or be signed in/up. Its goal is to receive feedback from as many sources as possible.

User Stories Addressed by this Feature: 1; 2; 4; 6; 9; 27; 29; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Contact Form Image

Contact Form Image


  • Footer

They are Django complementary tools and pages to have a sign-up option for users.

User Stories Addressed by this Feature: 1; 2; 4; 5; 6; 8; 9; 24; 27; 29; 30 and 33.

Please check "11. Testing of User Stories" for more details.

Footer Images

Footer for Desktop Image Footer for Tablet Image Footer for Cell Image


  • 404 page

It is a Django complementary tool and page that presents an error page informing the user that something has gone wrong (e.g., wrong address, broken URL).

User Stories Addressed by this Feature: 1; 2; 10; 30; 32 and 33.

Please check "11. Testing of User Stories" for more details.

404 Page Image

404 Page Image for desktop

404 Page Image

404 Page Image for tablet

404 Page Image

404 Page Image for Cell Phones


  • Pop-up status messages

They are Django complementary messages that informs the user, with pop-ups, that an action has been executed in the site. The action can be adding a product, deleting a product, editing a product (for the site owner), changing the amount of products in the bag, signing in, signing up, signing out and the payment outcome.

User Stories Addressed by this Feature: 1; 2; 3; 10; 30, 31 and 33.

Please check "11. Testing of User Stories" for more details.

Pop-up Status Message Images

Pop-up Status Message Image 1 Pop-up Status Message Image 2 Pop-up Status Message Image 3 Pop-up Status Message Image 4 Pop-up Status Message Image 5 Pop-up Status Message Image 6 Pop-up Status Message Image 7


  • Product Comments

It allows users to comment products below its product details.

Check Product Comments Image

Product Comments Image


  • Wish List

It allows users to save products they like or are interested in for future purchases.

Check Wish List Desktop Image

Wish List Desktop Image

Check Wish List Tablet Image

Wish List Tablet Image

Check Wish List Cell Image

Wish List Cell Image





10 . Validation

Development tools of Google Chrome Version 100.0.4896.127 (Official Build, 64-bit), Microsoft Edge (Version 100.0.1185.44, Official build, 64-bit) and Firefox (Version 100.0.1185.44, Official build, 64-bit) have been used to test the behaviour of the website for screen sizes between 320x568px to 1920x1370px.

The website was tested using these browsers. In addition, some users have collaborated checking the website in the cell phones, mostly with Android-based operating systems.

Devices used for testing and validation include Dell and Samsung cell phones. Operative systems include Windows 10 Enterprise (remote desktop), Windows 10 Pro and Android. Processors for desktop and laptops were Intel.

The following tools were used to validate the files of the website:


HTML Files

https://validator.w3.org/ was used to validate the new HTML files. Pages were rendered to get the HTML code (otherwise Django templates would alone give errors). When possible (where pages do not require log-in), the page link was tested in the validator.

Home (index.html)

Evidence of no errors in the home HTML file

Home (index.html), direct URL input

Evidence of no errors in the home HTML file

bag.html

Evidence of no errors in the bag HTML file

bag.html, direct URL input

Evidence of no errors in the bag HTML file

checkout.html

Evidence of no errors in the checkout HTML file

checkout_success.html

Evidence of no errors in the home checkout-success HTML file

contact.html

Evidence of no errors in the contact HTML file

thanks.html

Evidence of no errors in the thanks HTML file

add_product.html

Evidence of no errors in the add-product HTML file

edit_product.html

Evidence of no errors in the edit-product HTML file

product_details.html

Evidence of no errors in the product-details HTML file

products.html

Evidence of no errors in the products HTML file

profile.html

Evidence of no errors in the profile HTML file

wish_list.html

Evidence of no errors in the wish-list HTML file

404.html

Evidence of no errors in the 404 page HTML file


Rendered HTML for Home

Rendered HTML for Bag

Rendered HTML for Checkout

Rendered HTML for Checkout Success

Rendered HTML for Contact

Rendered HTML for Thanks

Rendered HTML for Add Product

Rendered HTML for Edit Product

Rendered HTML for Product Details

Rendered HTML for Products

Rendered HTML for Profile

Rendered HTML for Wish List

Rendered HTML for 404 Page


CSS File

https://jigsaw.w3.org/css-validator/ was used to validate the CSS file.

Please check the evidence below:

Valid CSS!

Valid CSS!

base.css File

Evidence of no errors in the CSS file

base.css File (Warnings)

Evidence of no errors in the CSS file

checkout.css File

Evidence of no errors in the CSS file

checkout.css File (Warnings)

Evidence of no errors in the CSS file

profile.css File

Evidence of no errors in the CSS file

profile.css File (Warnings) No warnings



JavaScript Files

https://jshint.com/ was used to validate the JavaScript files. Please check the parameters used for validation and evidence below:

Parameters:

Parameters used for JavaScript validation in JSHint version 2.13.3

Parameters used for JavaScript validation in JSHint version 2.13

Files:

To enable/disable country name in forms: country_field_in_profile.js

Evidence of no errors country_field_in_profile.js JavaScript file

To cancel delivery: download_data_and_discount_delivery.js

Evidence of no errors and warnings in the download_data_and_discount_delivery.js JavaScript file

To register in the Mailchimp newsletter: mailchimp_form_submission.js

Evidence of no errors and warnings in the mailchimp_form_submission.js JavaScript file

To let Django admin the name of the image that is going to be changed: notify_image_change_in_admin.js

Evidence of no errors and warnings in the notify_image_change_in_admin.js JavaScript file

To control buttons and form in product details: product_details.js

Evidence of no errors and warnings in the product_details.js JavaScript file

To control buttons and form in product details: product_details.js, with no definition for the CSRFToken

Evidence of no errors and warnings in the product_details.js JavaScript file

To sort and go to top of page in products: product.js

Evidence of no errors and warnings in the product.js JavaScript file

To control increase/decrease buttons: quantity_incr_decr.js

Evidence of no errors and warnings in the quantity_incr_decr.js JavaScript file

To control increase/decrease buttons: quantity_incr_decr.js, with no definition for the CSRFToken

Evidence of no errors and warnings in the quantity_incr_decr.js JavaScript file

To show Django toasts: show_messages.js

Evidence of no errors and warnings in the show_messages.js JavaScript file

To deal with process payment: stripe_elements.js

Evidence of no errors and warnings in the stripe_elements.js JavaScript file


Python Files

PEP8 was used to check the files written in Python, with "All right" results.

The tool can be accessed with this link: http://pep8online.com .

Flake8 (command: python3 -m flake8) was run to eliminate the loading of unused libraries.

  • Django Project Files
asgi.py

Evidence of file asgi.py validated with http://pep8online.com/

settings.py

Evidence of file settings.py validated with http://pep8online.com/

urls.py

Evidence of file urls.py validated with http://pep8online.com/

wsgi.py

Evidence of file wsgi.py validated with http://pep8online.com/


  • Bag App
admin.py

Evidence of file admin.py validated with http://pep8online.com/

apps.py

Evidence of file apps.py validated with http://pep8online.com/

contexts.py

Evidence of file contexts.py validated with http://pep8online.com/

models.py

Evidence of file models.py validated with http://pep8online.com/

tests.py

Evidence of file tests.py validated with http://pep8online.com/

urls.py

Evidence of file urls.py validated with http://pep8online.com/

views.py

Evidence of file views.py validated with http://pep8online.com/


  • Checkout App
admin.py

Evidence of file admin.py validated with http://pep8online.com/

apps.py

Evidence of file apps.py validated with http://pep8online.com/

forms.py

Evidence of file forms.py validated with http://pep8online.com/

models.py

Evidence of file models.py validated with http://pep8online.com/

signals.py

Evidence of file signals.py validated with http://pep8online.com/

tests.py

Evidence of file tests.py validated with http://pep8online.com/

urls.py

Evidence of file urls.py validated with http://pep8online.com/

views.py

Evidence of file views.py validated with http://pep8online.com/

webhook_handler.py

Evidence of file webhook_handler.py validated with http://pep8online.com/

webhooks.py

Evidence of file webhooks.py validated with http://pep8online.com/


  • Contact App
admin.py

Evidence of file admin.py validated with http://pep8online.com/

apps.py

Evidence of file apps.py validated with http://pep8online.com/

forms.py

Evidence of file forms.py validated with http://pep8online.com/

models.py

Evidence of file models.py validated with http://pep8online.com/

tests.py

Evidence of file tests.py validated with http://pep8online.com/

urls.py

Evidence of file urls.py validated with http://pep8online.com/

views.py

Evidence of file views.py validated with http://pep8online.com/


  • Home App
admin.py

Evidence of file admin.py validated with http://pep8online.com/

apps.py

Evidence of file apps.py validated with http://pep8online.com/

models.py

Evidence of file models.py validated with http://pep8online.com/

tests.py

Evidence of file tests.py validated with http://pep8online.com/

urls.py

Evidence of file urls.py validated with http://pep8online.com/

views.py

Evidence of file views.py validated with http://pep8online.com/


  • Products App
admin.py

Evidence of file admin.py validated with http://pep8online.com/

apps.py

Evidence of file apps.py validated with http://pep8online.com/

forms.py

Evidence of file forms.py validated with http://pep8online.com/

models.py

Evidence of file models.py validated with http://pep8online.com/

tests.py

Evidence of file tests.py validated with http://pep8online.com/

urls.py

Evidence of file urls.py validated with http://pep8online.com/

views.py

Evidence of file views.py validated with http://pep8online.com/

widgets.py

Evidence of file widgets.py validated with http://pep8online.com/


  • Profiles App
admin.py

Evidence of file admin.py validated with http://pep8online.com/

apps.py

Evidence of file apps.py validated with http://pep8online.com/

forms.py

Evidence of file forms.py validated with http://pep8online.com/

models.py

Evidence of file models.py validated with http://pep8online.com/

tests.py

Evidence of file tests.py validated with http://pep8online.com/

urls.py

Evidence of file urls.py validated with http://pep8online.com/

views.py

Evidence of file views.py validated with http://pep8online.com/


  • Wish App
admin.py

Evidence of file admin.py validated with http://pep8online.com/

apps.py

Evidence of file apps.py validated with http://pep8online.com/

contexts.py

Evidence of file contexts.py validated with http://pep8online.com/

models.py

Evidence of file models.py validated with http://pep8online.com/

tests.py

Evidence of file tests.py validated with http://pep8online.com/

urls.py

Evidence of file urls.py validated with http://pep8online.com/

views.py

Evidence of file views.py validated with http://pep8online.com/


  • Tools
build_csv_and_json.py

Evidence of file build_csv_and_json.py validated with http://pep8online.com/

products_database_generation_for_QGIS.py

Evidence of file products_database_generation_for_QGIS.py validated with http://pep8online.com/



Accessibility

https://wave.webaim.org/ was used to validate accessibility. Although there are warnings, all pages contain zero errors, except for the special case when the wish list contains the same product with two different resolutions, where the validator presents multiple form labels. Please see bugs section for more details.

Pages were tested with their URLs, directly in the we web page address input in at https://wave.webaim.org/, or through the Wave plugin for Chrome when authentication was needed. Please check evidence below:

Home (index.html)

Evidence of no accessibility errors in the home HTML file

Home (index.html, logged in)

Evidence of no accessibility errors in the home HTML file

bag.html

Evidence of no accessibility errors in the bag HTML file

checkout.html (logged in)

Evidence of no accessibility errors in the checkout HTML file

checkout_success.html (logged in)

Evidence of no accessibility errors in the home checkout-success HTML file

contact.html

Evidence of no accessibility errors in the contact HTML file

contact.html (logged in)

Evidence of no accessibility errors in the contact HTML file

thanks.html

Evidence of no accessibility errors in the thanks HTML file

thanks.html (logged in)

Evidence of no accessibility errors in the thanks HTML file

add_product.html (logged in)

Evidence of no accessibility errors in the add-product HTML file

edit_product.html (logged in)

Evidence of no accessibility errors in the edit-product HTML file

product_details.html

Evidence of no accessibility errors in the product-details HTML file

product_details.html (logged in)

Evidence of no accessibility errors in the product-details HTML file

products.html

Evidence of no accessibility errors in the products HTML file

products.html (logged in)

Evidence of no accessibility errors in the products HTML file

profile.html (logged in)

Evidence of no accessibility errors in the profile HTML file

wish_list.html

Evidence of no accessibility errors in the wish-list HTML file

wish_list.html (logged in)

Evidence of no accessibility errors in the wish-list HTML file

404.html

Evidence of no accessibility errors in the 404 page HTML file

404.html, direct URL input

Evidence of no accessibility errors in the 404 page HTML file, direct URL input


Performance

Google Lighthouse (in Google Chrome) was used to evaluate the performance of the pages. Please check the results below:

Home for cell phones (79)

Evidence of no errors in the home HTML file

Home for desktop (88)

Evidence of no errors in the home HTML file

Bag for cell phones (78)

Evidence of no errors in the bag HTML file

Bag for for desktop (96)

Evidence of no errors in the bag HTML file

Checkout for cell phones (72)

Evidence of no errors in the checkout HTML file

Checkout for desktop (89)

Evidence of no errors in the checkout HTML file

Success Checkout for cell phones (69)

Evidence of no errors in the home checkout-success HTML file

Success Checkout for desktop (95)

Evidence of no errors in the home checkout-success HTML file

Contact for cell phones (75)

Evidence of no errors in the contact HTML file

Contact for desktop (92)

Evidence of no errors in the contact HTML file

Thank You Page for cell phones (79)

Evidence of no errors in the thanks HTML file

Thank You Page for desktop (96)

Evidence of no errors in the thanks HTML file

Add Product for cell phones (79)

Evidence of no errors in the add-product HTML file

Add Product for desktop (97)

Evidence of no errors in the add-product HTML file

Edit Product for cell phones (78)

Evidence of no errors in the edit-product HTML file

Edit Product for desktop (95)

Evidence of no errors in the edit-product HTML file

Product Details for cell phones (62)

Evidence of no errors in the product-details HTML file

Product Details for desktop (82)

Evidence of no errors in the product-details HTML file

Products for cell phones (77)

Evidence of no errors in the products HTML file

Products for desktop (91)

Evidence of no errors in the products HTML file

Profile for cell phones (76)

Evidence of no errors in the profile HTML file

Profile for desktop (84)

Evidence of no errors in the profile HTML file

Wish List for cell phones (77)

Evidence of no errors in the wish-list HTML file

Wish List for desktop (96)

Evidence of no errors in the wish-list HTML file





11 . Testing

Automatic Testing of Python files with unittest and coverage.py

The data models and some Python files were tested with unittest. Coverage.py was used to measure the coverage of these automatic tests.

Coverage of 49% was achieved, with 52 tests successfully executed in 0.347 seconds.

Please see below screenshots of the testing and coverage, the fourth and last links contain the summary.

Screenshot 1 of unittest resuts

unittest Image 1

Screenshot 2 of unittest results

unittest Image 2

Screenshot 3 of unittest results

unittest Image 3

Screenshot 4 of unittest results with summary

unittest Image 4

Screenshot 1 of coverage results

coverage.py Image 1

Screenshot 2 of coverage results

coverage.py Image 2

Screenshot 3 of coverage results, with summary

coverage.py Image 3





Testing of User Stories

  • First time users

The following are testing of User Stories previously described above:

  1. As a user, I want to find a well-organized and simple site, so I immediately get the whole picture of the site.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Banner with latest news
Home page
Products (with product administration for the site owner)
Product details (with product administration for the site owner)
Bag page
Checkout page
Secure payment method
Checkout success page
Site access (sign-in and sign-out)
Registration (sign-up)
Profile with history order
Contact form
Footer
404 page
Pop-up status messages
Organize the structure of the site with a fixed navigation menu and footer that includes almost all pages of the site Navigate to any page of the site from these two features, except to the pages that require a previous step (e.g., adding items to the bag) Site is fully accessible from top navigation menu and footer; works as expected
Fixed Navigation Menu for Desktop Image

Fixed Navigation Menu for Desktop Image

Fixed Navigation Menu for Tablet Image

Fixed Navigation Menu for Tablet Image

Fixed Navigation Menu for Cell Phones Image

Fixed Navigation Menu for Cell Phones Image

Fixed Navigation Menu, expanded, for Cell Phones Image

Fixed Navigation Menu, Expanded, for Cell Phones Image



  1. As a user, I want to find a responsive site, so I can easily navigate in it in different devices.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Banner with latest news
Home page
Products (with product administration for the site owner)
Product details (with product administration for the site owner)
Bag page
Checkout page
Secure payment method
Checkout success page
Site access (sign-in and sign-out)
Registration (sign-up)
Profile with history order
Contact form
Footer
404 page
Pop-up status messages
Use Bootstrap and media queries to adapt the site design to all screen sizes Show readable content, while keeping functionality and design, in all screen sizes Works as expected
Desktop example: Home

Desktop example, Home, Image

Desktop example: Products

Desktop example, Products, Image

Tablet example: Products

Tablet example, Products, Image

Tablet example: Bag

Tablet example, Bag, Image

Cell phone example: Products

Cell phone example, Products, Image

Cell phone example: Wish List

Cell phone example, Wish List, Image



  1. As a user, I want to receive a confirmation of registration when I sign up, so I know that the process for creating my account went well.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Registration (sign-up)
Pop-up status messages
Use Django confirmation page to inform the user of a successful sign-up Show a successful message on a page after signing up Works as expected
Registration, Step 1

Registration, Step 1, Image

Registration, Step 2

Registration, Step 2, Image

Registration, Step 3, Confirmation

Registration, Step 3, Confirmation



  1. As a user, I want to be able to contact the site administrator, owner and/or developer, so I can send feedback to them.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Contact form
Footer
Implement a contact form in a separated page, give contact options in footer (which is available in all pages of the site) Access contact form and other options directly from the footer Works as expected
Contact Form Link in Footer

Contact Form Link in Footer

Contact Form

Contact Form



  1. As a user, I want to have access to my account easily, so I can quickly log in.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Site access (sign-in and sign-out)
Registration (sign-up)
Footer
Include access links to account in fixed navigation menu and footer Access sign-in page from these features Works as expected
Access Log-in from Top Navigation Menu

Access Log-in from Navigation Menu

Access Log-in from Top Navigation Menu (Smaller Screens)

Access Log-in from Navigation Menu (Smaller Screens)

Access Log-in from Footer

Access Log-in from Footer

Access Log-in from Footer (Smaller Screens)

Access Log-in from Footer (Smaller Screens)



  • Returning users
  1. As a returning user, I want to be able to contact the site administrator and/or owner and/or developer, so I can send feedback to them.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Contact form
Footer
Similar to user story 4, implement a contact form in a separated page, give as many as possible contact options in footer (which is available in all pages of the site) Access contact form and other options directly from the footer Works as expected
Contact Form Link in Footer

Contact Form Link in Footer

Contact Form

Contact Form



  1. As a returning user, I want a navigation menu on top, always visible, so I can access the main content on the website from there and do not need to use the back button of the browser.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Include a fixed navigation menu on top, in the header of pages, with links to main parts of the site Navigate to the selected sites, without using the back button, without scrolling down, and without manually editing the URL Works as expected
Fixed Navigation Menu for Desktop Image

Fixed Navigation Menu for Desktop Image

Fixed Navigation Menu for Tablet Image

Fixed Navigation Menu for Tablet Image

Fixed Navigation Menu for Cell Phones Image

Fixed Navigation Menu for Cell Phones Image

Fixed Navigation Menu, expanded, for Cell Phones Image

Fixed Navigation Menu, Expanded, for Cell Phones Image



  1. As a returning user, I want to have access to my account easily, so I can quickly log in.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Site access (sign-in and sign-out)
Registration (sign-up)
Profile with history order
Footer
Include access links to account in fixed navigation menu and footer Access sign-in page from these features Works as expected
Access Log-in from Top Navigation Menu

Access Log-in from Navigation Menu

Access Log-in from Top Navigation Menu (Smaller Screens)

Access Log-in from Navigation Menu (Smaller Screens)

Access Log-in from Footer

Access Log-in from Footer

Access Log-in from Footer (Smaller Screens)

Access Log-in from Footer (Smaller Screens)



  1. As a returning user, I want to have a way to contact the developer so I can contribute and/or indicate errors or bugs.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Contact form
Footer
Similar to user stories 4 and 6, implement a contact form in a separated page and add contact options in the footer Access contact form and other options directly from the footer Works as expected
Contact Form Link in Footer

Contact Form Link in Footer

Contact Form

Contact Form



  1. As a returning user, I want to be informed if the contact form goes through, so I know if my message is being sent or it is not.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
404 page
Pop-up status messages
Use a Django confirmation page to inform the user if sending the contact form is successful Show a successful page after sending the form Works as expected
Contact Form Confirmation

Contact Form Confirmation



  1. As a returning user, I want to recover my password easily if I forget it, so I do not worry about remembering and/or keeping it.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
... ... ...
Recover Forgotten Password, Step 1

Recover Forgotten Password, Step 1, Image

Recover Forgotten Password, Step 2

Recover Forgotten Password, Step 2, Image

Recover Forgotten Password, Step 3, Confirmation

Recover Forgotten Password, Step 3, Confirmation

Recover Forgotten Password, Step 4, Confirmation

Recover Forgotten Password, Step 4, Confirmation

Recover Forgotten Password, Step 5, Confirmation

Recover Forgotten Password, Step 5, Confirmation



  1. As a returning user, I want to have a history of my purchases, so I know what I have bought and spent through time.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Profile with history order
Store orders and link them to the user profile that originated it Show purchase history in profile Works as expected
Purchase History

Purchase History



  • Shoppers
  1. As a shopper, I want to have the products to buy visible (without many details so I can see more), so I can select them for purchase.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Products (with product administration for the site owner)
Product details (with product administration for the site owner)
Create a data model where products are viewed in the body of a unique page according to a specific selection Show all products in a page (in the body) according to the selection and/or sort in the fixed navigation menu Works as expected
Products Page

Products Page



  1. As a shopper, I want to have access to the product details, so I can access them in case I am not sure about the purchase and/or want to have a better description of the product.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Products (with product administration for the site owner)
Product details (with product administration for the site owner)
Create a view with product details after clicking on the product itself Show product details in a different page/view Works as expected
Product Details

Product Details



  1. As a shopper, I want to have a detailed view of my shopping cart, so I know what I am buying and have the current purchase details just before paying.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Bag page
Checkout page
Create a bag app to show the current shopping cart, with a link in the fixed navigation menu Show shopping cart in a different page/view Works as expected
Shopping Bag, top

Shopping Bag, top

Shopping Bag, bottom

Shopping Bag, bottom



  1. As a shopper, I want to have the amount I am spending always visible, so I know how much I am spending.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Bag page
Compute total of bag and return it to the view containing the fixed navigation menu Show spent amount, at all times, in fixed navigation menu Works as expected
Permanent Spending Amount

Permanent Spending Amount



  1. As a shopper, I want to have special offers easily accessible, so I can buy them before they disappear if I find them useful.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Include a link/list item element to special offers in the fixed navigation menu Access special offers after clicking on this link/list item element of the menu Works as expected
Easy Access for Offers

Easy Access for Offers

Easy Access for Offers in Checkout

Easy Access for Offers in Checkout



  1. As a shopper, I want to have a search field, so I do not spend much time finding the product I want to buy
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Include a search field in the fixed navigation menu that looks for products (according to the search criteria) in the backend and return the results to the products page Show products related to the search criteria Works as expected
Search Field for Desktop

Search Field for Desktop

Search Field for Smaller Screens

Search Field for Smaller Screens



  1. As a shopper, I want to have categories of products, so I find a product easily if I do not know its name.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Products (with product administration for the site owner)
Include links/list item elements in the fixed navigation menu that filter the data in the backend according to categories (previously created) and return the result to the products page/view Show products related to the selected category in the menu Works as expected
Products by Categories

Products by Categories

Products by Categories, Digital Data

Products by Categories, Digital Data

Products by Categories, Reports

Products by Categories, Reports

Products by Categories, Training

Products by Categories, Training

Products by Categories, Software

Products by Categories, Software

Products by Categories, Offers

Products by Categories, Offers



  1. As a shopper, I want to have prices always visible, so I know the value of the products at all times.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Products (with product administration for the site owner)
Product details (with product administration for the site owner)
Bag page
Compute total of bag and return it to the view containing the fixed navigation menu Show spent amount, at all times, in fixed navigation menu Works as expected
Visible Prices in the Bag

Visible Prices in the Bag

Visible Prices in the Product Details

Visible Prices in the Product Details

Visible Prices in the Wish List

Visible Prices in the Wish List

Visible Prices in Products

Visible Prices in Products



  1. As a shopper, I want to have the different resolutions of the products visible, close to the product it belongs to, so I can easily select it without further action.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Products (with product administration for the site owner)
Product details (with product administration for the site owner)
Add a field in the products model that activate a product feature related to the resolution (if applicable), giving the user the option to select it Show the different available resolutions for the products (e.g., in a dropdown element), considering them as other product if a different resolution (than the one in the bag) is selected, updating the quantities in the bag accordingly Works as expected
Selection of Product Resolution

Selection of Product Resolution



  1. As a shopper, I want to have a secure payment method, so I can rest assured that the purchase procedure is safe.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Checkout page
Secure payment method
heckout success page
Implement a payment method that is well known and secure Process payments from users/shoppers Stripe payments implemented; Works as expected
Stripe Payment Process right after Purchasing

Stripe Payment Process right after Purchasing

Stripe Payment Process right after Purchasing, Success Checkout

Stripe Payment Process right after Purchasing, Success Checkout

Stripe Payment Image - Checkout

Stripe Payment Image - Checkout

Stripe Payment Image - Checkout 2nd Page

Stripe Payment Image - Checkout 2nd Page

Stripe Payment Image - Checkout Success

Stripe Payment Image - Checkout Success



  • Site Owner
  1. As owner, I want to provide an introductory page, so users know what can be found on the website and what can be purchased.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Home page
Design the home page to give a quick overview of the e-commerce Find the home page, giving the idea of the e-commerce and a few messages to give the user an idea of what can be found in the site Works as expected
Home Page Desktop Image

Home Page Image for Desktop

Home Page Tablet Image

Home Page Image for Tablet

Home Page Cell Image

Home Page Image for Cell



  1. As owner, I want to provide an easy process for sign-up, so I ensure a connection with a potential buyer.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Footer
Include a Django app and page to easily register/sign up in the site if the user opts for this, with links to this option in the fixed navigation menu and footer Access page for sign-up easily from menu and footer, with a few steps to achieve the task Works as expected
Easy Sign Up

Easy Sign Up



  1. As owner, I want to provide a search field for products on top, so I require users/shoppers the minimum possible time to find a product (and therefore reduce the risk of leaving).
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
As user story 18, include a search field in the fixed navigation menu that looks for products (according to the search criteria) in the backend and return the results to the products page Show products related to the search criteria Works as expected
Search Field for Desktop

Search Field for Desktop

Search Field for Smaller Screens

Search Field for Smaller Screens



  1. As owner, I want to organize products in categories, so users find an organized site and can find products easily.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Products (with product administration for the site owner)
As user story 19, include links/list item elements in the fixed navigation menu that filter the data in the backend according to categories (previously created) and return the result to the products page/view Show products related to the selected category in the menu Works as expected
Products by Categories

Products by Categories

Products by Categories, Digital Data

Products by Categories, Digital Data

Products by Categories, Reports

Products by Categories, Reports

Products by Categories, Training

Products by Categories, Training

Products by Categories, Software

Products by Categories, Software

Products by Categories, Offers

Products by Categories, Offers



  1. As owner, I want to receive feedback from users, so I can take actions in response to them if needed.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Contact form
Footer
Similar to user stories 4; 6 and 9; implement a contact form in a separated page, give as many as possible contact options in footer (which is available in all pages of the site) Access contact form and other options directly from the footer Works as expected
Contact Form Link in Footer

Contact Form Link in Footer

Contact Form

Contact Form



  1. As owner, I want to provide a navigation menu on top and always visible, so users can access any content at any time without needing the back button.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
As user story 7, Include a fixed navigation menu on top, in the header of pages, with links to main parts of the site Navigate to the selected sites, without using the back button, without scrolling down, and without manually editing the URL Works as expected
Fixed Navigation Menu for Desktop Image

Fixed Navigation Menu for Desktop Image

Fixed Navigation Menu for Tablet Image

Fixed Navigation Menu for Tablet Image

Fixed Navigation Menu for Cell Phones Image

Fixed Navigation Menu for Cell Phones Image

Fixed Navigation Menu, expanded, for Cell Phones Image

Fixed Navigation Menu, Expanded, for Cell Phones Image



  1. As owner, I want to give as many options to be contacted as possible, so users can choose forms or links in the footer to send their consultations and/or feedback in a very fast way.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Contact form
Footer
Similar to user stories 4; 6; 9 and 27; implement a contact form in a separated page, give as many as possible contact options in footer (which is available in all pages of the site) Access contact form and other options directly from the footer Works as expected
Contact Form

Contact Form

Contact Options

Contact Options



  1. As owner, I want to provide a responsive website, so user can access it from any device without any constraint to navigate, find and/or use the website.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Banner with latest news
Home page
Products (with product administration for the site owner)
Product details (with product administration for the site owner)
Bag page
Checkout page
Secure payment method
Checkout success page
Site access (sign-in and sign-out)
Registration (sign-up)
Profile with history order
Contact form
Footer
404 page
Pop-up status messages
Similar to user story 2, use Bootstrap and media queries to adapt the site design to all screen sizes Show readable content, while keeping functionality and design, in all screen sizes Works as expected
Desktop example: Home

Desktop example, Home, Image

Desktop example: Products

Desktop example, Products, Image

Tablet example: Products

Tablet example, Products, Image

Tablet example: Bag

Tablet example, Bag, Image

Cell phone example: Products

Cell phone example, Products, Image

Cell phone example: Wish List

Cell phone example, Wish List, Image



  1. As owner, I want to inform users if their consultation/message was successfully sent, so they know if they need to resend it or they do not.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Pop-up status messages
Similar to user story 10, use a Django confirmation page to inform the user if sending the contact form is successful Show a successful page after sending the form Works as expected
Contact Form Confirmation

Contact Form Confirmation



  1. As owner, I want to inform the user, through an error page, if there is any error when loading the website.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
404 page
Use Django error page to inform the user if any action when navigating the site produces an error Show an error message on a page after facing a problem, e.g., a broken URL Works as expected
404 Page Image

404 Page Image for desktop

404 Page Image

404 Page Image for tablet

404 Page Image

404 Page Image for Cell Phones



  • Developer
  1. As developer, along with other points of this section, I want to show my work and give the option to users to contact me if they wish.
FEATURE ACTION EXPECTED RESULT ACTUAL RESULT
Fixed navigation menu
Banner with latest news
Home page
Products (with product administration for the site owner)
Product details (with product administration for the site owner)
Bag page
Checkout page
Secure payment method
Checkout success page
Site access (sign-in and sign-out)
Registration (sign-up)
Profile with history order
Contact form
Footer
404 page
Pop-up status messages
Implement all knowledge gathered so far in full-stack software development, with as many features as possible according to the Code Institute program time frame Show as many full-stack software development capabilities as possible Expecting results and feedback

Project Link

Developer's Repositories





12 . Marketing Strategy

SEO Analysis

The search engine optimization is focused on Google search engine since it accounts for more than 90% of user searches.

Basically, Google elaborates a ranking of pages (according to the criteria being searched) and shows them in the result according to this ranking. Algorithms and human ratters are used to position pages in these search results.

In order to have our page in the first results (user will usually not read after the first page of results), we need our page to be highly ranked in the research results.

A way to do it is by including keywords, which can be short-tail (one or two words, highly ranking but giving a lot of "competitors") or long-tail (phrases, more specific to our products or page, but with less ranking). Therefore, the best solution might be considered that one that produces a high volume of results with low competition.

First, a list of important keywords is created, thinking in our buyers and user personas. Then, the most relevant ones are selected based on volume (high) and competition (low).

(April 5th, 2022) (Quality Factor: No e-commerce/No service provider = 1; No e-commerce/service provider after first page= 2; No e-commerce/service provider in first page = 3; E-commerce after first page = 4 E-commerce in first page = 5) Just to have an idea and assign a quantification to the selection, the "Volume" is multiplied by the "Quality Factor" (and divided by 1000000 to have smaller figures). This is a subjective approach; however the results are still interesting:

Keywords Volume (from Google.com) Content, general description (searching in Google.com) "Quality Factor" Volume x "Quality Factor" / 1000000
Keywords Volume (from Google.com) Content, general description (searching in Google.com) "Quality Factor" Volume x "Quality Factor" / 1000000
Geophysical data 55,300,000 No e-commerce in first three pages, most science sites 1 55
Digital elevation model 68,200,000 No e-commerce in first three pages, software provider in second page 2 136
DEM 4,950,000,000 No e-commerce in first three pages, most science sites, data acquisition provider in second page 2 9,900
Magnetometry 2,010,000 No e-commerce in first three pages, service providers in first page 3 6
Gravimetry 22,900,000 No e-commerce, service providers in third page 2 46
Resistivity 101,000,000 No e-commerce in first three pages, book in third page 2 202
Buy geophysical data 3,940,000 E-commerce and books on first page 5 20
Buy DEM data 52,800,000 E-commerce on first page, science sites 5 264
Buy Magnetometry data 10,500,000 E-commerce and data acquisition providers on first page 5 53
Buy Gravimetry data 15,500,000 E-commerce and data acquisition providers on first page 5 78
Buy Resistivity data 24,300,000 Service providers and e-commerce on first page 5 122
DEM data 3,870,000,000 E-commerce on first page (bottom), science sites 5 19,350
Magnetometry data 10,500,000 Science sites, equipment in second page, images of equipment on first page 2 21
Gravimetry data 17,200,000 E-commerce on first page (top), science sites 5 86
Resistivity data 17,200,000 No e-commerce in first three pages, most science sites 1 17
Geophysical book 30,900,000 Lot of books and e-commerce right from the top of first page 5 155
Geophysical training 16,500,000 Training service provider on first page 4 66
Geophysical data acquisition 8,740,000 Science, data acquisition service provider on second page 3 26
Geophysical data 201,000,000 Science, e-commerce for paper and books in third page 4 804
DEM acquisition 113,000,000 Science 1 113
Magnetometry acquisition 1,930,000 Science, equipment on second page 2 4
Gravimetry acquisition 3,100,000 Science, with service provider and book and first page 3 9
Resistivity acquisition 6,810,000 Science, book in first page and service provider in second one 3 20
DEM processing 389,000,000 Science 1 389
Magnetometry processing 4,810,000 Service, equipment provider in first page; science 3 14
Gravimetry processing 7,440,000 Science 1 7
Resistivity processing 31,700,000 Service provider in second page 2 63
DEM books 6,420,000,000 E-commerce from first page 5 32,100
Magnetometry books 1,950,000 E-commerce from first page 5 10
Gravimetry books 4,400,000 E-commerce from first page 5 22
Resistivity books 11,000,000 E-commerce from first page 5 55
DEM training 4,140,000,000 Science 1 4,140
Magnetometry training 1,680,000 Many training courses in first page, service provider in second page, science 4 7
Gravimetry training 1,840,000 training courses in first page, science 4 7
Resistivity training 26,500,000 Non-related topics from first page (resistance) 1 27
DEM software 3,640,000,000 E-commerce in first page, many products 5 18,200
Magnetometry software 4,770,000 Service providers, e-commerce and books in first page 5 24
Gravimetry software 4,890,000 Science, service provider in first page 3 15
Resistivity software 11,000,000 Service providers from first page 3 33

SEO Analysis

SEO Analysis


SEO Analysis (Ordered)

SEO Analysis


As it can be observed, the following keywords produce high volume of searches with a focus in our e-commerce nature: "DEM books", "DEM data", "DEM software", "DEM training", "Geophysical data".

Then, those with a "quality factor" of 5 (where an e-commerce appears in the first page of a Google search, since we are interested in promoting an e-commerce( are the following ones: "Buy DEM data", "Geophysical book", "Buy Resistivity data", "Gravimetry data", "Buy Gravimetry data", "Resistivity books", "Buy Magnetometry data", "Magnetometry software", "Gravimetry books", "Buy geophysical data", "Magnetometry books".

Also, it can be observed a clear trend for unique words like "DEM", "Geophysical", "Buy" and "Data", so they were analysed as well.

After analysing "DEM" with wordtracker.com, it is observed that it produces a high volume and good competition comparison. Therefore "DEM" is also included as keyword.

Also, after analysing "Geophysical" with wordtracker.com, it is observer a great score for volume and competition, achieving the first place in both for similar keywords.

"Buy" and "Data" are not finally included in the keywords as they are too general.

Therefore, the final keywords for the projects are the following 18 ones: "DEM books", "DEM data", "DEM software", "DEM training", "Geophysical data", "Buy DEM data", "Geophysical book", "Buy Resistivity data", "Gravimetry data", "Buy Gravimetry data", "Resistivity books", "Buy Magnetometry data", "Magnetometry software", "Gravimetry books", "Buy geophysical data", "Magnetometry books", "DEM", "Geophysical".

On the other hand, keyword staffing was also carried out when possible, for example, in headings and "strong" tags. Social links include the attribute "rel" with "noopener" in order to have search engines not including these links in their search rankings. Images include an "alt" attribute as descriptive for the image as possible (including a meaningful file name). In the metadata we include the description of the e-commerce and these 17 keywords.

Finally, we include the sitemap.xml (in the root folder) to increase the chances of a higher rank in search engines and help them on finding relevant content, and a robots.txt to "tell" them where "not to navigate" (which simultaneously increase the ranking of the site since they consider a site that contains a file like this of good quality).

sitemap.xml: created using XML-Sitemaps.com robots.txt: tested with https://support.google.com/webmasters/answer/6062598?hl=en

Reference: Code Institute, SEO lessons.

wordtracker.com analysis for "DEM" keyword

DEM Analysis with wordtracker

wordtracker.com analysis for "Geophysical" keyword

DEM Analysis with wordtracker


Organic Growth with Social Media (Facebook and LinkedIn)

Since the e-commerce is oriented to a professional and specialized community, the organic growth (which should simultaneously be considered with organic growth) is suitable for LinkedIn. This social network makes possible the interaction with users and allow them to take training related to the products of the GDEC e-commerce. This social network seems to be very suitable for universities and research institutions that use these kind of data.

Similarly, Facebook, achieves the same goal, with better perspective towards advertising and user interaction, and with a higher amount of users.

The page below was built in Facebook with the aim of interacting with potential users, answer consultations, promoting our products, connect to clients and potential clients and have the change to connect to other potential buyers (users) and/or other social networks through them. It was built trying to use as much content from the GDEC site as possible, so there is a good match between the content of the website and the Facebook page.

GDEC Facebook Page

GDEC Facebook Page Image

GDEC Facebook Page

GDEC Facebook Page PDF


Paid Marketing

As mentioned before, the above strategies should be carried out with a paid strategy, focusing the expenditures (which might not be necessarily high but constant through time) in geophysical exhibitions (like EAGE or SEG among many others), and on those news or science websites that could caught the attention of authorities (since these kind of data are usually used by them).





13 . Bugs

Some bugs were related to design, positioning and tags of elements in the page, with variables in Django templates among them. Also, many minor bugs were solved just by assigning the correct property and/or by trial and error.

Bugs that required more time and specific solutions were the following ones:

Bug Solution
It was not possible to keep the checkbox for cancelling the delivery cost activated, sending the form to the backend but deactivating it immediately after. The issue was caused by addressing the checkbox with both JavaScript and an "if" statement in the HTML template, strangely requiring an assignment of the "cancel_delivery_cost" twice, one row after the other, likely due to the time taken for the view to be loaded. The issue was solved by addressing the checkbox with an "if" statement only in the checkbox HTML tag.
Accessibility validation presents multiple form labels when there is a repeated product in the wish list, with different resolutions. The issue arises because the model assigns the same product ID (since it considers a Boolean field for the resolution, rather than a text one as the wish list does (for "high", "medium" and "low"). Therefore, in the template "for" loop, repeated labels are generated, since they are generated from the IDs of the products. The same reason has caused issues when adding or updating quantities in the wish list or the bag. The quantities were solved with AJAX posts that read the resolution. A more robust solution would be to refactor the Product model, migrating its resolution field from Boolean to text (so it would be able to identify the three resolutions separately).
Increment and decrement controls to update the quantities in the wish list and bag stopped working after validation and refactoring. The issue was caused by the reorganization of the HTML elements, since JavaScript access these controls through element positioning in the page (not through specific ID or classes). The issue was solved by assigning the correct relative position of the increment and decrement controls in the page.
Commented products did not show the user the label of being already commented (whey they have done so). The issue was solved by rendering the proper relation in the HTML template, through a variable, after defining the proper data relation in the backend to identify a comment to both a specific product and user.




14 . Deployment

The website was fully written in Gitpod, permanently tested in Gitpod terminal, and periodically deployed to GigHub Pages (in a main branch) and Heroku Platform (to handle backend languages), where it was migrated from, to Render, in November 2022. After first deployment, several updates have been carried out before the final version. These updates were implemented in the deployed website from Gitpod, just by using the "push" command for every commit (change) in the ongoing development. Amazon Web Services S3 is also implemented to contain the static files.

The project repository can be forked from GitHub here (https://github.com/csc7/PP5_CI_GDEC), please check for the "Fork" button, top-right of the page, to achieve this task.

The fully deployed program, accessible by anyone, is found here, whose URL is https://pp5-ci-gdec.onrender.com.com/ . Its repository is found here, whose URL is https://github.com/csc7/PP5_CI_GDEC.

Follow these steps to deploy the content of this project:

1 - Create a Heroku app in Heroku website (more intuitive process, selecting "create new app") or using the CLI in Gitpod if you manage the commands for this and use this development environment.

2 - Add Postgres resource to the Heroku app (in Heroku website, "Resources", "add-ons"), where a "Hobby Dev - Free" plan is enough.

3 - In Gitpod (or your development environment), install dj_database_url with this command: pip3 install dj_database_url

4 - In Gitpod (or your development environment), install psycopg2-binary with this command: pip3 install psycopg2-binary

5 - Freeze the environment requirements: pip3 freeze > requirements.txt

6 - Add/Import the following line/pakage in your settings.py file (on top of the file, with other "import" commands): import dj_database_url

7 - In settings.py update the DATABASES variable to the following lines, so the database is read from the local repository in not set up in Heroku; from: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', }

to: if 'DATABASE_URL' in os.environ: DATABASES = { 'default': dj_database_url.parse(os.environ.get('DATABASE_URL')) } else DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } }

8 - Connect to Heroku database and run migrations with the following commands:

If you want to verify that effectively all migrations need to be run, execute python3 manage.py showmigrations

Then migrate: python3 manage.py migrate

9 - Load/Import database (categories and products): a) If you use the database of this repository, use the following commands (in this order, since products depends on categories): python3 manage.py loaddata categories python3 manage.py loaddata products

b) If you manually create the database, please follow these steps: Credits: Code Institute:

  • Make sure your manage.py file is connected to your mysql database
  • Use this command to back up your current database and load it into a db.json file: ./manage.py dumpdata --exclude auth.permission --exclude contenttypes > db.json
  • Connect your manage.py file to your postgres database
  • Then use this command to load your data from the db.json file into postgres: ./manage.py loaddata db.json

10 - Create superuser in Heroku: python3 manage.py createsuperuser

11 - Install gunicorn to work as a webserver: pip3 install gunicorn

12 - Again, freeze the environment requirements: pip3 freeze > requirements.txt

13 - Create Procfile (just create file and assign "Procfile" as name) in the project root directory and include this line in it: web: gunicorn your_app_name.wsgi:application

14 - Log in into Heroku from the Gitpod CLI with the following line, entering the required information: heroku login (it will require to log in through a different browser) or heroku login -i (to log in directly in the Gitpod CLI)

15 - OPTIONAL: Set DISABLE_COLLECTSTATIC to 1, so Heroku does not load static files when deploying (at this point of the process, in case you want to look the website before deploying in Amazon Web Services): heroku config:set DISABLE_COLLECTSTATIC=1 --app your_app_name

16 - Ensure ALLOWED_HOSTS variable in settings.py file is set as follows: ALLOWED_HOSTS = ['your_app_name.herokuapp.com', 'localhost']

17 - Create a SECRET_KEY, e.g., using https://miniwebtool.com/django-secret-key-generator/. Then assig a SECRET_KEY value in Config Vars of the Settings section in Heroku. Then, in settings.py file, ensure SECRET_KEY variable is set as follows: SECRET_KEY = os.environ.get('SECRET_KEY', '')

18 - Crease Amazon Web Services account (if needed) and S3 bucket. Assign the bucket a name (e.g., your_app_name), with "ACLs enabled", "Block off public access" disables (accepting warning message below), and then set the following variables:

  • Properties tab: Static website hosting, using it to host a website, indicating index.html and error.html in the index and error documents.
  • Permissions tab:
    • CORS configuration (required to have access between Heroku and S3), copying these lines of code: [ { "AllowedHeaders": [ "Authorization" ], "AllowedMethods": [ "GET" ], "AllowedOrigins": [ "*" ], "ExposeHeaders": [] } ]
  • Bucket Policy: click on "Policy Generator" at the bottom and, in the new page, select "S3 Bucket Policy" as the type of policy, assign a start ("*") to "Principal" to allow all of them, "GetObject" in "Actions", paste the ARN of the bucket (found in the "Properties" of the bucket) in the corresponding field, generate policy, copy the resulting code in the "Bucket Policy" that originated this new page, and save.
  • Access Control List: enable "List objects" for "Everyone.

19 - Add Amazon Web Services Identify and Access Management (IAM) to create a user to access the S3 bucket and apply the following changes:

  • Open IAM from AWS available services.
  • Go to "User Groups" (left), "Create group" (top right), assign a name (e.g., manage_your_app_name) and create (bottom).
  • Go to "Policies", "Create Policy", go to "JSON" tab, "Import managed policy", select "AmazonS3FullAccess", "Import". In the "Resource" field of the JSON structure, assign the ARN of your app as follows: ... "Resource": [ "arn", "arn/*" ]
  • Then click "Next:Tags", "Next:Review" (assign a name, e.g., your_app_name_policy; and a description, e.g., "Access to S3")and "Create Policy". The policy will appear in the list of policies.
  • Go to "User Groups", select your app, "Permissions", "Attach Policies" (in "Add Permissions" button), select the one you have just created and click "Add Permissions" on the bottom.
  • Go to "Users", "Add user", assign a name (e.g., "your_app_name_access_to_static_files"), select "Programatic access", and "Next:Permissions".
  • "Add user to group", select the policy you have just created and click "Next: Tags", then "Next: Review" and finally "Create User".
  • IMPORTANT: AFTER ADDING THE USER TO THE GROUP, DOWLOAD THE .CSV FILE AS IT MIGHT NOT BE AVAILABLE LATER. The file is required for authentication for the Django app.

20 - Install boto3 with the following command: pip3 install boto3

21 - Install django-storages with the following command: pip3 install django-storages

22 - Again, freeze the environment requirements: pip3 freeze > requirements.txt

23 - Add storages in INSTALLED APPS of settings.py: 'storages',

24 - Check that the variables of "if 'USE_AWS' in os.environ:" in settings.py correspond to your app name and AWS settings. Please note that you need to have defined the following variables in Config Vars of Heroku (in "Settings"): AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY USE_AWS

IMPORTANT: At this point, DISABLE_COLLECSTATICS of point 15 can be deleted if you opted for enabling it), so Django loads the static files from Amazon Web Services

25 - Check that your "custom_storages.py" file is properly defined according to your app and AWS account.

26 - In the app bucket of your Amazon Web Services account create a folder named "media" (in the same level that the "static" folder is located)

27 - Check that superuser e-mail in Django admin user interface is verified.

28 - Add API keys (STRIPE_PUBLIC_KEY and STRIPE_SECRET_KEY) from Stripe to Config Vars in Heroku. Then, in your Stripe account (in "Developers" section, "Webhooks"), "Add endpoint", add the URL of the project, selecting and adding all events. Finally, copy the signing secret of the webhook and assign it to a STRIPE_WH_SECRET in the Config Vars of Heroku. Ensure the variables match the names in the settings.py file.

29 - Add automatic e-mail variables in Config Vars of Heroku (to send automatic e-mails from the app), EMAIL_HOST_PASS (password given by your e-mail service provider) and EMAIL_HOST_USER (the e-mail address from where e-mails are sent).

Replace EMAIL_HOST in settings.py if you are using a different service provider than GMail.

Additional notes:

Please note that these are the steps according to the user interface as of April 4th, 2022. There might be changes after a while.

Remember you can commit and push your changes to both GitHub and/or Heroku for GitHub: git add . git commit -m "Your update commit message" git push

for Heroku: If initialization is needed: git init heroku git:remote -a your_app_name

Then: git add . git commit -m "Your update commit message" git push heroku main

You can also set automatic deployments by going to Heroku website, "Deploy" section of your_app_name, and connecting to GitHub (after searching for your_app_name in the corresponding "Connect to GitHub" section and finally clicking on the "Enable Automatic Deploys" button at the bottom).

In settings.py file, you can set the DEBUG variables as follows if you want to control the debug mode from Heroku Config Vars: 'DEVELOPMENT' in os.environ

Heroku Deployment Screenshot

Deployment on Heroku Image

The project was migrated from Heroku to Render in November 2022.






15 . Credits






16 . Acknowledgements

I would like to acknowledge and thank the following people for being part of this project and for helping me in the development of it:

  • To my wife and family, for always supporting and helping.
  • Code Institute, for providing knowledge, guide, content and tools.
  • My mentor, Mo, for helping with very valuable guide and support.
  • Code Institute Tutor Assistance for helping when needed, at any time.
  • Code Institute community in Slack for permanently being an online reference.
  • All the valuable information provided by the sources mentioned above in the credits.





About

A fictitious e-commerce for geophysical data to show the use of different languages and technologies. Built with Django, HTML, CSS, JavaScript and Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published