# salesforcelabs/b2b-le-featured-products architecture

> Architecture diagram of the GitHub repository salesforcelabs/b2b-le-featured-products, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/salesforcelabs/b2b-le-featured-products
- Repository: https://github.com/salesforcelabs/b2b-le-featured-products

## Overview

##### Main Components

a. Frontend Layer:
- Lightning Web Components (LWC)
- b2bFeaturedProducts (main component)
- b2bFeaturedProductsPreview (preview component)
- Static Resources
- B2B_LE_Pictures (image resources)

b. Backend Layer:
- Apex Controllers
- B2B_FeaturedProducts_Controller
- Security Utils
- Feature Products Util
- Custom Labels
- Permission Sets

##### Component Relationships

User Interface Layer:
**[B2B Featured Products LWC] ←→ [Preview Component]**
- ↓
**[Static Resources (Images)]**
- ↓

Business Logic Layer:
**[Featured Products Controller]**
- ↓
**[Security Utils] ←→ [Feature Products Util]**
- ↓

Security Layer:
**[Permission Sets]**

##### Important Elements to Highlight

- Security layer integration with B2B_FeaturedProducts_SecurityUtils
- Component communication between main and preview LWCs
- Controller-utility class relationships
- Static resource usage in the UI components
- Permission set controls

##### Technical Notes

Annotations for:
- Salesforce B2B LE context
- Lightning Web Component framework usage
- Apex security enforcement points
- Static resource management

Remember to include version information and any specific Salesforce platform dependencies that might affect the component's functionality or deployment.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef security fill:#f1c40f,stroke:#f39c12,color:black
    classDef static fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef config fill:#9b59b6,stroke:#8e44ad,color:white
    classDef test fill:#e74c3c,stroke:#c0392b,color:white

    %% Frontend Layer
    subgraph Frontend
        B2B["B2B Featured Products LWC"]
        Preview["Preview Component"]
        StaticRes["Static Resources (Images)"]
    end

    %% Backend Layer
    subgraph Backend
        Controller["Featured Products Controller"]
        SecUtils["Security Utils"]
        FeatUtils["Feature Products Util"]
    end

    %% Security Layer
    subgraph Security
        PermSets["Permission Sets"]
        CustomLabels["Custom Labels"]
    end

    %% Test Layer
    subgraph Testing
        ControllerTest["Controller Test"]
        ControllerTestUtils["Controller Test Utils"]
        UtilTest["Utility Test"]
    end

    %% Relationships
    B2B <--> Preview
    B2B --> StaticRes
    B2B --> Controller
    Preview --> Controller
    Controller --> SecUtils
    Controller --> FeatUtils
    SecUtils --> PermSets
    B2B --> CustomLabels
    Preview --> CustomLabels

    %% Test Relationships
    ControllerTest --> Controller
    ControllerTest --> ControllerTestUtils
    UtilTest --> FeatUtils

    %% Styling
    class B2B,Preview frontend
    class Controller,SecUtils,FeatUtils backend
    class PermSets security
    class StaticRes static
    class CustomLabels config
    class ControllerTest,ControllerTestUtils,UtilTest test

    %% Click Events
    click B2B "https://github.com/SalesforceLabs/B2B-LE-Featured-Products/tree/main/lwc/b2bFeaturedProducts"
    click Preview "https://github.com/SalesforceLabs/B2B-LE-Featured-Products/tree/main/lwc/b2bFeaturedProductsPreview"
    click Controller "https://github.com/SalesforceLabs/B2B-LE-Featured-Products/blob/main/classes/B2B_FeaturedProducts_Controller.cls"
    click SecUtils "https://github.com/SalesforceLabs/B2B-LE-Featured-Products/blob/main/classes/B2B_FeaturedProducts_SecurityUtils.cls"
    click FeatUtils "https://github.com/SalesforceLabs/B2B-LE-Featured-Products/blob/main/classes/B2B_FeaturedProducts_Util.cls"
    click StaticRes "https://github.com/SalesforceLabs/B2B-LE-Featured-Products/blob/main/staticresources/B2B_LE_Pictures.resource"
    click PermSets "https://github.com/SalesforceLabs/B2B-LE-Featured-Products/blob/main/permissionsets/B2B_Featured_Products_Component.permissionset"
    click CustomLabels "https://github.com/SalesforceLabs/B2B-LE-Featured-Products/blob/main/labels/CustomLabels.labels"
    click ControllerTest "https://github.com/SalesforceLabs/B2B-LE-Featured-Products/blob/main/classes/B2B_FeaturedProducts_ControllerTest.cls"
    click ControllerTestUtils "https://github.com/SalesforceLabs/B2B-LE-Featured-Products/blob/main/classes/B2B_FeaturedProducts_ControllerTestUtils.cls"
    click UtilTest "https://github.com/SalesforceLabs/B2B-LE-Featured-Products/blob/main/classes/B2B_FeaturedProducts_UtilTest.cls"
```
