UF-CEN5035-2022SpringProject / GatorStore

0 stars 0 forks source link

GatorLive Project Introductions and Rules


Project Members

Canvas Group Link - https://ufl.instructure.com/groups/419331/users
Yi-Ming Chang
Hung-You Chou
Sebastian Llerena

Introduction

For course CEN5035, our group are building a AmazonLive Clone. We are using Golang in backend programming and ReactJS in frontend programming. The purpose is to combine live streaming functions to sell products in users’ online stores. We hope to provide users not only a platform to sell their products but also with our features that can help them sell stuff with high efficiency.

Reference: https://www.nngroup.com/articles/livestream-ecommerce-china/

Tutorials

Seller livestream tutorial

https://github.com/UF-CEN5035-2022SpringProject/GatorStore/blob/main/seller-frontend/seller-instructions.md

Backend setup tutorial

https://github.com/UF-CEN5035-2022SpringProject/GatorStore/blob/main/backend/backend-readme.md


Learnings:

Golang: Down below are few reference to learn Golang in the first step.

https://go.dev/tour/
https://go.dev/doc/effective_go
https://www.youtube.com/watch?v=YS4e4q9oBaU


Github Branching Rules

actions:

Backend branch naming

spr{#number}-backend-{actions}/{action-name}

Seller frontend naming

spr{#number}-sfrontend-{actions}/{action-name}

Buyer frontend naming

spr{#number}-bfrontend-{actions}/{action-name}

For example: spr1-backend-feature/routing


Testing Proccess

  1. Self Testing
  2. PR into test branch (according to feature into backend-test, seller-frontend-test, buyer-frontend-test)
  3. PR into main branch

Backend

Golang and backend set up please check backendend-readme.md

API Document

BACKEND API:

http://localhost:8080/{env}/{routePath}

Header Name Type Description
authorization string server JWT token, only
time datetime string
Return Body Name Type Description
status int use for passing error code (0 = success, other = error code)
result json return object

User API URLs


UA1. User Login API


UA2 User Info API

Get user info


UA3 User Store List API

Get the users store list, split the item with page

Store API URLs


SA0. Store Create API


SA1. Get Store Object API


SA2. Store Product List API

Get the products according to the store, split the item with page


SA3. Store OrderList API

Get the orders according to the store, split the item with page


SA5. Store Recommend List API

Get the products according to the store, split the item with page


SA6 Get Store Live List


Get the lives according to the store, split the item with page


Store Livestream API URLs


SLA0. Create Store Livestream API


SLA1. Update Store Livestream status API


Livestream API URLs


LA1. Livestream status API


LA2 Get Live Orders


Get the lives according to the store, split the item with page


Product API URLs


PA1. Product Create API


PA2. Product Get API


PA3. Product Update API


PA4. Product Purchase API


PA5. Product Delete API


Test API URLs


Ojbect Document


Object Table Columns

Name Description
Var/Method Showing this attibute is a variable or method
Key/Optional - 'K' represents primary key.
- 'RK means it's related with others to combine into primary key.
- 'O' means optional
Type variable type or method return type
Description descibe the attribute purpose

JWT Object

This object will be use for respresenting the user in server, every user has an unique JWT token for requesting API. Use it as Authentication in the middleware of the server (before the request passby). If the token object does not match to the request, return httpStatus 401 or 403.

The key will be jwtToken, and the value will be as below: Var/Method Key/Optional Type Description
jwtToken k string unique jwt authorization key in GatorStore
email string unique identifier
createTime string create datetime

JSON Example:

{
  'email': "yimingchang@ufl.edu",
  'jwtToken': "gst.R2F0b3JTdG9yZV95aW1pbmdzdGFyNTU2NkBnbWFpbC5jb20xMTAwMg==_MjAyMi0wMi0yMlQwMjoyNTowMVo=",
  'createTime': "2006-01-02T15:04:05Z07:00"
}

User Object

If user has already register, an uniqueId will be assigned to user.
Or else we'll use email as a identifier.

The key will be email, and the value will be as below: Var/Method Key/Optional Type Description
id K string userId - unique identifier
name string Receive by google api
email K string unique identifier
jwtToken string unique jwt authorization key in GatorStore
accessToken string youtube access token
createTime string create datetime
updateTime string latest update datetime

JSON Example:

{
  'id': "113024",
  'name': "YiMing Chang",
  'email': "yimingchang@ufl.edu",
  'jwtToken': "gst.R2F0b3JTdG9yZV95aW1pbmdzdGFyNTU2NkBnbWFpbC5jb20xMTAwMg==_MjAyMi0wMi0yMlQwMjoyNTowMVo=",
  'accessToken': "GatorStore_10302323",
  'createTime': "2006-01-02T15:04:05Z07:00"
  'updateTime': "2006-01-02T15:04:05Z07:00"
}

Store Object

Each Store will have uniqueId, and belong to one user who created it.

The key will be storeId, and the value will be as below: Var/Method Key/Optional Type Description
id K string storeId - unique identifier
name string storeName
userId string unique creator
createTime string create datetime
updateTime string latest update datetime
isLive boolean check if this store is on live
liveId string liveObj's ID to get live information, empty string if isLive is false

JSON Example:

{
  'id': "GatorStore_1",
  'name': "GoGoGator",
  'userId': "11001",
  'createTime': "2006-01-02T15:04:05Z07:00",
  'updateTime': "2006-01-02T15:04:05Z07:00",
  'isLive': True
  'liveId': "" 
}

Live Object

The key will be liveId, and the value will be as below: Var/Method Key/Optional Type Description
id K string live - unique identifier for liveObj
storeId K string store creating this live
title string storeName
streamKey string create datetime
streamUrl string latest update datetime
createTime datetime live create time
updateTime datetime live update time
embedHTML string use for web iframe ebmed
embedChatRoom string use for web iframe ebmed
 {
   'id': "113024", // livestream id
   'title': "YiMing Chang", // livestream title
   'storeId': "122323"
   'streamKey': "1324-5678-8974-1230",
   'streamUrl': "some url",
   'createTime': "2006-01-02T15:04:05Z07:00",
   'updateTime': "2006-01-02T15:04:05Z07:00",
   'embedHTML': "some iframe html",
   'embedChatRoom': "chatroom iframe html"
 }

Product Object

Name Type Description
id string product id
name string product name
price float product price
description string product introduction
quantity int how many product in stock
picture string picture in base64
storeId string publish to which store
createTime string createTime
updateTime string updateTime
isDeleted boolean
   {
       'id': "113024", // product id
       'name':'gator',
       'storeId':'11001',
       'createTime': "2006-01-02T15:04:05Z07:00",
       'updateTime': "2006-01-02T15:04:05Z07:00",
       'price':'1000',
       'quantity':'1',
       'description':'real gator',
       'picture':'123123',
       'isDeleted':false
   }

Order Object

Each Order will have unique and belong to one user who purchases the object.

The key will be orderId, and the value will be as below: Var/Method Key/Optional Type Description
id K string orderId- unique identifier
userId string unique buyerId
createTime string create datetime
productId string products ID
liveId string liveObj's ID, if buyers click from the live product list, else it will be an empty string
subTotal float64 total payment
quantity int

JSON Example:

{
   "id": orderId
   "productId": purchase product
   "createTime": ""
   "liveId": "weqwe" (empty if not from live product list)
   "subTotal": 4000
   "quantity": 10,
   "userId": buyerId,
   "storeId": storeId 
}

Global ErrorCode