Hi,
I would like to implement the following experience. In our Website we onboard chefs offering cooking classes.
I am designing the following entities and relationships.
Chef - Class 1:M
Chef - Menu: 1:M
Menu - Class: 1:1
Menu - Dish: M:M
Dish -Ingredient: M:M
User Story:
As a Chef I want to create my class offering on a web page so I can sell my classes.
Each Chef can create multiple classes, each class offers a menu which is made of different dishes which are made of different ingredients.
I am trying to figure out the best design to create a dynamic front-end and back-end as I cannot know upfront how many classes/menu/dishes/ingredients they want to offer.
I was thinking of a multistep form with expandable sections (up to down). Each section allows to add as many items as required by the chef (e.g. one menu with 3 dishes, out of which 1 with 5 ingredients and the other with 10 ingredients, the other menu with 2dishes, with 3 and 5 ingredients respectively)
High level the form should work as follows:
Step 1: Chef Personal Data
Chefs start by providing their personal data and click next
Step 2: Class Data
Each chef can create one ore more classes providing a series of attributes, like class name, class duration, etc. and click next. Each class needs to reference the Chef in the collection
Step 3: Menu Creation
For each class created in Step 2, the chef has to create 1 menu made of 1 or more dishes and related attributes (dish name, menu name etc). Each menu needs to have a refererence to one and only class. Each dish needs to have a reference to the related menu
Step 4: Ingredient Creation
For each dish created in Step 3 chef can provide many ingredients and related attributes (quantity user of measurement etc). Each ingredient needs to have a reference to the related dish.
I was thinking about the following collections:
Chef
Class
Menu
Dish
Ingredient
- 2 ref tables MenuToDish and DishToIngredient to manage the N:M cardinalities.
My point now is mainly if Wix/Corvid allows me to build front-end mechanisms. All these entities are created during the form itself and all the references need to be built real-time.
Front End:
How can I create a dynamic expandable portion of form?
Each section should have a “+” and the user should add as many elements in the same session as they want.
Back end
How can I keep on storing foreign keys in real-time as the user fills the form?
For example when the chef creates a menu, clicks next and new menu_id is generated in the menu collection. The same menu_id needs to be stored as a foreign key in the Dish Table at the end of the following step to allow linking Dishes and Menu. And so on and so forth till the end of the process to link all the different entities.
I hope I made my self clear enough:)
I would really appreciate any kind of input on how to approach this.
Thanks a lot!
Matteo