# amitastreait/flow-demos architecture

> Architecture diagram of the GitHub repository amitastreait/flow-demos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amitastreait/flow-demos
- Repository: https://github.com/amitastreait/flow-demos

## Overview

##### Project type and purpose
- This is a Salesforce DX project that packages Salesforce “metadata” for deployment to a Salesforce org. It includes declarative assets (Flows, Custom Metadata, Objects), programmatic Apex (classes & triggers), and a UI layer built with Lightning Web Components (LWC) and Aura.

##### File structure
- At the root you have configuration files (`sfdx-project.json`, scratch-org definitions, CLI ignores, Husky hooks, Jest config).
- The `force-app/main/default` folder holds the Salesforce metadata organized by type:
- `classes` – Apex business logic and unit tests
- `triggers` – trigger definitions that invoke your Apex framework
- `lwc` & `aura` – Lightning Web Components and Aura components (UI layer)
- `flows` & `flowDefinitions` – declarative Flows and their metadata
- `objects` – Custom object schemas (Student__c) and Custom Metadata types (Trigger_Handler__mdt)
- `staticresources` – JS/CSS resources for front-end widgets
- Supporting scripts in `scripts/` (example Apex scripts, SOQL queries).
- A manifest `package.xml` for packaging the entire app.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Developer & Config"
        DevTools["Developer Tools & Project Configuration"]:::dev
    end

    CI["CI/CD Pipeline"]:::dev

    DevTools --> CI
    CI -->|"Deploy via SFDX"| Org["Salesforce Org"]:::dev

    subgraph "Salesforce Org"
        subgraph "UI Layer"
            LWC["Lightning Web Components"]:::ui
            Aura["Aura Components"]:::ui
        end
        subgraph "Business Logic Layer"
            Apex["Apex Classes & Tests"]:::logic
            TriggerFramework["Trigger Framework Core Classes"]:::logic
            Triggers["Triggers"]:::logic
            Flows["Salesforce Flows & Flow Definitions"]:::logic
        end
        subgraph "Data & Config Layer"
            Objects[(Custom/Standard Objects)]:::data
            CustomMetadata[(Custom Metadata Types)]:::config
            StaticResources["Static Resources"]:::data
        end
    end

    LWC -->|"@AuraEnabled methods"| Apex
    Aura -->|"@AuraEnabled methods"| Apex
    LWC -->|"Lightning Data Service"| Objects
    Aura -->|"Lightning Data Service"| Objects

    Flows -->|"Invocable Apex"| Apex
    Flows -->|"Read/Write"| Objects

    Triggers -->|"invoke"| TriggerFramework
    TriggerFramework -->|"delegates to handlers via"| CustomMetadata
    TriggerFramework -->|"performs DML"| Objects

    Apex -->|"SOQL/DML"| Objects

    StaticResources --> LWC
    StaticResources --> Aura

    click DevTools "https://github.com/amitastreait/flow-demos/blob/master/sfdx-project.json"
    click DevTools "https://github.com/amitastreait/flow-demos/blob/master/config/project-scratch-def.json"
    click DevTools "https://github.com/amitastreait/flow-demos/blob/master/.forceignore"
    click DevTools "https://github.com/amitastreait/flow-demos/blob/master/.gitignore"
    click DevTools "https://github.com/amitastreait/flow-demos/blob/master/package.json"
    click DevTools "https://github.com/amitastreait/flow-demos/blob/master/jest.config.js"
    click DevTools "https://github.com/amitastreait/flow-demos/tree/master/.husky/pre-commit"
    click LWC "https://github.com/amitastreait/flow-demos/tree/master/force-app/main/default/lwc/"
    click Aura "https://github.com/amitastreait/flow-demos/tree/master/force-app/main/default/aura/"
    click Apex "https://github.com/amitastreait/flow-demos/tree/master/force-app/main/default/classes/"
    click TriggerFramework "https://github.com/amitastreait/flow-demos/tree/master/force-app/main/default/classes/"
    click Triggers "https://github.com/amitastreait/flow-demos/tree/master/force-app/main/default/triggers/"
    click Flows "https://github.com/amitastreait/flow-demos/tree/master/force-app/main/default/flows/"
    click Flows "https://github.com/amitastreait/flow-demos/tree/master/force-app/main/default/flowDefinitions/"
    click CustomMetadata "https://github.com/amitastreait/flow-demos/tree/master/force-app/main/default/customMetadata/"
    click Objects "https://github.com/amitastreait/flow-demos/tree/master/force-app/main/default/objects/"
    click StaticResources "https://github.com/amitastreait/flow-demos/tree/master/force-app/main/default/staticresources/"
    click CI "https://github.com/amitastreait/flow-demos/tree/master/scripts/"
    click CI "https://github.com/amitastreait/flow-demos/blob/master/manifest/package.xml"

    classDef dev fill:#f2f2f2,stroke:#333,stroke-width:1px
    classDef ui fill:#cfe2f3,stroke:#075985,stroke-width:1px
    classDef logic fill:#d9ead3,stroke:#38761d,stroke-width:1px
    classDef data fill:#fce5cd,stroke:#b45f06,stroke-width:1px
    classDef config fill:#fff2cc,stroke:#bf9000,stroke-width:1px
```
