How trailheadapps/az-insurance works
Main Components
• Salesforce DX Environment:
– The scratch org serves as the central Salesforce instance where metadata and configuration are deployed.
– Deployment scripts (in the “bin” directory) and configuration (from the “config” folder, e.g., project-scratch-def.json) are used to establish the org.
• Experience Cloud & Lightning Web Runtime:
– Two Experience sites are defined (for example, “LWR Demo Agent1” and “LWR Demo Marketing1” under the experiences directory).
– These sites involve specific Experience metadata such as branding sets, configuration files, routes, pages, and themes.
• Backend Components:
– Apex classes (in the force-app/main/default/classes) form the business logic (e.g., ManagedContentController, NavigationLinkSetPickList, NavigationMenuItemsController).
– Flows and other automated processes reside in the “flows” folder.
• Frontend Components:
– Lightning Web Components (in force-app/main/default/lwc) encapsulate UI elements (navigation menus, record details, cards, etc.).
• Data & Content:
– Sample content and media are provided in the “data” folder (the zip files) and imported via CMS in the org.
– Managed content types and static resources are key in delivering the visual design and content.
• CI/CD and Development Tools:
– GitHub workflows (under .github/workflows) for automated builds, testing, and continuous integration.
– Husky hooks, ESLint, and Prettier configuration files used to enforce code quality on commits.
– Package.json which also controls node-based tooling for linting and formatting.
Relationships and Interactions
• The developer machines (set up with Salesforce CLI, Visual Studio Code, Node.js, etc.) interact with a Salesforce scratch org to deploy and test metadata.
• The CI/CD pipeline (configured via GitHub Actions) automates validations and deployments.
• The Experience Cloud sites rely on deployed metadata (Apex, LWC, Visualforce pages) and imported CMS content to render the final user experience.
• There is a clear separation between backend logic (Apex classes, Object definitions, Flows) and frontend UI (LWC components and Experience configuration files).
• Sample Data import is a separate process that integrates with the deployed environment to populate the CMS workspaces.
Architectural Patterns and Design Principles
• Modular Design: The project is split into logical modules (e.g., experiences, lwc, classes, objects) following Salesforce DX best practices.
• Separation of Concerns: Clear division between UI (LWC components and Experience site configuration) and backend logic (Apex controllers, Flows).
• DevOps Integration: Use of GitHub workflows and pre-commit hooks enforces automation and code quality.
• Metadata-Driven Development: The majority of logic and configuration is stored as metadata files that can be deployed and managed via Salesforce CLI.
Relevant Technologies and Frameworks
• Salesforce DX, Experience Cloud, and Lightning Web Runtime.
• Salesforce CLI for deployment and org management.
• GitHub Actions for CI/CD.
• Node.js (with ESLint, Prettier) for code formatting and linting.
• Git as a version control system.
Elements
• Use clear labels for each component (e.g., “Scratch Org”, “Experience Cloud – LWR Demo Marketing”, “Apex Controllers”, “LWC Components”, “CMS & Content Imports”, “CI/CD Pipeline”).
– For frontend components (LWC and Experience sites), choose another.
• Detail the integration points (deployment scripts from the “bin” folder linking the developer’s environment with the Salesforce org).