E-commerce
Build with AI Agent
E-commerce Backend

E-commerce Backend App Template
Product Catalog, SKU Variations, and Order Processing

A production-ready e-commerce backend on Back4app with products, SKUs, orders, and customer management. Includes ER diagram, data dictionary, JSON schema, API playground, and an AI Agent prompt for rapid bootstrap.

Key Takeaways

This template offers an e-commerce backend with products, SKUs, orders, and customer management so your team can focus on sales and fulfillment flows.

  1. Product-centric schema designModel products with SKUs, variations, and inventory in clear, queryable structures.
  2. Real-time order processingUse Back4app's real-time capabilities for order updates and notifications.
  3. Customer managementManage customer profiles and order histories with secure access controls.
  4. Order and inventory featuresAllow customers to place orders and track inventory seamlessly.
  5. Cross-platform e-commerce backendServe mobile and web clients through a single REST and GraphQL API for products, SKUs, orders, and customers.

What Is the E-commerce Backend App Template?

Back4app is a backend-as-a-service (BaaS) for fast product delivery. The E-commerce Backend App Template is a pre-built schema for products, SKUs, orders, and customers. Connect your preferred frontend (React, Flutter, Next.js, and more) and ship faster.

Best for:

E-commerce applicationsOnline retail platformsOrder and inventory managementMobile-first shopping appsMVP launchesTeams selecting BaaS for e-commerce products

Overview

An e-commerce product needs product catalogs, SKUs, orders, and customer management.

This template defines Product, SKU, Order, and Customer with real-time features and ownership rules so teams can implement e-commerce interactions quickly.

Core E-commerce Features

Every technology card in this hub uses the same e-commerce backend schema with Product, SKU, Order, and Customer.

Product catalog and SKUs

Product class stores name, description, price, and SKU variations.

Order creation and management

Order class links customer, items, and status.

Customer profiles

Customer class stores name, email, and address.

Inventory management

SKU class tracks product variations and stock levels.

Real-time order notifications

Notify customers about order status changes in real-time.

Why Build Your E-commerce Backend with Back4app?

Back4app gives you product, SKU, order, and customer management primitives so your team can focus on sales and fulfillment instead of infrastructure.

  • Product and SKU management: Product class with SKU variations supports detailed catalog management.
  • Order and customer features: Manage orders with statuses and allow customers to track their purchases easily.
  • Realtime + API flexibility: Use Live Queries for order updates while keeping REST and GraphQL available for every client.

Build and iterate on e-commerce features quickly with one backend contract across all platforms.

Core Benefits

An e-commerce backend that helps you iterate quickly without sacrificing structure.

Rapid e-commerce launch

Start from a complete product, SKU, and order schema rather than designing backend from zero.

Real-time order support

Leverage real-time order updates and notifications for enhanced customer engagement.

Clear inventory flow

Manage product variations and stock levels with real-time updates.

Scalable permission model

Use ACL/CLP so only customers can view their profiles and orders, and manage inventory securely.

Order and customer data

Store and aggregate orders and customer profiles for personalized shopping experiences.

AI bootstrap workflow

Generate backend scaffolding and integration guidance fast with one structured prompt.

Ready to launch your e-commerce app?

Let the Back4app AI Agent scaffold your e-commerce backend and generate products, SKUs, orders, and customers from one prompt.

Free to start — 50 AI Agent prompts/month, no credit card required

Technical Stack

Everything included in this e-commerce backend template.

Frontend
13+ technologies
Backend
Back4app
Database
MongoDB
Auth
Built-in auth + sessions
API
REST and GraphQL
Realtime
Live Queries

ER Diagram

Entity relationship model for the e-commerce backend schema.

