/evotech

An e-commerce website for selling computer parts and accessories built using PHP, MariaDB, HTML, CSS and JavaScript. Built as part of the Aston University Computer Science Team Project module.

Primary LanguagePHP

evotech; logo

PHP MariaDB HTML5 CSS3 JavaScript Apache

GitHub commit activity (branch) GitHub contributors GitHub Workflow Status (with event)

evotech;

An e-commerce website for selling computer parts and accessories built using PHP, MariaDB, HTML, CSS and JavaScript. Built as part of the Aston University Computer Science Team Project module.

Table of Contents

Contributing

For information on how to contribute to the project, please see the CONTRIBUTING.md file.

Running locally

These instructions will guide you through setting up the project to run locally on your machine for development and testing purposes.

Windows

  1. Install XAMPP

    winget install -e --id ApacheFriends.Xampp.8.2
  2. Clone the repository using git clone and change directory to the root of the repository

    cd evotech
  3. Open XAMPP and start Apache and MySQL

  4. Run the setup script for Windows

    .\setup\setupWindows.ps1
  5. Open the following links in your browser:

  6. Complete the evotech; setup in your browser

The script will have configured everything so in the future if you need to run locally again:

  1. Start Apache and MySQL in XAMPP

  2. Open the following links in your browser:

To use the website, you will need to construct the database as per the instructions in Constructing the database.

macOS

  1. Install xcode command line tools

    xcode-select --install
  2. Install brew

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) NONINTERACTIVE=1"
  3. Install XAMPP

    brew install --cask xampp
  4. Clone the repository using git clone and change directory to the root of the repository

    cd evotech
  5. Start Apache and MySQL in XAMPP (manager-osx)

  6. Run the setup script for macOS

    ./setup/setupMac.sh
  7. Open the following links in your browser:

  8. Complete the evotech; setup in your browser

The script will have configured everything so in the future if you need to run locally again:

  1. Start Apache and MySQL in XAMPP

  2. Open the following links in your browser:

To use the website, you will need to construct the database as per the instructions in Constructing the database.

Linux

  1. Install XAMPP

    wget "https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/8.2.12/xampp-linux-x64-8.2.12-0-installer.run"
    chmod +x xampp-linux-x64-8.2.12-0-installer.run
    sudo ./xampp-linux-x64-8.2.12-0-installer.run
  2. Clone the repository using git clone

  3. Change directory to the root of the repository

    cd evotech
  4. Start Apache and MySQL in XAMPP

    sudo /opt/lampp/lampp start
  5. Run the setup script for Linux

    ./setup/setupLinux.sh
  6. Open the following links in your browser:

  7. Complete the evotech; setup in your browser

The script will have configured everything so in the future if you need to run locally again:

  1. Start Apache and MySQL in XAMPP

  2. Open the following links in your browser:

To use the website, you will need to construct the database as per the instructions in Constructing the database.

Constructing the database

The database needs to be constructed before the website can be used.

[!TIP] The OOBE evotech; setup will automatically construct the database for you. If you have not used the OOBE setup, follow the instructions below.

  1. Open the following link in your browser:
  2. Log in with your MySQL credentials
    • Default username: root
    • Default password: '' (empty string)
  3. The database name is your username followed by '_db'
    • For example, if your username is root, the database name is root_db
  4. Click on the SQL tab
  5. Open the evotechDB.sql file in the setup directory
  6. Copy the contents of the file and paste them into the SQL tab
  7. Click Go to run the SQL commands

Using supplied dummy data

The database can be populated with dummy data to test the website.

[!TIP] The OOBE evotech; setup will automatically populate the database with dummy data for you if you choose to do so. If you have not used the OOBE setup, follow the instructions below.

SQL Product Data

This will populate the database with dummy product data. The site requires some products to be present in the database to function correctly.

  1. Open the following link in your browser:
  2. Log in with your MySQL credentials
    • Default username: root
    • Default password: '' (empty string)
  3. Ensure you have created the database as per the instructions in Constructing the database
  4. Click on the database name
    • The database name is your username followed by '_db'
    • For example, if your username is root, the database name is root_db
  5. Click on the SQL tab
  6. Open the dummyProductData.sql file in the setup directory
  7. Copy the contents of the file and paste them into the SQL tab
  8. Click Go to run the SQL commands

Image Product Data

This will populate the images directory with dummy product images. Whilst not necessary for the site to function, it will make the site look more realistic.

  1. Copy the image folders inside of setup/examplePhotos/products to view/images/products
    • For example, setup/examplePhotos/products/1 should be copied to view/images/products/1
    • This can be done using the file explorer or the command line

Credits