README.md 5.32 KiB
Newer Older
mengqingbo's avatar
mengqingbo committed
# **Pets Community**
## **1. Introduction**
This project is called "Pets Community", an online Q&A platform designed for all pets lovers to seek assistance.
mengqingbo's avatar
mengqingbo committed

## **2. Deployment**

mengqingbo's avatar
mengqingbo committed
### 2.1 Run with Virtualenv Environment
mengqingbo's avatar
mengqingbo committed

**Please use PyCharm as much as possible for the entire project, which can simplify the process of environment configuration.**

mengqingbo's avatar
mengqingbo committed
#### **2.1.1 Clone project to local** 
mengqingbo's avatar
mengqingbo committed

```shell
mengqingbo's avatar
mengqingbo committed
git clone https://csgitlab.ucd.ie/19206151/software-methodology.git
mengqingbo's avatar
mengqingbo committed
```

mengqingbo's avatar
mengqingbo committed
#### 2.1.2 Configure Python interpreter
mengqingbo's avatar
mengqingbo committed

You'll need to find Project Interpreter in Preferences of PyCharm to create a new Virtualenv Environment. 

> This is a brand new virtual environment and will not be affected by other environments in your computer.

mengqingbo's avatar
mengqingbo committed
#### 2.1.3 Install all the packages
mengqingbo's avatar
mengqingbo committed

```shell
pip install -r requirements.txt
```
mengqingbo's avatar
mengqingbo committed
#### 2.1.4 Run codes
mengqingbo's avatar
mengqingbo committed

* For Linux and macOS,

```shell script
export FLASK_APP=flasky.py
flask run
```

* For Windows

```shell script
set FLASK_APP=flasky.py
flask run
```

mengqingbo's avatar
mengqingbo committed
#### 2.1.5 Problems that may arise
mengqingbo's avatar
mengqingbo committed

**In the process of using pip to download the package, we have various problems. You can refer to these following information.**

1. If the terminal prompts "Requirement already satisfied: ..." but it cannot find the package we originally installed when running.
* Solution: We need to clear the cache data of PyCharm and reinstall all the packages we need through the "requirements.txt" file.
* And How to Clear the Cache Data: <https://jingyan.baidu.com/article/656db918b1e142a281249cc8.html>


2. Internet speed is too slow resulting in download failure.
* Solution:Download via douban source.  <http://pypi.douban.com/simple>
* Reference: <https://blog.csdn.net/ITYTI/article/details/83313463>

3. After excluding the above problems, still cannot install any packet.
* Error info: Cannot connect to proxy solution:
* Solution: It may be caused by a proxy server set on the computer. Just shut off the proxy the sever.
* Reference: <https://www.cnblogs.com/arvinls/p/6149417.html>

HP Dezheng Yang's avatar
HP Dezheng Yang committed
### 2. 2 Run with Docker

**You can download the docker image we have prepared from Docker Hub, or you can generate a new docker image based on the Dockerfile inside the code.**

> The premise of using docker is that your computer has docker

#### 2.2.1 Download Docker Image

* Download

```shell
HP Dezheng Yang's avatar
HP Dezheng Yang committed
docker pull ydz1020/sm_project:latest
HP Dezheng Yang's avatar
HP Dezheng Yang committed
```
HP Dezheng Yang's avatar
HP Dezheng Yang committed
Or from: https://hub.docker.com/r/ydz1020/sm_project/tags
HP Dezheng Yang's avatar
HP Dezheng Yang committed

* Run 

```shell
docker run -d -p 5000:5000 ydz1020/sm_project:latest
```

#### 2.2.2 Generate a new Docker Image

* Generate

```shell
docker build -t [your_image_name] .
```

* Run 

```shell
docker run -d -p 5000:5000 [your_image_name]
```

#### 2.2.3 Open

* Open Web APP

```shell
# If your computer is mac you can use this.
open -a "Google Chrome"  http://127.0.0.1:5000/ 
# If your computer is windows you can use this.
You can visit directly in the browser: 127.0.0.1:5000 to view.
```

* Kill Run

```shell
docker ps   #View the CONTAINER ID of the running container
```

```shell
docker kill <CONTAINER ID>  #Stop run
```
> You can also use Docker Desktop to run the docker image.


mengqingbo's avatar
mengqingbo committed
## **3. Test**

### 3.1 Personal Account

Here is a personal account for you to test.

HP Dezheng Yang's avatar
HP Dezheng Yang committed

mengqingbo's avatar
mengqingbo committed
|       Personal Email Account      | Password |
| --------------------------------- | -------- |
|          17601627023@163.com      | password |

HP Dezheng Yang's avatar
HP Dezheng Yang committed
> You can also register some new accounts to test.

mengqingbo's avatar
mengqingbo committed
### 3.2 Organisation Account

#### 3.2.1 Organisation Account Registration

Organisational account registration needs to go through the administrator to review the organisation account application information. If the information is true and reliable, the administrator will click the successful application button to send an email to the applicant to represent the success of the registration.

**Since the project is not actually deployed online, you need to test as administrator on your computer.**
mengqingbo's avatar
mengqingbo committed

mengqingbo's avatar
mengqingbo committed
Here is an administrator account for you to test.
mengqingbo's avatar
mengqingbo committed

mengqingbo's avatar
mengqingbo committed
|       Administrator Email Account      | Password |
| -------------------------------------- | -------- |
|           ou_xiao_ou@163.com           | password |
mengqingbo's avatar
mengqingbo committed

mengqingbo's avatar
mengqingbo committed
> You need to log in to this account and perform the administrator’s action to complete the registration of the user account.
mengqingbo's avatar
mengqingbo committed

mengqingbo's avatar
mengqingbo committed
After the registration is done, your registration email will receive an email containing your organisation’s account information.
mengqingbo's avatar
mengqingbo committed

mengqingbo's avatar
mengqingbo committed
#### 3.2.2 Organisation Account Test
mengqingbo's avatar
mengqingbo committed

mengqingbo's avatar
mengqingbo committed
Organisation accounts can post and activity information.
mengqingbo's avatar
mengqingbo committed

mengqingbo's avatar
mengqingbo committed
Here is an organisation account for you to test.
mengqingbo's avatar
mengqingbo committed

mengqingbo's avatar
mengqingbo committed
|       Organisation Email Account      | Password |
| ------------------------------------- | -------- |
|           2495908019@qq.com           | password |
mengqingbo's avatar
mengqingbo committed

mengqingbo's avatar
mengqingbo committed
## **4. About Group 6**
mengqingbo's avatar
mengqingbo committed

mengqingbo's avatar
mengqingbo committed
### 4.1 Group Name
Touching Fish
mengqingbo's avatar
mengqingbo committed

mengqingbo's avatar
mengqingbo committed
### 4.2 Group Members
mengqingbo's avatar
mengqingbo committed

mengqingbo's avatar
mengqingbo committed
| UCD Student ID | BJUT Student ID |     Name     |            Email           | Chinese Name |
|     :----:     |     :----:      |    :----:    |           :----:           |    :----:    |
| 19206151       |    19372101     | Yang DeZheng | dezheng.yang@ucdconnect.ie |     杨德正    |
| 19206152       |    19372102     | Meng QingBo  | qingbo.meng@ucdconnect.ie  |     孟庆博    |
| 19206168       |    19372118     | Li QiYu      | qiyu.li@ucdconnect.ie      |     李骐宇    |
| 19206163       |    19372113     | Xi Le        | le.xi@ucdconnect.ie        |     席勒     |
| 18206160       |    19372110     | Xu YunQiao   | yunqiao.xu@ucdconnect.ie   |     许云乔    |