Skip to content

Instantly share code, notes, and snippets.

@alexb4a
Created September 1, 2023 14:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexb4a/e4c72dd363ce938b2e83a6f6e0b4511d to your computer and use it in GitHub Desktop.
Save alexb4a/e4c72dd363ce938b2e83a6f6e0b4511d to your computer and use it in GitHub Desktop.
Prompts from the eCommerce App Webinar
User
Please in my Back4app account create a new App named eCommerce
User
Into this App create a data structure to hold the categories of products. A category is a name and a few examples of categories are:
- health
- books
- games
- tools
- cellphones
- shoes
- best sellers
- clothes
After you create the data structure to hold the categories, please populate it with at least 10 distinct categories.
User
That looks good. Now lets create a data structure to hold Products.
A product record should have a name, a description, a price and a sold quantity.
An example of a product would be:
Name: iPhone
Description: An cellphone made by Apple
Price: 500.59
Sold Quantity: 10
A product should belong to a Category so when I filter by categories, I can find the products that belong to that category.
When I select a specific category, I should be able somehow to find all products that belong to that category.
For the given example, the product named iPhone should belong to the cellphones category.
After you create this data structure, please populate it with at least 20 full examples of data.
User
From this app, tell me how much a Gaming Mouse costs and in which category it fits.
User
That also look good.
Now let's create a data structure to hold some reviews about the products.
A product should be able to have many reviews about it.
A review should have a title, a description text and a number of starts between 1 and 5, telling how good the product is. A bad product should have 1 star, while a very good one, should have five.
Once you create the data structure for it, please fill it up with at least 2 reviews for 5 random products of your choice.
User
This too looks very good.
Now let's create some cloud code.
Please create a Cloud Code Function that retrieves the 10 products that has the most sells.
Once you create such cloud code, publish it to Back4app.
User
This worked like a charm.
Now let's write another Cloud Code Function that retrieves the products that people really like.
Please write a function that retrieves all products details that have 5 star reviews.
User
This code didn't work.
It returned an empty array where I expected an array containing products that have 5 star reviews.
User
This worked. Thank you.
Now let's create a front end website to consume this App.
Please create a HTML page that has a SELECT html control listing the categories. All categories should be listed into this dropdown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment