Skip to content

Database Design

Wenlin Mao edited this page Oct 18, 2018 · 16 revisions

Description

All collection name, fields name follows naming format: All lower-case, separate words using _.

User

{
     "user_id": {
   	"username": "<USER NAME: length 4-20 string with only a-z, A-Z, 0-9, ~!@#$%^&*-=>", 
  	"password": "",
        "contact_forms":"<contact_form_id>",
  	"email": "<USER EMAIL>",
   	"phone_number": "<USER PHONE>",
        "products_for_sale": "<product_id>",
        "liked_products":"<product_id>",
        "buying_offers":"<product_id>",
    }
}

Product

{
    "product_id": {	
  	 "product_name": "< string with only a-z, A-Z, 0-9, ~!@#$%^&*-=>", 
	 "category" : "<category_id>",
         "images" : " ",
	 "Is_delivery_included": "<True or False>",
	 "Price": "int",
         "location": " ",
         "seller": "<user_id>",
         "buyers": "<user_id>",
    }
}

Category

{
    "category_id": {	
  	 "category_name": "< string with only a-z, A-Z, 0-9, ~!@#$%^&*-=>", 
    }
}

Contact form

{
    "contact_form_id": {	
        "seller": "<user_id>",
        "product": "<product_id>",
        "email": "<USE REMAIL>",
   	"phone_number": "<USER PHONE>",
    }
}

Example refer to http://ieng6.ucsd.edu/~cs110x///static/res/AugcastDatabaseSchemaModelv2.pdf

Clone this wiki locally