Product & Catalog Management
Relevant source files
The following files were used as context for generating this wiki page:- packages/common/src/entities/Product.ts
- packages/common/src/entities/ProductsCategory.ts
- packages/admin-web-angular/src/app/pages/+fakeData/fakeData.component.ts
- packages/admin-web-angular/src/app/@shared/warehouse-product/warehouse-product-create/warehouse-product-create.component.ts
- packages/admin-web-angular/src/assets/i18n/en-US.json
- README.md
The Ever Demand platform features a robust system for managing a global product catalog and associating those products with specific merchants or warehouses. This headless commerce framework supports both single-store and multi-vendor marketplace models. The core of this system is a global catalog of Product entities that can be categorized and then assigned to individual Warehouse entities, which represent merchant stores.
This system allows for centralized product information management while giving merchants control over their specific inventory, pricing, and availability. Products are defined with multi-lingual titles, descriptions, details, and multiple images. They are then organized using a hierarchical ProductsCategory structure. The Admin UI provides tools for creating, editing, and managing these products and their association with warehouses.
Sources: README.md, packages/common/src/entities/Product.ts, packages/admin-web-angular/src/app/@shared/warehouse-product/warehouse-product-create/warehouse-product-create.component.ts
Core Data Models
The product catalog is built upon two primary data entities: Product and ProductsCategory. These entities define the structure of all items available for sale within the platform.
Entity Relationship Diagram
The diagram below illustrates the relationship between Products and their Categories. A product can belong to multiple categories.
Product Entity
The Product entity represents an item in the global product catalog. It contains all the descriptive information about a product, independent of any specific merchant. Note that merchant-specific details like price and stock count are managed in the WarehouseProduct entity, not here.
Sources: packages/common/src/entities/Product.ts
Product Class Diagram
This diagram shows the structure of the Product class.
Product Attributes
| Field | Type | Description |
|---|---|---|
title | IProductTitle[] | An array for multi-lingual product titles. |
description | IProductDescription[] | An array for multi-lingual short descriptions. |
descriptionHTML | IProductDescriptionHTML[] | An array for HTML content of short descriptions. |
details | IProductDetails[] | An array for multi-lingual long descriptions. |
detailsHTML | IProductDetailsHTML[] | An array for HTML content of long descriptions. |
images | IProductImage[] | An array of product images. |
categories | IProductsCategory[] | A reference to the categories the product belongs to. |
isDeleted | boolean | A soft-delete flag. Default is false. |
isProductAvailable | boolean | A flag to indicate if the product is generally available. Default is true. |
Sources: packages/common/src/entities/Product.ts:32-88
ProductsCategory Entity
The ProductsCategory entity is used to organize products into a hierarchical structure. Categories can have a parent, allowing for nested classifications.
Sources: packages/common/src/entities/ProductsCategory.ts
ProductsCategory Attributes
| Field | Type | Description |
|---|---|---|
name | IProductsCategoryName[] | An array for multi-lingual category names. |
image | string | URL for the category's representative image. |
parentId | string | The ID of the parent category, if any. |
isDeleted | boolean | A soft-delete flag. |
Sources: packages/common/src/entities/ProductsCategory.ts:24-41
Product Management Flow
Products can be created and managed through the Admin UI. The typical flow involves either creating a new product from scratch or selecting an existing product from the global catalog and adding it to a specific merchant's warehouse.
Adding Products to a Warehouse
The WarehouseProductCreateComponent in the admin panel provides a wizard for adding products to a store.
This flowchart shows the two main paths for adding a product to a warehouse.
Product Creation Sequence
This sequence diagram illustrates the process of creating a new product entity via the backend. The process is initiated from a client-side component, which calls a router service that communicates with the server's API.
Fake Data Generation
The fakeData.component.ts provides a powerful tool for populating the system with sample data, including products and categories. It uses various "fake data services" to generate realistic product information and then calls the respective routers to create the entities in the database.
This component demonstrates the creation of multiple products like "Peperoni & Mushroom pizza" and "Sushi & Caviar mix". It first generates product categories and then creates products associated with those categories.
// packages/admin-web-angular/src/app/pages/+fakeData/fakeData.component.ts:436-446
async createPeperoniAndMushroomPizzaProduct(
categories?: IProductsCategory[]
) {
this.isBtnDisabled.product1 = true;
this.loading.product1 = true;
const productCreateObject = await this.fakeDataProducts.getPeperoniAndMushroomPizzaCreateObject(
categories
);
this.peperoniAndMushroomPizzaProduct = await this.productRouter.create(
productCreateObject
);
// ...
}
Sources: packages/admin-web-angular/src/app/pages/+fakeData/fakeData.component.ts:436-446
UI and Internationalization (i18n)
The admin panel's user interface for product management is defined through various components and internationalization (i18n) files. The en-US.json file contains the English text labels for the product management section, confirming the features available to the admin user.
Key UI labels related to products:
PRODUCTS_VIEW: Main view for product management.DELETE: Button to delete products.CREATE: Button to create new products.
WAREHOUSE_VIEW.PRODUCTS_TAB: Tab within a warehouse/store view.ADD_PRODUCTS: Button to add products to the store.DELETE: Button to remove products from the store.- Columns:
IMAGE,TITLE,DESCRIPTION,CATEGORY,PRICE,QUANTITY,AVAILABILITY.
PRODUCT_TYPE_VIEW: View/modal for creating a new product type.- Fields:
Title,Picture Url,Description,Details,Price,CATEGORY,LANGUAGE.
- Fields:
Sources: packages/admin-web-angular/src/assets/i18n/en-US.json
Summary
The Product & Catalog Management system in Ever Demand is designed for flexibility and scalability. It decouples the global product definitions from merchant-specific inventory by using a central Product catalog. Products are richly defined with multi-lingual content and imagery, and can be organized into a nested category structure. The Admin UI provides comprehensive tools for managing this catalog and for empowering merchants to curate their own offerings from the global list, a key feature for the platform's multi-vendor and on-demand economy focus.
Sources: README.md, packages/common/src/entities/Product.ts, packages/admin-web-angular/src/app/@shared/warehouse-product/warehouse-product-create/warehouse-product-create.component.ts