Get to Know the Sample Gallery
Learning Objectives
In this project, you’ll:
- Get to know the sample gallery.
- Learn why we built it.
- Walk through the common sample apps tools.
The Sample Gallery
For developers, looking at someone else's code is a tried-and-true method of learning how to make something work. The Trailhead sample gallery meets this need by providing a set of sample apps that include code examples on a variety of developer platform features. We built the sample apps to help you, our Salesforce developers, ramp up on the latest and greatest technology.
Find the Sample Gallery
By far the easiest way to find anything on the internet is by searching. The sample gallery is no different. Here’s how to search for the sample gallery.
- Open your preferred browser.
- Go to www.google.com.
- Search for the terms:
trailhead sample gallery
- Click the result Trailhead Sample Gallery - Salesforce.
If you don’t see it, the sample gallery is also prominently shown in the Salesforce developer portal.
- Navigate to developer.salesforce.com.
- From the Learn menu, select Sample Gallery.
Awesome! You've now found the Trailhead sample gallery. Let's check it out.
What You’ll Find in the Sample Gallery
The first thing you notice about the sample gallery is that it lives in Trailhead. This is because several of the sample apps feature prominently in Trailhead modules and projects. In some cases, the apps were created specifically to support Trailhead content. In others, we created the apps and they were adopted by Trailhead content writers as common use cases. Let’s get to know them better.
- Scroll through the sample gallery.
- Notice every app tile has a description and a list of features associated with it.
- Find the LWC Recipes app and take a moment to read the description and features on its tile.
- Now find the app called E-Bikes and read its description and features.
You can see that some of these apps simulate a customer use case. Others show code examples without a use case to demonstrate how certain APIs or developer features work.
Use case apps: Use case apps are each built around a mock customer use case. They tend to focus on some subset of the Salesforce Platform developer features that a person wants to learn. Some of these include Communities, Mobile SDK, and dependency management with unlocked packages. If you look through all the apps, you can find more.
The use case apps include E-Bikes, DreamHouse, Easy Spaces, Redwoods Insurance, and a few others.
Code example apps: These apps show how to solve coding problems, but don't necessarily try to tell a customer story.
Some apps use a style we call recipes. We build each recipe to solve one specific problem by distilling it down to the simplest code required to solve it. Each code artifact (such as JS file or Apex method) is named in such a way that it identifies what
kind of problem that bit of code solves. For instance, in the LWC Recipes app, you'll find a Lightning web
component called wireGetRecordStaticContact
that uses a wire adapter to get a contact record using static field names. Besides LWC Recipes, there is also the LWC Recipes Open Source app.
We’ve also recently introduced a code pattern app called Visualforce to LWC. This app takes certain design patterns that were used in Visualforce and provides the corresponding LWC pattern to solve that problem.
But if this is a sample app for developers, where’s the code? Let’s go find it!
Sample App Code Repositories
The sample gallery is a directory of all of our sample apps. It makes it easy for people to see all the sample apps, and then go to the code for the sample app that interests them. But every app is actually a repository on GitHub with instructions to install the app in a Salesforce org.
- Scroll to the LWC Recipes app tile.
- Click the View on GitHub button.
- You are redirected to the GitHub repository for LWC Recipes.
Note: You are now in the GitHub organization trailheadapps. Each tile in the sample gallery has a link to the underlying GitHub repository for its app. The trailheadapps organization is where the Salesforce Developer Relations sample apps live.
You explored both the landing page with the full list of sample apps and discovered how to navigate to each sample app’s source code. In the next step, you learn how we set up tooling for these apps and how to find the different artifacts involved with the tooling.
We won’t check any of your work in this step. Click Verify step to earn 25 points to go to the next step in the project.