Adding New Catalog Entities
Relevant source files
The following files were used as context for generating this wiki page:
- implementation_plan.md
- sunrise-angular/src/app/core/services/seo.service.ts
- sunrise-angular/src/app/pages/products/product-detail/product-detail.component.html
- sunrise-backend/products/templates/admin/products/product/upload_json.html
- sunrise-angular/public/llms.json
- sunrise-angular/src/app/core/constants/seo-data.ts
This guide details the procedures and data structures required to add new entities to the Sunrise Communication Products & Solutions Catalog. The catalog currently serves as a lead-generation tool for hardware like CCTV, EPABX, and Biometrics, utilizing a dual-layer approach involving a frontend JSON asset and a future Django REST API backend.
Sources: implementation_plan.md:9-12, sunrise-angular/public/llms.json:67-85
Catalog Data Model
Catalog entities follow a strict TypeScript interface to ensure consistency across the catalog page, detail views, and SEO services. The model preserves display order for technical specifications and enforces safety through union literal types for service offerings.
Product Data Structure
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the entity. |
slug | string | URL-safe name (e.g., "cp-plus-4mp-dome-camera"). |
name | string | Full display name of the product. |
brand | string | Manufacturer name (e.g., "CP Plus", "Hikvision"). |
category | string | Display category (e.g., "CCTV"). |
category_slug | string | URL-safe category segment (e.g., "cctv"). |
specs | ProductSpec[] | Array of key-value technical specifications. |
services_offered | ServiceType[] | Array containing 'Sales', 'Installation', 'AMC', or 'Repair'. |
Sources: implementation_plan.md:68-100, sunrise-backend/products/templates/admin/products/product/upload_json.html:56-66
Data Flow for New Entities
The system supports two ingestion methods: manual addition to the local products.json file for the Angular frontend and bulk uploading via the Django Admin interface for the backend.
The ProductService currently fetches data from /assets/data/products.json using Angular's HttpClient with SSR transfer state support.
Sources: implementation_plan.md:120-143, sunrise-backend/products/templates/admin/products/product/upload_json.html:15-20
Bulk Import via Django Admin
Administrators can add entities in bulk by uploading a JSON file through the custom admin template. This process automatically populates categories, brands, products, and their associated technical specifications.
Import Configuration
- JSON File: Must contain an array of product objects matching the schema.
- Clear Existing: A checkbox option (
clear_existing) allows developers to wipe the current table before importing new data. - Validation: The backend validates fields like
category_slugandservices_offeredto ensure compatibility with frontend routing.
Sources: sunrise-backend/products/templates/admin/products/product/upload_json.html:20-40
Metadata and SEO Integration
When a new entity is added, the SeoService must be updated or invoked to generate the necessary search engine and AI agent visibility tags.
Automated Graph Injection
The updateForProduct method in SeoService generates a unified JSON-LD @graph for every new entity. This includes:
- Product Schema: Defines name, brand, image, and availability.
- BreadcrumbList: Maps the hierarchy
Home → Products → Category → Product. - LocalBusiness: Links the product to Sunrise Communication's physical location and reputation.
Manual SEO Entries
For high-level category pages, new entries should be added to seo-data.ts to provide static descriptions and keywords that target specific regional markets like Thane, Mumbai, and Navi Mumbai.
Sources: sunrise-angular/src/app/core/constants/seo-data.ts:50-55
Image and Brand Assets
If real images are not available when adding a new entity, the system employs a CSS-generated placeholder strategy. This prevents broken image links and maintains a professional aesthetic.
- Product Placeholders: Use CSS gradients based on the
category_slug(e.g., dark blue for CCTV). - Brand Logos: If
brand_logo_urlis empty, the template renders a styled text badge. - Icon Mapping: The
getCategoryIconfunction assigns a specific icon (like a camera for CCTV) based on the category slug.
Sources: implementation_plan.md:214-235, sunrise-angular/src/app/pages/products/product-detail/product-detail.component.html:36-46
Summary of Steps
- Define Entity: Create the JSON object following the
Productinterface. - Asset Placement: Add the object to
src/assets/data/products.jsonor upload via the Django Admin JSON upload tool. - Verify Routing: Ensure the
slugandcategory_slugcorrectly form the URL/products/:category/:slug. - SEO Check: Confirm that
SeoServicecorrectly generates theProductschema and JSON-LD graph in the rendered HTML source. - CTA Verification: Validate that the WhatsApp inquiry link includes the new product name and the current page URL.
Sources: implementation_plan.md:420-440, sunrise-angular/src/app/pages/products/product-detail/product-detail.component.html:86-103