JiayangYing / CITS3403_PRO

MIT License
2 stars 0 forks source link

CITS3403 Project: Ecohub

Description

EcoHUB is developed to provide a robust, user-friendly platform that aligns with sustainable development goals by promoting the reuse and recycling of products. It enables sellers to list their second-hand or recyclable products and manage their inventories efficiently. Buyers can browse, filter, and order products with ease. The platform supports essential functionalities like email verification, profile management, and comprehensive order handling, ensuring a secure and smooth transaction experience.

Purpose

EcoHUB's primary goal is to provide an easy-to-use platform for Australians to buy and sell second-hand and recyclable products. This initiative aims to support sustainable development by reducing waste, promoting recycling, and fostering economic opportunities in line with specific Sustainable Development Goals.

Feature

User Features

Seller Features

Buyer Features

General Features

Technologies

Installation

Setting Up the Project

Follow these steps to clone the repository, set up a virtual environment, and install dependencies:

1. Clone the Repository

2. Set Up a Virtual Environment

We recommend using venv to create a virtual environment. Detailed instructions can be found in the official Python documentation.

Create the Virtual Environment

In the root directory of the cloned repository, execute the following command:

python3 -m venv venv

This command creates a virtual environment named venv.

Activate the Virtual Environment

Activate the virtual environment using the command specific to your operating system:

3. Install Dependencies

With the virtual environment activated, install the required dependencies:

pip install flask
pip install flask-sqlalchemy
pip install flask-wtf
pip install flask-login
pip install flask-mail

If still having problem please install all dependency from requirment.txt

pip install -r requirements.txt

4. Configure Environment Variables

Create a .env file in the root directory of your project to configure environment variables. The .env file should contain key-value pairs for your environment-specific settings. Here’s an example of what the .env file might look like:

ELASTICSEARCH_URL = http://localhost:9200
MAIL_SERVER = smtp.googlemail.com
MAIL_PORT = 587
MAIL_USE_TLS = 1
MAIL_EMAIL = <your_email>
MAIL_USERNAME = <your_username>
MAIL_PASSWORD = <email_password>

You should now have a fully set up development environment with all dependencies installed.

Troubleshooting

If you encounter issues with app.db such as database schema or you need to reset it, the following commands might be useful:

flask db downgrade base
flask db upgrade

Initialisation

To start the application, run following command:

python3 flask run

The application should now be running at http://localhost:5000

Run tests

To run tests for the application, follow these steps to run tests using selenium and unittest.

1. Selenium Testing

Install Selenium

Make sure you have Selenium installed:

   pip install selenium

Running Selenium Tests

Run Selenium Tests in PowerShell:

Open PowerShell and use the following command to run your Selenium tests:

   python3 -m unittest tests/selenium.py

This will open the Chrome browser and perform the actions defined in the selenium.py

2. Unittest

Install Unittest

unittest is a built-in Python module used for writing and running tests. It is included with Python, but if for some reason it is not installed, you can install it via pip:

   pip install unittest

Running Unittest

Run Unittests in WSL/venv:

Open WSL and activate your virtual environment, then use the following command to run your unittests:

   python3 -m unittest tests/unit.py

Test results will be displayed in the terminal window.

Deliverables

The "deliverables" folder contains progress updates organised by specific topics, such as Product Implementation and SignUp Page Workflow. Each topic includes videos and images that showcase progress and provide prototypes related to that topic. This structured approach makes it easy to locate and review the relevant videos and prototypes for each aspect of the project.