Sign inSign up

osapishchuk/storefront-reference-architecture-docker

By osapishchuk

•Updated over 6 years ago

The open-source SFRA (Storefront Reference Architecture) docker image

Image
1

227

osapishchuk/storefront-reference-architecture-docker repository overview

⁠Storefront Reference Architecture (SFRA)

The open-source SFRA (Storefront Reference Architecture) docker image, made with love by Salesforce B2C Commerce community

⁠TODO

  • Update readme with how to use this repository
  • Update readme with how to contibute to this repository
  • Update readme with youtube reference with demo
  • Update readme with medium link to blog with overview
  • Update readme and introduce Gitflow with release managment
  • Update readme with examples on Azure ( or alternatives )
  • Create docker image with node on linux
  • Update configuration file with bash script
  • Create gist script with commands to run
  • Include build-suite in the solution as "deployment" pipeline for code and data

⁠Progress

I masked with TBC_YOUR_DATA data for security reason

Steps performed so far:

  1. docker run -i -t osapishchuk/storefront-reference-architecture-docker
  2. Open with Desktop Dcoker application CLI for this container
  3. cd home
  4. mkdir sfcc
  5. cd sfcc
  6. git clone https://TBC_YOUR_DATA:[email protected]/SalesforceCommerceCloud/storefront-reference-architecture
  7. cd storefront-reference-architecture
  8. npm install
  9. npm run compile:js
  10. npm run compile:scss
  11. npm run compile:fonts
  12. Open visual studio code (VSC) using remote container connection
  13. Create dw.json in the root repository folder of SFRA folder
  14. Update manually the file with
{
    "hostname": "TBC_YOUR_DATA.sandbox.us01.dx.commercecloud.salesforce.com",
    "username": "TBC_YOUR_DATA",
    "password": "TBC_YOUR_DATA",
    "code-version": "code"
}
  1. cd ../
  2. git clone https://TBC_YOUR_DATA:[email protected]/SalesforceCommerceCloud/storefrontdata
  3. cd storefrontdata
  4. npm run zipData
  5. cd ../
  6. git clone https://TBC_YOUR_DATA:[email protected]/SalesforceCommerceCloud/sfcc-ci
  7. cd sfcc-ci
  8. npm install

Assumption is that OD or regular sandbox already provisioned

  1. Manual BM changes:

    1. In BM configure Open Commerce API Settings:
    {
          "_v": "19.5",
          "clients":
          [
            {
              "client_id": "TBC_YOUR_DATA",
              "resources":
              [
                {
                  "resource_id": "/code_versions",
                  "methods": ["get"],
                  "read_attributes": "(**)",
                  "write_attributes": "(**)"
                },
                {
                  "resource_id": "/code_versions/*",
                  "methods": ["patch", "delete"],
                  "read_attributes": "(**)",
                  "write_attributes": "(**)"
                },
                {
                  "resource_id": "/jobs/*/executions",
                  "methods": ["post"],
                  "read_attributes": "(**)",
                  "write_attributes": "(**)"
                },
                {
                  "resource_id": "/jobs/*/executions/*",
                  "methods": ["get"],
                  "read_attributes": "(**)",
                  "write_attributes": "(**)"
                },
                { 
                  "resource_id": "/sites/*/cartridges", 
                  "methods": ["post"], 
                  "read_attributes": "(**)", 
                  "write_attributes": "(**)"
                },
                {
                  "resource_id":"/role_search",
                  "methods":["post"],
                  "read_attributes":"(**)",
                  "write_attributes":"(**)"
                },
                {
                  "resource_id":"/roles/*",
                  "methods":["get"],
                  "read_attributes":"(**)",
                  "write_attributes":"(**)"
                },
                {
                  "resource_id":"/roles/*/user_search",
                  "methods":["post"],
                  "read_attributes":"(**)",
                  "write_attributes":"(**)"
                },
                {
                  "resource_id":"/roles/*/users/*",
                  "methods":["put","delete"],
                  "read_attributes":"(**)",
                  "write_attributes":"(**)"
                },
                {
                  "resource_id":"/user_search",
                  "methods":["post"],
                  "read_attributes":"(**)",
                  "write_attributes":"(**)"
                },
                {
                  "resource_id":"/users",
                  "methods":["get"],
                  "read_attributes":"(**)",
                  "write_attributes":"(**)"
                },
                {
                  "resource_id":"/users/*",
                  "methods":["put","get","patch","delete"],
                  "read_attributes":"(**)",
                  "write_attributes":"(**)"
                }
              ]
            }
          ]
        }
    
    1. Go to WebDAV Client Application and configure it:
    {
    	"clients": [    		
    		{
    			"client_id": "TBC_YOUR_DATA",
    			"permissions": [
    				{
    					"path": "/impex",
    					"operations": [
    						"read_write"
    					]
    				},
    				{
    					"path": "/cartridges",
    					"operations": [
    						"read_write"
    					]
    				},
    				{
    					"path": "/static",
    					"operations": [
    						"read_write"
    					]
    				},
    				{
    					"path": "/catalogs/<your-catalog-id>",
    					"operations": [
    						"read_write"
    					]
    				},
    				{
    					"path": "/libraries/<your-library-id>",
    					"operations": [
    						"read_write"
    					]
    				},
    				{
    					"path": "/dynamic/<your-site-id>",
    					"operations": [
    						"read_write"
    					]
    				}
    			]
    		}
    	]
    }
    
  2. Create .env file in the storefront-reference-architecture folder

SFCC_OAUTH_CLIENT_ID=TBC_YOUR_DATA
SFCC_OAUTH_CLIENT_SECRET=TBC_YOUR_DATA
SFCC_OAUTH_USER_NAME=TBC_YOUR_DATA
SFCC_OAUTH_USER_PASSWORD=TBC_YOUR_DATA
SANDBOX_HOST=TBC_YOUR_DATA.sandbox.us01.dx.commercecloud.salesforce.com
  1. Run in the console following to deploy code + data + reindex and render url

    # START
    sfcc-ci client:auth $API_KEY $API_SECRET $API_USER $API_USER_PW
    
    # Package locally
    mkdir -p tmp/code
    cp -R cartridges/* tmp/code
    cd tmp
    zip -r -q code.zip code
    rm -r code
    
    # Deploy code to instance
    sfcc-ci code:deploy tmp/code.zip -i TBC_YOUR_DATA.sandbox.us01.dx.commercecloud.salesforce.com
    sfcc-ci code:activate code -i TBC_YOUR_DATA.sandbox.us01.dx.commercecloud.salesforce.com
    
    # Deploy data to instance
    sfcc-ci instance:upload ../storefrontdata/demo_data_sfra.zip -i TBC_YOUR_DATA.sandbox.us01.dx.commercecloud.salesforce.com
    sfcc-ci instance:import demo_data_sfra.zip -i TBC_YOUR_DATA.sandbox.us01.dx.commercecloud.salesforce.com -s
    
    # Reindex site and rebuild urls
    sfcc-ci job:run Reindex --instance TBC_YOUR_DATA.sandbox.us01.dx.commercecloud.salesforce.com --sync --json
    sfcc-ci job:run RebuildURLs --instance TBC_YOUR_DATA.sandbox.us01.dx.commercecloud.salesforce.com --sync --json
    
  2. Check website https://TBC_YOUR_DATA.sandbox.us01.dx.commercecloud.salesforce.com/s/RefArch/home?lang=en_US⁠

Tag summary

Content type

Image

Digest

Size

458.3 MB

Last updated

over 6 years ago

docker pull osapishchuk/storefront-reference-architecture-docker