Create your storefront
Welcome to your Commerce Storefront journey. Our goal is to make the journey fun and informative. We start every topic with big-picture overviews and relevant vocabulary. We then walk you through the details step-by-step. And finally, we provide a sandbox for practice when possible. Let’s get started.
Big picture
The tutorial helps you quickly create a new Edge Delivery Services storefront using the Commerce boilerplate template. The boilerplate provides a starter storefront that uses a pre-configured Adobe Commerce environment.
After completing this tutorial, you will have a new GitHub repository with a storefront that is pre-configured with all the necessary components and services to get you started. You will also have a local development environment where you can explore the boilerplate and start customizing it to develop your own production storefront.
The following diagram shows the steps you’ll take to create and configure your starter storefront:
The full details are slightly more involved. Let’s break it down.
- Use the boilerplate template to create a storefront repository.
- Add the Code Sync app to your newly created repo. This app automatically redeploys your storefront when you push changes to the main branch. It also provides the Edge Delivery system (Helix Admin) with access to your repo so it can coordinate code changes with content changes.
- Create a folder on Google Drive or SharePoint for your content and Share it with the
helix@adobe.com
user. This gives the Edge Delivery system (Helix Admin) with read/write access to your folder’s content. - Add sample content from the boilerplate to your new folder on Google Drive or SharePoint.
- Connect your repo to your content using the
mountpoint
in yourfstab.yaml
URL in your GitHub repo. - Install and configure Sidekick so it can preview, publish, and edit content on your storefront.
- Set up your local development environment and install the dependencies. Start the development server and explore your new storefront.
Vocabulary
Before we dive into the step-by-step guide, let’s review some key Vocabulary that will help you understand the process of creating and configuring your storefront.
Boilerplate template
The boilerplate template is a pre-configured storefront that includes all the necessary components and services to get you started. It’s a great way to quickly create a new storefront with all the necessary components and services already in place.
Code Sync app
The Code Sync app listens to changes in your code repositories (commits and merges to the main
branch) and publishes code to the Edge Delivery code bus. It also intelligently purges CDN caches when changes have been made. This app is essential for keeping your storefront up-to-date with the latest changes.
Content folder
The content folder is where you store all the content for your storefront. This includes images, text, and other assets that make up your site. By sharing read/write access to your content folder with Edge Delivery Services, you enable it to provide all the features of document-based authoring, such as editing, previewing, and publishing.
Sidekick
Sidekick is an extension that makes it easy for creators to connect, edit, preview, and publish content directly from documents and spreadsheets in Google Drive and SharePoint. It’s also responsible for pushing content to the Edge Delivery content bus so it can be previewed and published.
mountpoint
The mountpoint
is the URL that points to your content folder on Google Drive or SharePoint. By specifying the mountpoint
in the fstab.yaml
file on the main
branch of your remote GitHub repo, Edge Delivery Services can link your code to the content for your storefront.
Example
Our CitiSignal demo site was built from the same boilerplate you will set up to develop your own storefront. You can access the full demo site here: https://main—citisignal—adobedevxsc.aem.live/.
Step-by-step
The centerpiece of this 20-minute storefront is our Commerce boilerplate template. It provides a starter storefront that is pre-configured with our Commerce components and services and pre-connected to our Commerce boilerplate backend.
Prerequisites
Before you begin, take a moment to set up these required tools and accounts as needed.
Create code repository
This task requires you to have a GitHub account with access to the organization or owner where you want to create your new repo.
Navigate to aem-boilerplate-commerce , select the Use this template button, then select the Create a new repository option to open the form.
Complete the form with the following details:
- Repository template:
hlxsites/aem-boilerplate-commerce
(default). - Include all branches: Do not include all branches (default).
- Owner: Your organization or account (required).
- Repository name: A unique name for your new repo (required).
- Description: A brief description of your repo (optional).
- Public or Private: We recommend public (default).
- Repository template:
Select the Create repository button and watch GitHub create your new storefront repo.
After a few seconds, you should be redirected to the home page of your new repo.
Add Code Sync GitHub app
The Code Sync app redeploys your storefront site whenever you push or merge changes to the main
branch of your repo.
Navigate to the AEM Code Sync app and select the Configure button (top right) to open the repo selection page.
Select the organization or account for the repo you just created.
From the form, choose Only select repositories, open the Select repositories selector, and choose your repo from the list.
Select Install (or Save, see note above) to complete the Code Sync installation.
You should see a success screen if the installation completed without errors. Your repo is now connected to the Edge Delivery Services code bus.
(Optional) If you return to the account selection page , your repo’s organization or account will now be gray with “Configure” added. Select your org or account again to access the Code Sync configuration page. This page shows when the app was added to your organization (highlighted) and allows you to connect the Code Sync app to additional repositories.
Create and share folder
Now let’s create and set up the content side of your storefront. We’ll create a new folder and share it with Edge Delivery Services. Choose the tab below that matches your chosen storage service, Google Drive or SharePoint.
Follow these steps to create and share your Google Drive folder.
- Open your Google Drive My Drive page, select the ✚ New button (top-left), create a new folder, and give it a name that identifies your storefront.
- Open your new folder (double-click).
- Open your folder’s menu, and select the Share > Share menu item.
- Type helix and select
helix@adobe.com
as the recipient. - Ensure the Editor option (default) is selected to give read/write access, then select the Send button.
- You can verify your folder is now shared if you see a new Shared icon (👥) to the right of your folder.
- Additionally, you can select the icon and verify that
helix@adobe.com
is listed as an Editor. If it is, your content folder is now connected to the Edge Delivery Services content bus.
Follow these steps to create and share your SharePoint folder.
- Open your SharePoint Home page, select the
Create button, then select Site from the menu. - Select the Communication site. You can choose the Team site if you prefer, but it’s harder to set up.
- Select a site template, Standard communication is the simplest, then select Use template. Follow the additional instructions: Give your site a name, click Next, sensitivity is always private, default language is English, select Create site. When the site is created, you will be redirected to the Home page of your site.
- Select the Documents tab from your Home page.
- Create a New folder and give it a name that identifies your storefront.
- Open the folder and select the Share button.
- Type helix and select AEM Content Integration from the list.
- Select Can edit to provide read/write access to your folder.
- Send the invitation to give Edge Delivery Services (Helix Admin) read/write access to your folder. Your content folder is now connected to the Edge Delivery Services system.
Add sample content
Now let’s add the boilerplate sample files to your content folder. Choose the tab below that matches your chosen storage service, Google Drive or SharePoint.
- Open your Google Drive folder.
- Select the ⚙️ Settings icon (top-right of the page) and choose Settings from the menu.
- Enable the Uploads checkbox to convert uploads to Google Docs editor format. Return to your storefront folder.
- Download the boilerplate’s starter-content-commerce.zip file.
- Unzip the file and drag the contents into your folder. This will convert the Word and Excel files to Google Docs and Sheets.
- Download the boilerplate’s starter-content-commerce.zip file.
- Unzip the file and drag the contents into your SharePoint folder.
Connect repo to folder content
Now we need to link your GitHub storefront repo (the code) to your storefront folder (the content). Linking your code to your content enables Edge Delivery to coordinate code changes in the repo with content changes in your Google Drive or SharePoint folder. After step 1 below, all steps are the same for Google Drive and SharePoint.
Copy the URL to your content folder:
- For Google Drive: Open your folder and copy the URL from the browser’s address bar.
- For SharePoint: Open your folder and select the Copy link button.
Go to your GitHub repo and open the
fstab.yaml
file from the project root.Edit the
fstab.yaml
file in place.Replace the default
mountpoints
URL (which points to the boilerplate’s SharePoint folder) with your Google Drive or SharePoint folder URL.Select the Commit changes… button.
Commit the changes directly to
main
. Now the Edge Delivery system knows where to find the content for this repository.
Set up Sidekick for content
For this task, we’ll use the Sidekick Configurator to install Sidekick and configure it for our storefront.
Open your GitHub repo and copy it’s URL from the browser’s address bar.
Open the Sidekick Configurator tool and complete the fields as follows:
- Repository URL: Paste the URL to your repo (required).
- Project Name: Add name that identifies your storefront (optional).
Select the Go button. If you don’t already have Sidekick installed, you should see links to install Sidekick or add the bookmarklet.
Install Sidekick from the Chrome Web Store or use the bookmarklet. If you’re using the bookmarklet, drag it to your browser’s bookmarks bar. If installing the extension, Pin the Sidekick extension to your browser’s toolbar.
Select the browser’s back button to return to the Sidekick Configurator page. You should now see a message stating “Your Sidekick is not configured for this project yet” and an Add project button.
Select the Add project button to complete your Sidekick setup. You should see a message stating: “Your Sidekick is configured for this project.”
Return to your folder, select ALL files (including
.json
config files), select the Sidekick extension, and click the Preview button. Repeat this for all files in each folder. Select all the files again, but select the Publish button to publish these files to the CDN. These actions add your content to the internal (preview) and production (publish) Edge Delivery CDNs, where they can be downloaded and displayed in your browser for local development.
You can now use Sidekick to Preview, Publish, and Edit all your files directly from your Google Drive or SharePoint folder. Take a moment to select any file in your folder, select the Sidekick extension, and choose the Sidekick options to get familiar with how Sidekick works. Visit the Sidekick documentation for more information on how to use Sidekick to manage your storefront content.
Set up local dev environment
Go to your GitHub repo and select the Code button to copy the repo’s git URL for cloning (HTTPS or SSH).
Open a terminal on your local machine and clone your storefront repo:
Navigate to the root of your local repo and install the dependencies.
Start the development server to view the boilerplate storefront.
The first page of your boilerplate storefront should be visible in your browser at
http://localhost:3000
.Open the project in your favorite code editor. You’re now ready to explore the boilerplate and start customizing your storefront!
Access in-development dropin-in components
If you want to test dropin-in components that are still in development, you can access the develop
branch of the boilerplate repo.
To access the develop
branch of the boilerplate repo, follow these steps:
Open a terminal on your local machine and navigate to the root of your local repo.
Add the upstream boilerplate repo as a new remote:
Fetch the upstream boilerplate repo:
Checkout the
develop
branch of the upstream boilerplate repo: