-
Notifications
You must be signed in to change notification settings - Fork 0
Data Model
Benjamin Ohene-Adu edited this page May 17, 2025
·
1 revision
This page documents the core data model for the TasteLocal app, which connects users to local food vendors. The model supports customer ordering, vendor management, reviews, payments, and rich cultural content.
-
id: Unique identifier nameemailphonepassword_hash-
role(customer, vendor, admin) preferred_language-
address(or addresses) -
location(latitude, longitude) -
order_history(list of Orders)
idnamedescription-
location(latitude, longitude) -
menu_items(list of MenuItems) -
delivery_areas(geo-coordinates or polygons) -
ratings(average, count) -
reviews(list of Reviews) photos
idvendor_idnamedescriptionpricephoto_url-
category(e.g., Waakye, Fufu) preparation_story-
available(boolean)
iduser_idvendor_id-
items(list of MenuItems + quantity) total_price-
status(pending, confirmed, delivered, cancelled) delivery_addressdelivery_timepayment_methodpayment_status
iduser_idvendor_idorder_id-
rating(1-5) commenttimestamp
iddish_namehistorypreparation_detailspairing_suggestionsmedia_url
idnameemailpermissions
erDiagram
USER {
int id
string name
string email
string phone
string password_hash
string role
string preferred_language
string address
float location_lat
float location_long
}
VENDOR {
int id
string name
string description
float location_lat
float location_long
string delivery_areas
float ratings
int ratings_count
}
MENUITEM {
int id
int vendor_id
string name
string description
float price
string photo_url
string category
string preparation_story
boolean available
}
"ORDER" {
int id
int user_id
int vendor_id
float total_price
string status
string delivery_address
datetime delivery_time
string payment_method
string payment_status
}
ORDERITEM {
int id
int order_id
int menuitem_id
int quantity
}
REVIEW {
int id
int user_id
int vendor_id
int order_id
int rating
string comment
datetime timestamp
}
CULTURALCONTENT {
int id
string dish_name
string history
string preparation_details
string pairing_suggestions
string media_url
}
ADMIN {
int id
string name
string email
string permissions
}
USER ||--o{ "ORDER" : places
USER ||--o{ REVIEW : writes
VENDOR ||--o{ MENUITEM : offers
VENDOR ||--o{ REVIEW : receives
VENDOR ||--o{ "ORDER" : receives
"ORDER" ||--o{ ORDERITEM : contains
MENUITEM ||--o{ ORDERITEM : part_of
"ORDER" ||--|{ REVIEW : has
CULTURALCONTENT ||--o{ MENUITEM : relates_to
- OrderItems is introduced as a join table to support multiple menu items per order.
- CulturalContent can be linked to menu items by dish name or foreign key.
- Admin is included for completeness but may be merged with User if only differentiated by role/permissions.
Feel free to expand this wiki with additional tables or relationships as your app grows!