Your SAP Commerce development environment should include the following:
- Java (JDK) 11 installed and configured in the system path. You can verity with
java --version. - Ant 1.10.X installed and configured in the system path. See steps below.
- SAP Commerce Suite version 2011. You can download it from here
- Go to this link
- Choose version jdk-11.0.X_osx-x64_bin.dmg and download it (Requires login in Oracle)
- Execute the DMG and follow the steps
- Open your Terminal app (Quit it first if already open)
- Verify your installation with
java --version, it should display something similar:java 11.0.5 2019-10-15 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.5+10-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.5+10-LTS, mixed mode) - If you receive and error
zsh: command not found: javafollow these steps- Open the Terminal app and write
cd ~to go to your home folder - Open you profile file with your preferred editor (here I will use
nano)- For > MacOS Catalina, execute
nano .zshrc - For Old MacOS version, execute
nano .bash_profile
- For > MacOS Catalina, execute
- Add the following and save it:
export JAVA_HOME=$(/usr/libexec/java_home) export PATH=$JAVA_HOME/bin:$PATH - Quit the Terminal (
command(⌘) + q) and re-open it. - Check installation (Step 5) again.
- Open the Terminal app and write
- Go to this link
- Choose version apache-ant-1.10.9-bin.zip and download it
- Open the Finder app, unzip the file and paste extracted the folder on your HOME folder (Go -> Go to Folder ->
~/) - Open your Terminal app
- Open you profile file with your preferred editor (here I will use
nano)- For > MacOS Catalina, execute
nano .zshrc - For Old MacOS version, execute
nano .bash_profile
- For > MacOS Catalina, execute
- Add the following lines and save
export ANT_HOME=~/apache-ant-1.10.9/ export PATH=$ANT_HOME/bin:$PATH - Quit the Terminal (
command(⌘) + q) and re-open it. - Verify your installation with
ant -vApache Ant(TM) version 1.10.9 compiled on September 27 2020 Trying the default build file: build.xml Buildfile: build.xml does not exist! Build failed
Your Angular development environment should include the following:
- Angular CLI: Version 10.1 or later, < 11. See steps below.
- Node.js: The most recent 12.x version is recommended, < 13. See steps below.
- Yarn: Version 1.15 or later. See steps below.
- Open a terminal and verify
curl -V- If not installed, then install cUrl for MacOS
- Execute the following command
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash - Execute the command
cd ~to go to your home folder - Open you profile file with your preferred editor (here I will use
nano)- For > MacOS Catalina, execute
nano .zshrc - For Old MacOS version, execute
nano .bash_profile
- For > MacOS Catalina, execute
- Add the following lines to the file and save it
export NVM_DIR="$HOME/.nvm" [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion - Quit the Terminal (
command(⌘) + q) and re-open it. - Verify your installation with
nvm --version
- Open the Terminal app
- Execute the following commands
nvm install 12.21.0to install Node.js version 12.21.0nvm use v12.21.0to use the version installednvm alias default v12.21.0to set that version as default
- Verify your installation with
node -v
- Open the Terminal APP
- Execute the following command
npm install -g @angular/cli@10.2.3to install Angular CLI 10.2.3 globally - Verify your installation with
ng versionNote: If you have a version higher that 10.2.3, follow these steps to downgrade
- Open the Terminal app
- Execute the following command
npm install --global yarnto install YARN globally - Verify your installation with
yarn --version
- Open the Terminal app
- Execute the following command
ng config -g cli.packageManager yarn - Verify you configuration with
ng config -g cli.packageManager
Use the next steps to install the project. Please make sure you change all references of to the one that applies to you.
-
Create the following folder structure
/Users/<youruser>/clients/talos/spartacus-training-project/hybris/bin -
Go to the bin folder and clone the repository with the following command
git clone https://github.com/talosdigital/spartacus-training.git custom- If you configured your account with Google Login and you don't have a password then you can clone your repository using an UI Tool like SourceTree, or create a AppPassword in your bitbucket account like this and use it for your terminal configuration.
-
Import the repository into source tree and initialize gitflow. At the end you should be in the develop branch
-
Now is the time to configure some aliases and the Hybris optional config directory (pointing to our local configuration):
- Download the .spartacus-training-profile and change the paths accordingly.
- Place you file at the root of the repository (make sure the name starts with a dot)
- Add your file in your .zshrc (> MacOS Catalina) or .bash_profile (Older MacOS versions). Make sure .zshrc file looks similar to the sample .zshrc. Please change the references to to the values that apply to you.
- Quit the Terminal (
command(⌘) + q) and re-open it. - Run
echo $HYBRIS_OPT_CONFIG_DIRto make sure it was configured properly.
-
Install ImageMagick in your machine:
- If you don't have Homebrew, please install it using the command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Install ImageMagick using the command
brew install imagemagick
- If you don't have Homebrew, please install it using the command
-
Create you local configuration properties by downloading the sample 20-local.properties, changing the values that correspond to your local machine and placing the file in
/Users/<youruser>/clients/talos/spartacus-training-project/hybris/bin/custom/core-customize/project/env/local -
Install hybris code base into your folder structure by running the command
tcproject && ant install -Dhybris.zip.package.src=/path/to/your/CXCOMM201100P_0-70005693.ZIP -
Go to your folder
/Users/<youruser>/clients/talos/spartacus-training-project/hybris/binand run the following command to give execution permissions to all .sh filesfind . -iname "*.sh" -exec chmod a+rx {} \; -
Run the following command to copy the configuration files to the corresponding locations and install all the addons for the project
tcenvconfig && ant installAddons && ant clean all -
Initialize the system by running
tcsetant && ant initialize(The initialization process can take up to 30 minutes) -
Start you Sap Commerce instance
tcsetant && ./hybrisserver.sh
- navigate to
/Users/<youruser>/clients/talos/spartacus-training-project/hybris/bin/custom/js-storefront/taloscommercestore - Install the project dependencies by running
yarn install - Start your spartacus app by running
yarn start --ssl - Open the following URL in your browser
https://localhost:4200
- As the SSR configuration runs with the production flag, you will need to change locally the property value of occBaseUrl in your
taloscommercestore/src/environments/environment.prod.tsto point to you local backend instance (Do not commit this change, it is only to test locally). - Build the project by running
yarn build:ssr - Start the project by running
yarn serve:ssr:local
- Once you open the storefront on VSCode, you need to install the recommended extensions (they will be shown once you open the project)
- Open Webstorm preferences and go to
Languages & Frameworks > Javascript > Prettier. - Select the Prettier package (the one in
taloscommercestore/node_modules/prettier). - Configure the files to be formatted. Use the following values
{**/*,*}.{js,ts,jsx,tsx,json,scss,html} - Mark the On code reformat option as well as the On save one.
- Click Apply and then save your configuration.
- Open Webstorm preferences and go to
Editor & Code Style > TypeScriptand make sure the value ofUse path mapping from tsconfig.jsonhas the valueOnly in files outside specified paths.
- Configure gitflow by following th next steps:
- Make sure you are in the master branch
- Go to
Repository (menu) > Git flow/ Hg flow > Initialize Repository - Initialize gitflow with the default settings. In Case you get the error message
Device not configured, run the following commandgit config credential.helper sourcetree
- In order for Husky to work with SourceTree, you must run the following command
sudo launchctl config user path "/usr/local/bin:$PATH"and restart your computer. Make sure/usr/local/binis in your$PATH
- Add SVG icon to the SVG folder
src/assets/svg - Execute the script
yarn generate:sprite - Verify that a file name
icons-sprite.svgis generated insrc/assets/icons
| Web App | Url |
|---|---|
| Storefront | https://localhost:4200 |
| Backoffice | https://localhost:9002/backoffice |
| Hac | https://localhost:9002/hac |
| SmartEdit | https://localhost:9002/smartedit |
| Swagger | https://localhost:9002/occ/v2/swagger-ui.html |