Git Product home page Git Product logo

sfcc-sample-apps's Introduction

Commerce Storefront Sample Application · CircleCI

Our storefront sample application shows how you can build amazing commerce experiences with the latest Commerce platform technologies. The application back end is built on the new Salesforce Commerce API (a RESTful headless API). The front end is built with Lightning Web Components (LWC). In between, it uses GraphQL and the Salesforce Commerce Node.js SDK.

Read more about the architecture.

The sample application shows you a recommended approach for building a storefront, but it is not a complete and fully functional storefront reference application. The sample application now includes a home page, product list page, and product detail page. More great features are coming soon!

Note: sfcc-sample-apps is a monorepo with a sample application and Backend For Frontend (BFF) dependency modules. Typically, dependencies modules are published to a public npm server. However to develop an application, the modules are included together in a single repository.

Prerequisites

  1. Download and install Node.js v12.
  2. Install yarn: npm install yarn -g

Setup

To set up the sample application:

  1. Clone the sfcc-sample-apps repository: git clone [email protected]:SalesforceCommerceCloud/sfcc-sample-apps.git

  2. Change into the sfcc-sample-apps folder: cd sfcc-sample-apps

  3. Copy the api.example.mjs file located at /packages/storefront-lwc/scripts/, save it as api.mjs, and make sure api.mjs is added to your .gitignore file.

  4. In the api.mjs file, provide values for the following variables (you can obtain these values from your Account Executive (AE) or Customer Support Manager (CSM)):

VariableDescription
COMMERCE_CLIENT_API_SITE_IDA unique site ID (for example, RefArch or SiteGenesis).
COMMERCE_CLIENT_CLIENT_IDA unique ID used exclusively for API access. See Add a Client API for more information.
COMMERCE_CLIENT_REALM_IDA unique four-character ID (for example, bblx).
COMMERCE_CLIENT_INSTANCE_IDInstance ID within a realm (for example, 015).
COMMERCE_CLIENT_SHORT_CODERegion-specific merchant identifier (for example, staging-001).
  1. Install dependencies: yarn

  2. Build the sample application: yarn build

  3. Start the sample application: yarn start:dev (development mode) or yarn start (production mode)

  4. To access the sample application in development mode, open the browser to http://localhost:3000 (for production mode, open to http://localhost:3002).

You can optionally test the sample application: yarn test

Debug

We recommend Visual Studio Code inbuilt debugger to troubleshoot the code. The .vscode launch configuration is included in the repo. To debug using VSCode, see VS Code Debugging.

Configuration

  • You can change the logging levels by modifying the COMMERCE_LOG_LEVEL property in api.mjs. The supported log levels are:
    • TRACE
    • DEBUG
    • INFO
    • WARN
    • ERROR
    • SILENT
  • You can also change the server listening port by changing the port property in scff-sample-apps/packages/storefront-lwc/lwc-services.config.js.

Learn More About Supporting Technologies

Contributing

sfcc-sample-apps's People

Contributors

blittle avatar coopaq avatar syedshehrozhussain avatar echessman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.