# trailheadapps/lwc-recipes architecture

> Architecture diagram of the GitHub repository trailheadapps/lwc-recipes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/trailheadapps/lwc-recipes
- Repository: https://github.com/trailheadapps/lwc-recipes

## Overview

LWC Recipes is a Salesforce-hosted catalog of compact Lightning Web Component examples, not one integrated business application. Its user workflow is to open a recipe in the LWC app and inspect or exercise a task-specific example. The map groups the major documented examples by capability; many are standalone recipes rather than stages in a shared pipeline. The excerpts show specific Apex, state, and messaging relationships; other capability links are dashed where their implementation was not sampled.

Main entry points: [`force-app/main/default/lwc/lmsPublisherWebComponent/lmsPublisherWebComponent.js`](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/lmsPublisherWebComponent/lmsPublisherWebComponent.js) (Message service), [`force-app/main/default/lwc/stateManager/stateManager.js`](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/stateManager/stateManager.js) (Opportunity state view), [`force-app/main/default/staticresources/lmsvf/lmsPublisherVisualforce.js`](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/staticresources/lmsvf/lmsPublisherVisualforce.js) (Visualforce messaging), [`force-app/main/default/lwc/apexImperativeMethod/apexImperativeMethod.js`](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/apexImperativeMethod/apexImperativeMethod.js) (Apex calls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data access"]
  node_apex["Apex calls"]
  node_search["Contact search"]
  node_graphql["GraphQL recipes<br/>[graphqlContacts.js]"]
  node_lds["LDS recipes<br/>[ldsCreateRecord.js]"]
  node_records["Record forms"]
  node_pickers["Record pickers"]
  node_wire["Wire adapters<br/>[wireGetRecord.js]"]
  node_stateui["Opportunity state view<br/>[stateManager.js]"]
  node_statemgr["Opportunity state"]
end

subgraph group_ui["UI composition"]
  node_recipe["Recipe examples"]
  node_composition["Component composition"]
  node_events["Events<br/>[eventSimple.js]"]
  node_dom["DOM examples<br/>[miscDomQuery.js]"]
  node_datatable["Editable tables"]
end

subgraph group_platform["Platform features"]
  node_navigation["Navigation<br/>[navToRecord.js]"]
  node_workspace["Workspace tabs<br/>[workspaceAPI.js]"]
  node_actions["Record actions"]
  node_refresh["Refresh events"]
end

subgraph group_integration["Integrations"]
  node_messaging["Message service"]
  node_aura["Aura messaging"]
  node_visualforce["Visualforce messaging"]
  node_templates["List templates<br/>[templates.js]"]
  node_libraries["Third-party libraries<br/>[libsChartjs.js]"]
  node_charts["Chart.js resource<br/>[chartJs.js]"]
end

node_developer(("App user"))
node_services[("Salesforce platform")]
node_apexsvc(("Apex services"))

node_developer -.->|"opens example"| node_recipe
node_search -->|"calls Apex"| node_apexsvc
node_stateui -->|"updates state"| node_statemgr
node_stateui -->|"queries GraphQL"| node_services
node_aura -->|"publishes message"| node_messaging
node_visualforce -->|"renders items"| node_templates
node_visualforce -->|"publishes message"| node_messaging
node_apex -.->|"invokes methods"| node_apexsvc
node_graphql -.->|"queries data"| node_services
node_lds -.->|"manages records"| node_services
node_records -.->|"reads records"| node_services
node_pickers -.->|"searches records"| node_services
node_wire -.->|"wires data"| node_services
node_datatable -.->|"saves edits"| node_services
node_navigation -.->|"navigates"| node_services
node_workspace -.->|"controls tabs"| node_services
node_actions -.->|"uses actions"| node_services
node_refresh -.->|"requests refresh"| node_services
node_messaging -.->|"uses messaging"| node_services
node_libraries -.->|"loads resource"| node_charts

click node_recipe "https://github.com/trailheadapps/lwc-recipes/tree/main/force-app/main/default/lwc"
click node_apex "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/apexImperativeMethod/apexImperativeMethod.js"
click node_search "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/compositionContactSearch/compositionContactSearch.js"
click node_graphql "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/graphqlContacts/graphqlContacts.js"
click node_lds "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/ldsCreateRecord/ldsCreateRecord.js"
click node_records "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/recordFormStaticContact/recordFormStaticContact.js"
click node_pickers "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/recordPickerHello/recordPickerHello.js"
click node_wire "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/wireGetRecord/wireGetRecord.js"
click node_stateui "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/stateManager/stateManager.js"
click node_statemgr "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/opportunitiesStateManager/opportunitiesStateManager.js"
click node_composition "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/compositionBasics/compositionBasics.js"
click node_events "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/eventSimple/eventSimple.js"
click node_dom "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/miscDomQuery/miscDomQuery.js"
click node_datatable "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/datatableInlineEditWithUiApi/datatableInlineEditWithUiApi.js"
click node_navigation "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/navToRecord/navToRecord.js"
click node_workspace "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/workspaceAPI/workspaceAPI.js"
click node_actions "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/editRecordScreenAction/editRecordScreenAction.js"
click node_refresh "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/dispatchRefreshEvent/dispatchRefreshEvent.js"
click node_messaging "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/lmsPublisherWebComponent/lmsPublisherWebComponent.js"
click node_aura "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/aura/lmsPublisherAuraComponent/lmsPublisherAuraComponentController.js"
click node_visualforce "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/staticresources/lmsvf/lmsPublisherVisualforce.js"
click node_templates "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/staticresources/lmsvf/templates.js"
click node_libraries "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/libsChartjs/libsChartjs.js"
click node_charts "https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/staticresources/chartJs.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_apex,node_search,node_graphql,node_lds,node_records,node_pickers,node_wire,node_stateui,node_statemgr,node_developer toneBlue
class node_recipe,node_composition,node_events,node_dom,node_datatable,node_services toneAmber
class node_navigation,node_workspace,node_actions,node_refresh toneMint
class node_messaging,node_aura,node_visualforce,node_templates,node_libraries,node_charts toneRose
class node_apexsvc toneIndigo
```

## Components

### Data access

- [Apex calls](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/apexImperativeMethod/apexImperativeMethod.js): `force-app/main/default/lwc/apexImperativeMethod/apexImperativeMethod.js`
- [Contact search](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/compositionContactSearch/compositionContactSearch.js): `force-app/main/default/lwc/compositionContactSearch/compositionContactSearch.js`
- [GraphQL recipes](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/graphqlContacts/graphqlContacts.js): `force-app/main/default/lwc/graphqlContacts/graphqlContacts.js`
- [LDS recipes](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/ldsCreateRecord/ldsCreateRecord.js): `force-app/main/default/lwc/ldsCreateRecord/ldsCreateRecord.js`
- [Record forms](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/recordFormStaticContact/recordFormStaticContact.js): `force-app/main/default/lwc/recordFormStaticContact/recordFormStaticContact.js`
- [Record pickers](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/recordPickerHello/recordPickerHello.js): `force-app/main/default/lwc/recordPickerHello/recordPickerHello.js`
- [Wire adapters](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/wireGetRecord/wireGetRecord.js): `force-app/main/default/lwc/wireGetRecord/wireGetRecord.js`
- [Opportunity state view](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/stateManager/stateManager.js): `force-app/main/default/lwc/stateManager/stateManager.js`
- [Opportunity state](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/opportunitiesStateManager/opportunitiesStateManager.js): `force-app/main/default/lwc/opportunitiesStateManager/opportunitiesStateManager.js`

### UI composition

- [Recipe examples](https://github.com/trailheadapps/lwc-recipes/tree/main/force-app/main/default/lwc): `force-app/main/default/lwc`
- [Component composition](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/compositionBasics/compositionBasics.js): `force-app/main/default/lwc/compositionBasics/compositionBasics.js`
- [Events](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/eventSimple/eventSimple.js): `force-app/main/default/lwc/eventSimple/eventSimple.js`
- [DOM examples](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/miscDomQuery/miscDomQuery.js): `force-app/main/default/lwc/miscDomQuery/miscDomQuery.js`
- [Editable tables](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/datatableInlineEditWithUiApi/datatableInlineEditWithUiApi.js): `force-app/main/default/lwc/datatableInlineEditWithUiApi/datatableInlineEditWithUiApi.js`

### Platform features

- [Navigation](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/navToRecord/navToRecord.js): `force-app/main/default/lwc/navToRecord/navToRecord.js`
- [Workspace tabs](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/workspaceAPI/workspaceAPI.js): `force-app/main/default/lwc/workspaceAPI/workspaceAPI.js`
- [Record actions](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/editRecordScreenAction/editRecordScreenAction.js): `force-app/main/default/lwc/editRecordScreenAction/editRecordScreenAction.js`
- [Refresh events](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/dispatchRefreshEvent/dispatchRefreshEvent.js): `force-app/main/default/lwc/dispatchRefreshEvent/dispatchRefreshEvent.js`

### Integrations

- [Message service](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/lmsPublisherWebComponent/lmsPublisherWebComponent.js): `force-app/main/default/lwc/lmsPublisherWebComponent/lmsPublisherWebComponent.js`
- [Aura messaging](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/aura/lmsPublisherAuraComponent/lmsPublisherAuraComponentController.js): `force-app/main/default/aura/lmsPublisherAuraComponent/lmsPublisherAuraComponentController.js`
- [Visualforce messaging](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/staticresources/lmsvf/lmsPublisherVisualforce.js): `force-app/main/default/staticresources/lmsvf/lmsPublisherVisualforce.js`
- [List templates](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/staticresources/lmsvf/templates.js): `force-app/main/default/staticresources/lmsvf/templates.js`
- [Third-party libraries](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/lwc/libsChartjs/libsChartjs.js): `force-app/main/default/lwc/libsChartjs/libsChartjs.js`
- [Chart.js resource](https://github.com/trailheadapps/lwc-recipes/blob/main/force-app/main/default/staticresources/chartJs.js): `force-app/main/default/staticresources/chartJs.js`

### Other components

- **App user**
- **Salesforce platform**
- **Apex services**

## Connections

- App user → Recipe examples: opens example (evidence: `README.md`)
- Contact search → Apex services: calls Apex (evidence: `force-app/main/default/lwc/compositionContactSearch/compositionContactSearch.js`)
- Opportunity state view → Opportunity state: updates state (evidence: `force-app/main/default/lwc/stateManager/stateManager.js`)
- Opportunity state view → Salesforce platform: queries GraphQL (evidence: `force-app/main/default/lwc/stateManager/stateManager.js`)
- Aura messaging → Message service: publishes message (evidence: `force-app/main/default/aura/lmsPublisherAuraComponent/lmsPublisherAuraComponentController.js`)
- Visualforce messaging → List templates: renders items (evidence: `force-app/main/default/staticresources/lmsvf/lmsPublisherVisualforce.js`)
- Visualforce messaging → Message service: publishes message (evidence: `force-app/main/default/staticresources/lmsvf/lmsPublisherVisualforce.js`)
- Apex calls → Apex services: invokes methods
- GraphQL recipes → Salesforce platform: queries data
- LDS recipes → Salesforce platform: manages records
- Record forms → Salesforce platform: reads records
- Record pickers → Salesforce platform: searches records
- Wire adapters → Salesforce platform: wires data
- Editable tables → Salesforce platform: saves edits
- Navigation → Salesforce platform: navigates
- Workspace tabs → Salesforce platform: controls tabs
- Record actions → Salesforce platform: uses actions
- Refresh events → Salesforce platform: requests refresh
- Message service → Salesforce platform: uses messaging
- Third-party libraries → Chart.js resource: loads resource
