/sample-wch-sites-storefront

A storefront sample using Acoustic Content site functionality.

Primary LanguageTypeScriptApache License 2.0Apache-2.0

sample-wch-sites-storefront

An E-Shopper storefront sample which uses Acoustic Content (formerly Watson Content Hub or WCH) sites.

products page

Prerequisites

  • An Acoustic Content tenant in Trial or Standard Tier
  • wchtools-cli v2.1.3 or above
  • Node.js v6.11.1 or above

Preparation

The deployment step of this repository pushes the Single Page Application (SPA) files into the WCH tenant, overlaying existing files. It will overlay any existing files in the web asset folder. We recommend to first do a pull with wchtools in case you want to keep artifacts that you still need. If you use the Sites SPA, it will get overlayed and existing pages will no longer render.

Limitations: Inline editing will not work with this sample at this time.

To use

  1. Install dependencies with npm install
  2. Add your WCH and Commerce configuration in src/app/commerce/dxconfig/serverConfig.json, replace each empty string with a string containing the correct value for the according key for your environment:
	can be found in Homepange of WCH-> Profile Tab with username-> Hub information -> Content hub ID
	"contentHubID": "YOUR WATSON CONTENT HUB ID", 

	--can be found in Homepange of WCH-> Profile Tab with username-> Hub information -> Domain name
	"contentHubDomainName": "YOUR WCH DOMAIN NAME",

	put your backend commerce server domain name - i.e. commerceserver.ibm.com
	"commerceSearchDomainName": "commerceserver.ibm.com", 

	put your backend commerce server ssl port - i.e. 443
	"commerceSearchSecurePort":"443",

	put your backend commerce server context root for search - i.e. /search/resources
	"commerceSearchContextPath":"/search/resources",

	put your transaction commerce server domain name - i.e. commerceserver.ibm.com
	"commerceTransactionDomainName": "commerceserver.ibm.com", 

	put your transaction commerce server SSL port - i.e. 443
	"commerceTransactionSecurePort": "443",

	put your transaction commerce server context root - i.e. /wcs/resources
	"commerceTransactionContextPath":"/wcs/resources",

	put your transaction commerce server store ID - i.e. 1
	"commerceStoreID": "1",

	put your transaction commerce server catalog ID - i.e. 10502
	"commerceCatalogID": "10502"
  1. Add your Commerce server to the trusted cross-origin domains under WCH -> Hub setup -> General settings -> Security
  2. Configure your commerce server to send CORS headers for localhost, and your tenant live and preview host
  3. Run wchtools init to setup the WCH tools CLI
  4. Run wchtools delete -A --all -v to empty your tenant to get a fresh start. WARNING: This will delete all your tenant's Content, Assets, Types, Layouts, Pages, Taxonomies and Image Profiles. Read more here
  5. Add the site artifacts with npm run init-content
  6. Set your tenant information in src/app/Constants.ts, then run a local development server with npm start
  7. Customize your site, read more here
  8. Build with npm run build
  9. Deploy Angular app, SPA or layout changes to WCH with npm run deploy