View diagram source
Mermaid
erDiagram
    User ||--o{ Order : "user"
    User ||--o{ Cart : "user"
    Product ||--o{ SKU : "product"
    Order ||--o{ Product : "products"
    Cart ||--o{ SKU : "items"

    User {
        String objectId PK
        String username
        String email
        String password
        String address
        Date createdAt
        Date updatedAt
    }

    Product {
        String objectId PK
        String name
        String description
        Number price
        Date createdAt
        Date updatedAt
    }

    Order {
        String objectId PK
        Pointer user FK
        Array products
        Number total
        String status
        Date createdAt
        Date updatedAt
    }

    SKU {
        String objectId PK
        Pointer product FK
        String variation
        Number stock
        Date createdAt
        Date updatedAt
    }

    Cart {
        String objectId PK
        Pointer user FK
        Array items
        Number total
        Date createdAt
        Date updatedAt
    }

Integration Flow

Typical runtime flow for auth, product catalog, SKUs, orders, and customer management.

View diagram source
Mermaid
sequenceDiagram
  participant User
  participant App as E-commerce Backend App
  participant Back4app as Back4app Cloud

  User->>App: Login
  App->>Back4app: POST /login
  Back4app-->>App: Session token

  User->>App: Browse products
  App->>Back4app: GET /classes/Product
  Back4app-->>App: Product list

  User->>App: Add to cart
  App->>Back4app: POST /classes/Cart
  Back4app-->>App: Cart updated

  User->>App: Place order
  App->>Back4app: POST /classes/Order
  Back4app-->>App: Order confirmation

Data Dictionary

Full field-level reference for every class in the e-commerce schema.

FieldTypeDescriptionRequired
objectIdStringAuto-generated unique identifierAuto
usernameStringUser login name
emailStringUser email address
passwordStringHashed password (write-only)
addressStringUser shipping address
createdAtDateAuto-generated creation timestampAuto
updatedAtDateAuto-generated last-update timestampAuto

7 fields in User

Security and Permissions

How ACL and CLP strategy secures products, SKUs, orders, and customer data.

Customer-owned profile controls

Only the customer can update or delete their profile; others cannot modify customer content.

Order integrity

Only the customer can create or delete their orders. Use Cloud Code for validation.

Scoped read access

Restrict product and order reads to relevant parties (e.g. customers see their own orders and public products).

Schema (JSON)

Raw JSON schema definition ready to copy into Back4app or use as implementation reference.

JSON
{
  "classes": [
    {
      "className": "User",
      "fields": {
        "objectId": {
          "type": "String",
          "required": false
        },
        "username": {
          "type": "String",
          "required": true
        },
        "email": {
          "type": "String",
          "required": true
        },
        "password": {
          "type": "String",
          "required": true
        },
        "address": {
          "type": "String",
          "required": false
        },
        "createdAt": {
          "type": "Date",
          "required": false
        },
        "updatedAt": {
          "type": "Date",
          "required": false
        }
      }
    },
    {
      "className": "Product",
      "fields": {
        "objectId": {
          "type": "String",
          "required": false
        },
        "name": {
          "type": "String",
          "required": true
        },
        "description": {
          "type": "String",
          "required": false
        },
        "price": {
          "type": "Number",
          "required": true
        },
        "createdAt": {
          "type": "Date",
          "required": false
        },
        "updatedAt": {
          "type": "Date",
          "required": false
        }
      }
    },
    {
      "className": "Order",
      "fields": {
        "objectId": {
          "type": "String",
          "required": false
        },
        "user": {
          "type": "Pointer",
          "required": true,
          "targetClass": "User"
        },
        "products": {
          "type": "Array",
          "required": true
        },
        "total": {
          "type": "Number",
          "required": true
        },
        "status": {
          "type": "String",
          "required": true
        },
        "createdAt": {
          "type": "Date",
          "required": false
        },
        "updatedAt": {
          "type": "Date",
          "required": false
        }
      }
    },
    {
      "className": "SKU",
      "fields": {
        "objectId": {
          "type": "String",
          "required": false
        },
        "product": {
          "type": "Pointer",
          "required": true,
          "targetClass": "Product"
        },
        "variation": {
          "type": "String",
          "required": true
        },
        "stock": {
          "type": "Number",
          "required": true
        },
        "createdAt": {
          "type": "Date",
          "required": false
        },
        "updatedAt": {
          "type": "Date",
          "required": false
        }
      }
    },
    {
      "className": "Cart",
      "fields": {
        "objectId": {
          "type": "String",
          "required": false
        },
        "user": {
          "type": "Pointer",
          "required": true,
          "targetClass": "User"
        },
        "items": {
          "type": "Array",
          "required": true
        },
        "total": {
          "type": "Number",
          "required": true
        },
        "createdAt": {
          "type": "Date",
          "required": false
        },
        "updatedAt": {
          "type": "Date",
          "required": false
        }
      }
    }
  ]
}

Build with AI Agent

Use the Back4app AI Agent to generate a real e-commerce app from this template, including frontend, backend, auth, and product, SKU, order, and customer flows.

Back4app AI Agent
Ready to build
Create an e-commerce app backend on Back4app with this exact schema and behavior.

Schema:
1. Product: name (String, required), description (String), price (Number, required); objectId, createdAt, updatedAt (system).
2. SKU: product (Pointer to Product, required), variation (String), stock (Number); objectId, createdAt, updatedAt (system).
3. Order: customer (Pointer to Customer, required), items (Array of Pointers to SKU, required), status (String, required); objectId, createdAt, updatedAt (system).
4. Customer: name (String, required), email (String, required), address (String); objectId, createdAt, updatedAt (system).

Security:
- Only the customer can update/delete their profile. Only the customer can create/delete their orders. Use Cloud Code for validation.

Auth:
- Sign-up, login, logout.

Behavior:
- List products, create orders, manage inventory, and update customer profiles.

Deliver:
- Back4app app with schema, ACLs, CLPs; frontend for product catalog, SKUs, orders, and customer management.

Press the button below to open the Agent with this template prompt pre-filled.

This is the base prompt without a technology suffix. You can adapt the generated frontend stack afterward.

Deploy in minutes50 free prompts / monthNo credit card required

API Playground

Try REST and GraphQL endpoints against the e-commerce schema. Responses use mock data and do not require a Back4app account.

Loading playground…

Uses the same schema as this template.

Choose Your Technology

Expand each card for integration steps, state patterns, data model examples, and offline notes.

Flutter E-commerce Backend

React E-commerce Backend

React Native E-commerce Backend

Next.js E-commerce Backend

JavaScript E-commerce Backend

Android E-commerce Backend

iOS E-commerce Backend

Vue E-commerce Backend

Angular E-commerce Backend

GraphQL E-commerce Backend

REST API E-commerce Backend

PHP E-commerce Backend

.NET E-commerce Backend

What You Get with Every Technology

Every stack uses the same e-commerce backend schema and API contracts.

Unified e-commerce product schema

Easily manage products, SKUs, and inventory in one place.

Real-time order tracking for e-commerce

Keep customers informed with live updates on their orders.

Secure payment processing for e-commerce

Integrate trusted payment gateways for safe transactions.

Flexible REST/GraphQL APIs

Seamlessly connect your frontend with powerful APIs.

Customer management dashboard

Gain insights into customer behavior and preferences.

Extensible backend for e-commerce

Easily customize and scale your backend as needed.

Ecommerce Backend Framework Comparison

Compare setup speed, SDK style, and AI support across all supported technologies.

FrameworkSetup TimeEcommerce Backend BenefitSDK TypeAI Support
~5 minSingle codebase for ecommerce backend on mobile and web.Typed SDKFull
About 5 minFast web dashboard for ecommerce backend.Typed SDKFull
Under 5 minutesCross-platform mobile app for ecommerce backend.Typed SDKFull
~3–7 minServer-rendered web app for ecommerce backend.Typed SDKFull
Under 5 minLightweight web integration for ecommerce backend.Typed SDKFull
~5 minNative Android app for ecommerce backend.Typed SDKFull
About 5 minNative iOS app for ecommerce backend.Typed SDKFull
Under 5 minutesReactive web UI for ecommerce backend.Typed SDKFull
~3–7 minEnterprise web app for ecommerce backend.Typed SDKFull
~2 minFlexible GraphQL API for ecommerce backend.GraphQL APIFull
Under 2 minREST API integration for ecommerce backend.REST APIFull
~3–5 minServer-side PHP backend for ecommerce backend.REST APIFull
Under 5 minutes.NET backend for ecommerce backend.Typed SDKFull

Setup time reflects expected duration from project bootstrap to first catalog query using this template schema.

Frequently Asked Questions

Common questions about building an e-commerce backend with this template.

What is an e-commerce backend?
What does the E-commerce Backend template include?
Why use Back4app for an e-commerce app?
How do I run queries for products and SKUs with Flutter?
How do I create an order with Next.js server actions?
Can React Native cache products and SKUs offline?
How do I prevent duplicate orders?
What is the best way to show product catalogs and SKUs on Android?
How does the order processing flow work end-to-end?

Trusted by developers worldwide

Join teams shipping e-commerce products faster with Back4app templates

G2 Users Love Us Badge

Ready to Build Your E-commerce App?

Start your e-commerce project in minutes. No credit card required.

Choose Technology