Giter Site home page Giter Site logo

goshopping's Introduction

Backend

GOLANG

List of model

A. User System

  • ID: ObjectID
  • Role (user / admin / vendor): enum
  • Email: string email
  • Password: string password
  • maybe Extra attribute : CreateAt, modifyAt,...

B. Order System

  • ID: ObjectID
  • List of tuple (IDProduct, Quantity)
  • IDUser
  • PaymentInfo (default: Null)

Note: nếu paymentInfo = Null ⇒ đang ở giỏ hàng, else nó đã được thanh toán và là đơn hàng.

C. Product

  • ID: ObjectID
  • Name: string
  • Image (maybe): base64 or maybe string
  • Discription: string
  • Price: float

D. Shop

  • List of tuple (IDProduct, Quantity)

List of API (Route)

A. User System

POST /user/login {email, password} return {UserID, jsonwebtoken}

POST /user/signup {email, password}

POST /user/forgot-password {email}

B. Product System

Khi đăng nhập và đăng kí xong, 1 web landing page sẽ call API, map product, và hiển thị lên UI:

GET /

Người dùng có thể view chi tiết từng Product

GET /products/:IDProduct

Search bar given pattern matching ⇒ lấy ra tất cả các product theo điều kiện nào đó

GET /products/:pattern

Giỏ hàng để cập nhật realtime: ⇒ dùng useState của React, tuy nhiên ví dụ người A mua xong thì bên dashboard của người B phải ngay lập tức update lại quantity mà không cần reload

Em dự tính dùng socket và add tất cả quantity vô 1 kênh.

Khi người dùng nhấn mua hàng trong giỏ hàng:

POST /order/

{

UserID,

listTuple(IDProduct, Quantity),

paymentInfo,

}

goshopping's People

Contributors

nminhdai avatar

Watchers

 avatar

Forkers

lcmtri

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.