# srkchaithanya/urban-color-salesforce architecture

> Architecture diagram of the GitHub repository srkchaithanya/urban-color-salesforce, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/srkchaithanya/urban-color-salesforce
- Repository: https://github.com/srkchaithanya/urban-color-salesforce

## Overview

##### Project type and purpose
- It’s essentially a full-stack SaaS application built entirely on the Salesforce platform to handle customer relationships, sales orders, inventory tracking, and reporting for cosmetics retailers.

##### (logical) file structure
- Although the file tree only shows documentation and screenshots, we know a Salesforce project typically consists of:
- Metadata (Custom Objects, Fields, Record Types)
- Business Logic (Apex classes, Triggers)
- UI Layers (Lightning Components / Visualforce Pages)
- Configuration (Flows, Process Builders, Validation Rules)
- Security (Profiles, Permission Sets, Sharing Rules)
- Deployment artifacts would normally live in directories like “objects/”, “classes/”, “lwc/” or “aura/” in a real VCS repo.

##### Key insights from the README
- Focus areas: Customer management, Sales (order capture), Inventory management, Reports/Dashboards.
- Built on Salesforce’s standard objects (Account, Contact, Opportunity) plus custom objects for Products, Orders, Inventory.
- Likely uses Salesforce Sales Cloud features (Opportunity Stages, Price Books) and Service Cloud or custom Flows for stock updates.

##### Main components
a. Salesforce Platform
– Core CRM (standard objects)
– Custom Objects: Product__c, Order__c, Inventory__c, etc.
– Business Logic: Apex Classes & Triggers
– Automations: Flows, Process Builder, Validation Rules
– UI: Lightning Web Components (LWC) or Aura Components, Visualforce Pages
b. Data Layer
– Salesforce’s built-in database (SOQL / objects)
– (Optionally) External Data Sources via Salesforce Connect or External Objects
c. Integrations / External Services
– Payment Gateway API
– Shipping / Fulfillment API
– External Reporting or BI tools (if any)
– Google Drive link (for demos/documentation)
d. Users & Roles
– Store Manager, Sales Rep, Inventory Clerk – each with Profiles / Permission Sets

##### Relationships and interactions
- User browsers → Salesforce UI (Lightning pages)
- UI components ↔ Apex Controllers (LWC controllers or @AuraEnabled methods)
- Apex / Flows ↔ Salesforce Data (CRUD on standard & custom objects)
- Triggers / Batch Apex ↔ Inventory adjustments, Order processing
- Integration components (Apex callouts or Named Credentials) ↔ External payment/shipping services

##### Architectural patterns and principles
- MVC style separation: Lightning Components (View), Apex Controllers (Controller), Salesforce Database (Model)
- Event-driven automation: Platform Events, Process Flows for inventory updates
- Declarative vs. programmatic balance: “Clicks not code” for simple automations, Apex for complex logic
- Shared metadata deployment via Salesforce DX or Metadata API

b. Inside it, stack three horizontal tiers:
1) UI Tier: Lightning Components, Visualforce pages
2) Logic Tier: Apex Classes, Triggers, Flows, Process Builders
3) Data Tier: Standard & Custom Objects, Reports/Dashboards
c. Outside the rectangle, place external services:
– Payment Gateway, Shipping API, BI Tool, Google Drive (demo assets)
d. User personas at the top: Sales Rep, Store Manager, Inventory Clerk
e. Personas → UI Tier → Logic Tier → Data Tier → External Services (for callouts)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Personas
    SalesRep("Sales Rep"):::external
    StoreManager("Store Manager"):::external
    InventoryClerk("Inventory Clerk"):::external

    %% Salesforce Org Boundary
    subgraph "Salesforce Org (Urban-Color)"
        direction TB

        %% UI Tier
        subgraph "UI Tier" 
            direction TB
            LWC["Checkout LWC"]:::ui
            VF["Visualforce Pages"]:::ui
        end

        %% Logic Tier
        subgraph "Logic Tier"
            direction TB
            Apex["OrderProcessor Apex Class"]:::logic
            Triggers["Order & Inventory Triggers"]:::automation
            Flows["Inventory Update Flows"]:::automation
            ProcessBuilder["Process Builder Automations"]:::automation
        end

        %% Data Tier
        subgraph "Data Tier"
            direction TB
            StdObjs["Standard Objects (Account, Contact, Opportunity)"]:::data
            CustomObjs["Custom Objects (Product__c, Order__c, Inventory__c)"]:::data
            Reports["Reports & Dashboards"]:::data
        end
    end

    %% External Services
    PaymentGateway["Payment Gateway API"]:::external
    ShippingAPI["Shipping/Fulfillment API"]:::external
    BITool["BI Tool"]:::external
    GoogleDrive["Demo Assets (Google Drive)"]:::external
    ProjectDoc["Project Documentation"]:::doc
    DemoAssets["Detailed Design & Demo Assets"]:::doc
    UIMockups["UI Mockups & Screenshots"]:::doc

    %% Connections
    SalesRep -->|uses| LWC
    SalesRep -->|uses| VF
    StoreManager -->|uses| LWC
    StoreManager -->|uses| VF
    InventoryClerk -->|uses| LWC
    InventoryClerk -->|uses| VF

    LWC -->|"@AuraEnabled call"| Apex
    VF -->|"Apex Controller call"| Apex

    Apex -->|"SOQL CRUD"| StdObjs
    Apex -->|"SOQL CRUD"| CustomObjs
    Triggers -->|"on DML"| CustomObjs
    Flows -->|"declarative update"| CustomObjs
    ProcessBuilder -->|"process updates"| CustomObjs

    Apex -->|"callout"| PaymentGateway
    Apex -->|"callout"| ShippingAPI
    StdObjs -->|feeds| Reports
    CustomObjs -->|feeds| Reports
    BITool <-->|data export| Reports

    GoogleDrive -->|hosts| DemoAssets
    GoogleDrive -->|hosts| UIMockups
    GoogleDrive -->|hosts| ProjectDoc

    %% Click Events
    click ProjectDoc "https://github.com/srkchaithanya/urban-color-salesforce/blob/main/README.md"
    click DemoAssets "https://github.com/srkchaithanya/urban-color-salesforce/blob/main/Rama Krishna Chaithanya Seela - Salesforce - Project Ready Program - Cosmetic Store Management.pdf"
    click UIMockups "https://github.com/srkchaithanya/urban-color-salesforce/blob/main/Screenshots of Cosmetics Store Management.pdf"

    %% Styles
    classDef ui fill:#cfe2ff,stroke:#6fa8dc;
    classDef logic fill:#d9ead3,stroke:#6aa84f;
    classDef data fill:#fff2cc,stroke:#f1c232;
    classDef automation fill:#ffe599,stroke:#b07d00;
    classDef external fill:#d9d2e9,stroke:#8e7cc3;
    classDef doc fill:#f4cccc,stroke:#cc0000;
```
