Build a Shopping App - Step by Step
In this tutorial, we'll build a complete e-commerce app with:
- Product listing with images and prices
- Shopping cart with quantity controls
- Coupon code support
- Order tracking
Step 1: Create Variables
Create these variables in your project:
- products (array): Your product catalog
- cart (array): Items in the shopping cart
- cartCount (number): Number of items in cart
- couponCode (string): Entered coupon code
- orderStatus (number): Current order step
Step 2: Products Screen
- Add a Container as the root
- Add a header with Text ("Our Shop") and CartBadge (variableId: cartCount)
- Add a List bound to "products" variable
- Inside the list pattern, use ProductCard with:
- title, price, image bound to item properties
- onAddToCart event → flow that pushes item to cart array
Add to Cart Flow:event → arrayPush(variableId: "cart", sourceVariableId: "currentItem") → arrayLength(variableId: "cart", resultVariableId: "cartCount") → showToast("Added to cart!")
Step 3: Cart Screen
- Add a List bound to "cart" variable
- For each item, show the product name and a QuantityStepper
- Add a CouponInput at the bottom (onApply → validate coupon flow)
- Add a PriceTag showing the total
- Add a "Checkout" Button
event → showConfirm("Place Order?", "Total: $99.00") → [true] setVariable(orderStatus, 0) → navigate(order-tracking) → [false] (nothing)
Step 4: Order Tracking Screen
- Add an OrderTracker component with:
- steps: "Ordered, Confirmed, Shipped, Out for Delivery, Delivered"
- variableId: "orderStatus"
- Add a "Track Order" button that increments orderStatus
event → mathOperation(add, variableIdA: "orderStatus", valueB: "1", resultVariableId: "orderStatus")
Step 5: Polish & Build
- Add a theme with your brand colors
- Add navigation between screens
- Test with Preview mode
- Build your APK!
That's it! A complete shopping app built entirely without code. Start building at mobcraft.in.