Skip to content

Database Design

Jiaosixing edited this page Nov 20, 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>",
        "furniture_for_sale": "<furniture_id>",
        "liked_furniture":"<furniture_id>",
        "buying_offers":"<furniture_id>",
    }
}

Furniture

{
    "furniture_id": {	
  	 "product_name": "<string with only a-z, A-Z, 0-9, ~!@#$%^&*-=>", 
	 "category" : "<category_id>",
         "images" : "example_image_url",
	 "is_delivery_included": "<True or False>",
	 "price": "int",
         "location": "somewhere ",
         "seller": "<user_id>",
         "buyers": "<user_id>",
         "description": "this furniture is great!",
    }
}

Category

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

Contact form

{
    "contact_form_id": {	
        "buyer": "<user_id>",
        "seller": "<user_id>",
        "furniture":"<furniture_id>",
        "content":"Hi I like your furniture!"
    }
}

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

Clone this wiki locally