Skip to content

Fork of the Salesforce Dreamhouse sample application to demo the features of the Audicity data history and transaction tracing tool.

License

Notifications You must be signed in to change notification settings

processity/dreamhouse-audicity

 
 

Repository files navigation

Audicity Tutorial Dreamhouse Sample App

dreamhouse-logo This is a fork of the Dreamhouse sample application created by Salesforce developer relations team. This fork has been customized for the purpose of the Audicity setup and configuration tutorial where you can practice installing and running the Audicity data and transaction tracking app.

Audicity and this project run in the Salesforce platform. In order to run it, and work with Audicity, you need a working Salesforce environment (also known as an "org" if you're new to working with Salesforce). Some steps below make use of Salesforce's expansive resources to get up and running with an environment. We are not Salesforce and cannot control Salesforce's enablement resources. If they change, and no longer work, please file an issue in this repo and let us know. We'll work as quickly as we can to provide an alternative resource.

Table of contents

Installing Dreamhouse using a Scratch Org

  1. Set up your environment. Follow the steps in the Quick Start: Lightning Web Components Trailhead project. The steps include:

    • Enable Dev Hub in your Trailhead Playground or Developer Edition org
    • Install Salesforce CLI
    • Install Visual Studio Code
    • Install the Visual Studio Code Salesforce extensions, including the Lightning Web Components extension
  2. If you haven't already done so, authorize your hub org and provide it with an alias (myhuborg in the command below):

    sf org login web -d -a myhuborg
    
  3. Clone this repository:

    git clone https://github.com/processity/dreamhouse-audicity.git
    cd dreamhouse-audicity
    
  4. Create a scratch org and provide it with an alias (dreamhouse-audicity in the command below):

    sf org create scratch -d -f config/project-scratch-def.json -a dreamhouse-audicity
    
  5. Push the app to your scratch org:

    sf project deploy start
    
  6. Assign the dreamhouse permission set to the default user:

    sf org assign permset -n dreamhouse
    
  7. Import sample data:

    sf data tree import -p data/sample-data-plan.json
    
  8. Open the scratch org:

    sf org open
    
  9. In App Launcher, select the Dreamhouse app.

Installing Dreamhouse using a Developer Edition Org

Follow this set of instructions if you want to deploy the app to a more permanent environment than a Scratch org. This includes non source-tracked orgs such as a free Developer Edition Org or a Trailhead Playground. While there is no reason to use a Trailhead Playground, it is an option, if you insist on giving it a try.

Make sure to start from a brand-new environment to avoid conflicts with previous work you may have done.

  1. Clone this repository:

    git clone https://github.com/processity/dreamhouse-audicity.git
    cd dreamhouse-audicity
    
  2. Authorize your Trailhead Playground or Developer org and provide it with an alias (dreamhouse-audicity-devorg in the command below). Note this command launches a browser window and you must successfully login to the org to complete the process. If you do not complete the login successfully, the subsequent commands will not function:

    sf org login web -s -a dreamhouse-audicity-devorg
    
  3. Run this command in a terminal to deploy the app.

    sf project deploy start -d force-app
    
  4. Assign the dreamhouse permission set to the default user.

    sf org assign permset -n dreamhouse
    
  5. Import some sample data.

    sf data tree import -p ./data/sample-data-plan.json
    
  6. If your org isn't already open, open it now:

    sf org open -o dreamhouse-audicity-devorg
    
  7. In App Launcher, select the Dreamhouse app.

Note on Sample Data Import

Properties inserted using the Salesforce CLI will appear as listed on TODAY() - 10 days.

Optional Installation Instructions

None of these are necessary in order to run Audicity. These are kept in place here solely to honor the intent of the original creators of the Dreamhouse app.

This repository contains several files that are relevant if you want to integrate modern web development tooling to your Salesforce development processes, or to your continuous integration/continuous deployment processes.

Code formatting

Prettier is a code formatter used to ensure consistent formatting across your code base. To use Prettier with Visual Studio Code, install this extension from the Visual Studio Code Marketplace. The .prettierignore and .prettierrc files are provided as part of this repository to control the behavior of the Prettier formatter.

Warning The current Apex Prettier plugin version requires that you install Java 11 or above.

Code linting

ESLint is a popular JavaScript linting tool used to identify stylistic errors and erroneous constructs. To use ESLint with Visual Studio Code, install this extension from the Visual Studio Code Marketplace. The .eslintignore file is provided as part of this repository to exclude specific files from the linting process in the context of Lightning Web Components development.

Pre-commit hook

This repository also comes with a package.json file that makes it easy to set up a pre-commit hook that enforces code formatting and linting by running Prettier and ESLint every time you git commit changes.

To set up the formatting and linting pre-commit hook:

  1. Install Node.js if you haven't already done so
  2. Run npm install in your project's root folder to install the ESLint and Prettier modules (Note: Mac users should verify that Xcode command line tools are installed before running this command.)

Prettier and ESLint will now run automatically every time you commit changes. The commit will fail if linting errors are detected. You can also run the formatting and linting from the command line using the following commands (check out package.json for the full list):

npm run lint
npm run prettier

Credits

The app GeocodingService uses OpenStreetMap API to geocode property addresses. OpenStreetMap® is open data, licensed under the Open Data Commons Open Database License (ODbL) by the OpenStreetMap Foundation (OSMF). You are free to copy, distribute, transmit and adapt OpenStreetMap data, as long as you credit OpenStreetMap and its contributors. If you alter or build upon our data, you may distribute the result only under the same licence. The full legal code explains your rights and responsibilities in regard to the service.

Notes and Additions for Audicity

(For the moment, this is more of a todo list for the project. Eventually this should become a list of the project artifacts and links that were added for Audicity.)

  • Installation instructions for Audicity package on AppExchange (generate org password and then login to org during appexchange install)
  • Assigning Audicity Permset > sf org assign permset -n AudicityLoggingAdministrator
  • turn on audicity tracking
  • configure Property object and some fields for tracking
    • make sure to save object settings even when changing fields
  • add the Audit Trail LWC to the property record page with Lightning app builder
  • instrument the PropertyTrigger trigger with mantra.AudicityApex.track()
  • test creating and editing a Property record
  • add the trigger for campaign and instrument it with mantra.AudicityApex.track()
  • (maybe test again here)
  • instrument the jobId in the trigger handler and execute() method of each Queueable
  • test an update action again

About

Fork of the Salesforce Dreamhouse sample application to demo the features of the Audicity data history and transaction tracing tool.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 55.6%
  • Apex 20.9%
  • HTML 14.7%
  • CSS 7.8%
  • Other 1.0%