ngonhan2k5 / mwa-final

MWA course CS-573-2020-Group3
MIT License
0 stars 1 forks source link

mwa-final

MWA course CS-573-2020-Group3

Tasks:

  1. Two separated apps
    1. Frontend: using ng
      • Addition dependencies: multer (upload images)
    2. Backend: using express-generator
      • Addition npm dependencies: mongoose, cors, jsonwebtoken
  2. Features:
    1. Commons:
      • sign up + sign in with Authentication+Authorization role base (simple const: USER, FARMER, ADMIN)
    2. For farmers:
      • products manage
      • orders manage
      • order history
    3. For customers
      • cart
      • purchase
      • orders history (reuse)
      • rate and feedback the completed order
    4. Others:
      • Mongo DB design
      • Email
      • Log API request
      • Swagger genera API documentation
      • Cloud integration
      • Send project result email (afterward)
    5. For super users (optional)
      • List account, activate/deactivate, reset pass
  3. Discussion:
    • UI using material or bootstrap -> using bootstrap
    • Git branch, push rule and other convention agreements
  4. Others:

DB Design

Farmer = {
    _id: Object,
    user: Object,
    firstName: String, 
    lastName: String,
    tel: String,
    address: String,
    reputation: Integer
}

Product = {
    _id: Object,
    farmer: {type: Schema.Types.ObjectId, ref: 'Farmer'},
    name: String,
    description: String,
    price: Double,
    photo: String, 
    ...,
    inStock: Interger
}

Order = {
    _id: Object,
    customer: {type: Schema.Types.ObjectId, ref: 'Customer'},,
    farmer: {type: Schema.Types.ObjectId, ref: 'Farmer'},,
    orderCode: String,
    createDate: { type: Date, default: Date.now },
    orderItems: [Product],
    status: (PENDING || READY || COMPLETE),
    totalAmount: Double,
    pickUpTime: DateTime,
    rate: (null||EXCELLENT||GOOD||BAD)
}

Customer = {
    _id: Object,
    user: Object,
    firstName: String, 
    lastName: String,
    tel: String,
    address: String
}

User = {
    _id: Object
    email: String,
    password: String,
    role: (ADMIN|FARMER|CUSTOMER),
    uid: String, // FarmerId or CustomerId
    status: (ACTIVE||DEACTIVE)
}