-
Please download and install the following software first:
-
Node.js (Choose the one with LTS) for frontend
-
XAMPP (version 7.2.27) for backend
-
vs code (Optional) for coding
XAMPP
Node.js
- Check if the installation is successful
-
click
start(not that circle) and then typepowershell, clickRun as Administrator -
If the version number appears after entering these two commands,
npm -vandnode -v, it means the installation is successful!
- In my case, I am using node.js
v12.16.3and the version number is based on the installer you downloaded.
vs code
move code to the htdocs
- open
XAMPP Control Panelas administrator
- click Explorer
- find the
htdocsfolder and enter (the default path is in:C:\xampp)
- delete them or move them to the location you want (p.s these files are not important)
- copy the backend source code to the htdocs folder. You will copy:
-
db_sql_script
-
img
-
php
-
README.md (optional)
- check the backend file structure, and detail see here
start server and import DB tables and init data
- return to the
XAMPP Control Panel, and start theApacheandMySql
- allow
- open the database management interface:
- you can change the language from here
- import database
- go to
C:\xampp\htdocs, and enter thedb_sql_scriptfolder
- select the
init_db.sqlfile, and Open
- click
GoButton
- import result
Vue.js reference:
install the required packages for the front end
- use
vs codeopen the frontend project
- open terminal
- type
npm install -g @vue/cliin the terminal, then Enter
- wait for the installation of the vue cli package to complete
- done
- and then type
npm installto install the required package
- done
run the frontend server
- type
npm run serveto start the frontend server
- running
- use
ctrl+ mouse left button to open the link, or type the urlhttp://localhost:8080/in the browser by yourself.
don't use the IP url to open it, it will not work
the backend project is not complete. so please refer to the following chapter(Demo video) to complete it.
After you have completed the previous steps, the entire project is not complete. You need to write some SQL code in the corresponding file according to the following demonstration videos:
- as a buyer, I want to browse the products so that I can see what I am interested in.
-
Related code:
-
login.php [getwallet]
-
home.php [getproductdata、getproductcategories]
- as a buyer, I want to buy the products so that I can drink.
-
Related code:
-
shoppingCart.php [getcoupon]
-
purchaseshoppingcart.php [purchaseshoppingcart]
-
login.php [updatewallet、getwallet]
- as a seller, I want to process the order so that I can sell the products and make money
-
Related code:
-
processorder.php [getorderno、processorder、getsalesamount、updateorder、updateprofit、]
-
orderrecord.php [getOrderlist]
-
login.php [getprofit]
- as a seller, I want to manage product inventory so that I can know the inventory status of the product
-
Related code:
-
myproduct.php [getmyproduct、replenishment]
- as a seller, I want to manage the product's on and off shelves so that I can manage my produxts
-
Related code:
-
myproduct.php [getmyproduct、offproduct、launchproduct]
- as a seller, I want to add new products so that I can diversify my products
-
Related code:
-
home.php [getproductcategories]
-
uploadFile.php
-
publish.php [publish]
-
myproduct.php [getmyproduct]
This is an implementation example of user story 1:
- getwallet
- getproductdata
- getproductcategories
-
buyer
-
account: buyer@example.com
-
password: buyer
-
seller
-
account: seller@example.com
-
password: seller
-
go to here:
C:\xampp\htdocs -
open with
Code(right-click on the blank space)
- open
php/database.php, and modify the$usernameand$passwordto your DB account and password
- import the
init_db.sqlto your DBMS. For example, use MySql Workbanch:
htdocs
├── db_sql_script
│ └── init_db.sql // creat table、insert date ...
├── img // folder where pictures are stored
│ └── *.jpg
├── php // backend cdoe
│ ├── database.php // connect to DBMS
│ ├── headers.php
│ ├── myproduct.php // manage product
│ ├── processorder.php // manage order
│ ├── shoppingCart.php // process the "purchase" operation, and the shopping cart's state is stored in frontend, so don't care "shopping cart"
│ ├── home.php
│ ├── login.php
│ ├── orderrecord.php // manage order record
│ ├── publish.php // add new product
│ └── uploadFile.php // upload product's image
└── README.md
109-2-database-project-frontend-example
├── node_modules
│ └── packages...
├── public
│ ├── index.html
│ └── favicon.ico
├── src
│ ├── assets
│ │ └── logo.png
│ ├── config
│ │ └── config.js
│ ├── store
│ │ ├── modules
│ │ │ ├── login.js
│ │ │ ├── products.js
│ │ │ ├── shoppingCart.js
│ │ │ └── walletProfit.js
│ │ └── index.js
│ ├── api
│ │ ├── home.js
│ │ ├── myproduct.js
│ │ ├── processorder.js
│ │ ├── walletOrProfit.js
│ │ ├── login.js
│ │ ├── order.js
│ │ └── shoopingCart.js
│ ├── components
│ │ ├── CartItems.vue
│ │ ├── Coupon.vue
│ │ ├── Loading.vue
│ │ ├── Navbar.vue
│ │ └── Replenishment.vue
│ ├── img
│ │ ├──coupon.jpg
│ │ └── logo.png
│ ├── router
│ │ └── index.js
│ ├── views
│ │ ├── Deposit.vue
│ │ ├── Login.vue
│ │ ├── NewProduct.vue
│ │ ├── ProcessOrder.vue
│ │ ├── Home.vue
│ │ ├── MyProduct.vue
│ │ ├── OrderRecord.vue
│ │ └── ShoppingCart.vue
│ ├── App.vue
│ └── main.js
├── .gitignore
├── babel.config.js
├── package.json
├── package-lock.json
└── README.md
team02
├── code
│ ├── frontend.zip
│ ├── backend.zip
(如果沒有前後端分離,那就只需壓縮為 {任意名稱}.zip)
│ └── README.md (簡單描述部屬步驟)
├── final_report.pdf
└── final.pptx














































































