1.
Users:
user_id (primary key)
username
email (unique)
password_hash
dietary_restrictions (optional)
2. Food Items:
food_id (primary key)
name
description
brand
3. Nutrients:
nutrient_id (primary key)
nutrient_name (e.g., "Carbs", "Protein", "Fat")
unit (e.g., "g", "%")
4. Food_Nutrients:
food_id (foreign key)
nutrient_id (foreign key)
quantity
Relationships:
• One user can have many searches (one-to-many).
• One food item can have many nutrients (many-to-many).
• One nutrient can be associated with many food items (many-to-
many).
Functionalities:
• Login/Registration: Use the Users table for authentication.
• Home Page Search: Search Food Items based on various criteria as
before, including ingredients, brand, etc. Include the ability to filter by
nutrient range (e.g., "high protein").
• Recommended Food: Analyse user searches and preferences to
identify commonly searched nutrients and recommend food items rich in
those nutrients through the Food_Nutrients table.
• Sorting: Implement sorting by various criteria, including nutrient
content.