๐Ÿ™๏ธ San Diego โ€” CREATE (CRUD Submodule 1)

Quest Chapter: The Food Route


Focus: C in CRUD โ€” CREATE


Location: San Diego, CA โ˜€๏ธ๐ŸŒฎ


Welcome! This interactive page lets learners actually create dishes, ingredients, and join records via simulated API calls โ€” right in the browser.


๐ŸŽฏ San Diego Progress Tracker

๐ŸŒฎ Fish Tacos (Baja-style) - Incomplete
๐ŸŒฏ California Burrito - Incomplete
๐ŸŸ Carne Asada Fries - Incomplete
๐Ÿ‡ Acai Bowls - Incomplete
๐Ÿฅ— Baja Bowl - Incomplete
๐ŸŸ Baja Seafood - Incomplete
Completion: 0%
Fish Tacos created โ€” +15 XP
๐ŸŽ‰ Los Angeles Unlocked!
You can now continue to the next city!
  • ๐Ÿง  What Does CREATE Mean?
    • In databases, CREATE = inserting new records (e.g., dishes, ingredients, or join rows).

    • On the web, a client form sends a POST /api/dishes request.

    • The server creates:
      • a new dish record,
      • any missing ingredient entries, and
      • dish_ingredients join records โ€” ideally inside a single transaction (all succeed or all fail).

    • Analogy: your database is like a kitchen pantry. Adding a dish = adding a recipe card and ensuring all the required ingredients already exist in the pantry.

%% Interactive: Mock Backend & Utilities

Initialization: Resets mock DB (localStorage) โ€” use this to start fresh.
Terminal: ready

๐ŸŒฎ Fish Tacos (Baja-style) CREATE
Create a Fish Taco class with properties (id, fishType, toppings, sauce, price, spiceLevel) and method calculateTotalPrice() with 8% tax. Validate fishType is required.

    
    
๐Ÿงฉ Quick Quiz:

1๏ธโƒฃ Why validate fishType in the constructor?



๐ŸŒฏ California Burrito CREATE
Implement CaliforniaBurrito class with properties (id, protein, hasFries, size, extras, price) and method calculateCalories(). Fries are what make it "California style"!

    
    
๐Ÿงฉ Quick Quiz:

1๏ธโƒฃ What makes a burrito "California style"?



๐ŸŸ Carne Asada Fries CREATE
Build a CarneAsadaFries class with properties (id, friesType, meatPortion, toppings, cheeseType, price) and method isLoaded() that checks if it has at least 3 toppings.

    
    
๐Ÿงฉ Quick Quiz:

1๏ธโƒฃ What makes fries "loaded" in this implementation?



๐Ÿ‡ Acai Bowls CREATE
Create an AcaiBowl class with properties (id, size, baseIngredients, toppings, granola, price) and methods calculateNutritionScore() and isHealthy().

    
    
๐Ÿงฉ Quick Quiz:

1๏ธโƒฃ What determines if an acai bowl is "healthy" in this code?



๐Ÿฅ— Baja Bowl CREATE via API
Use the form to CREATE a Baja Bowl via our mock API! Fill in the details and make a POST request to simulate database insertion.
No ingredients yet
๐ŸŸ Baja Seafood CREATE Collection
Create a collection of Baja seafood dishes and bulk insert them into the database using POST /api/dishes/bulk

    
    
๐Ÿงฉ Quick Quiz:

1๏ธโƒฃ What's the main benefit of bulk CREATE operations?




๐ŸŽ‰ Module Complete โ€” San Diego CREATE Mastery

Congratulations! Youโ€™ve mastered CREATE operations through San Diegoโ€™s finest foods:

  • ๐ŸŒฎ Fish Tacos: Class creation with validation
  • ๐ŸŒฏ California Burrito: Complex object construction
  • ๐ŸŸ Carne Asada Fries: Method-based data validation
  • ๐Ÿ‡ Acai Bowls: Health scoring algorithms
  • ๐Ÿฅ— Baja Bowl: API form submission
  • ๐ŸŸ Baja Seafood: Bulk creation operations

Los Angeles โ€” READ module unlocked! ๐ŸŒ† Continue to learn querying and data retrieval!