Spartacus

In the last few years ,there has been exponential growth in the number of mobile phone users. Obviously, the reasons include portability, cheap hardware, easy access to the internet and the increased number of services on the internet. With more users on mobile, the optimization of user experience on the phone is essential. That's why, The world of technologies is going to shift to become mobile-friendly. Google started to promote progressive web apps (PWAs) in 2018. Since then, they’re becoming the face of the revolution and setting a new standard for web-application development for eCommerce. For smaller companies, which often do not have native apps due to cost or time constraints, the web app is the key opportunity where they can win customers by providing the best possible experience. SAP is a leading software company around the world, and with its SAP Customer Experience, the company follows and aligns with the latest trends in technology, they’ve decided to add progressive web apps (PWAs) to its flagship product, SAP Commerce Cloud. SAP Spartacus was introduced at SAP CX Live Barcelona in October 2018 with PWA/headless front-end approach. Spartacus is going to be a total game-changer for SAP end users.

Progressive Web Apps (PWA)

Mobile phone apps used to have advantages over traditional web pages. The most important are:

  • Fast and reliable performance

  • Work offline

  • Access to the phone's sensors

  • Support for push notifications

  • An icon on the phone‘s home screen

  • Detectability and availability in app stores

PWAs combine the best of the website with the best of what native apps have to offer, creating a phenomenal mobile user experience. They are special web applications that are accessed like normal websites but offer benefits like offline usability, push notifications, and access to device hardware – things that were previously only available to native apps.​​​ PWA is a website with all the benefits all listed above . PWAs give you a faster, more reliable, and more engaging version of your website or eCommerce store.

Spartacus

If you are following latest trends in ecommerce, you have probably heard this term 'Headless Commerce'. The way to launch storefronts, in keeping with recent trends, is Headless Commerce. Meaning that there’s intentional segmenting of front end UI and core commerce capabilities. Spartacus is an Angular based storefront designed for SAP Hybris Commerce/ SAP Commerce Cloud. It interacts with Hybris Commerce using REST API. Being in an initial phase it still provides most of the core functionalities of the Hybris storefront. Spartacus is extendible and customizable. There are regular updates on Spartacus and the official release is expected in the first quarter of 2019. SAP Commerce Cloud has improved and enriched its customer experience (CX). Moreover, PWA provides a native app-like experience with many features, like home screen installation, push notifications, offline mode, and client-side caching. However, this product comes with an Open Source license. So you can leverage Spartacus and all the future enhancements to it without worrying about any licensing costs. Additionally, you can access the Spartacus code to explore, test, and modify a Storefront as needed.

Architecture of Spartacus

Spartacus has a decoupled architecture that means storefront itself act as a separate entity which on top of its OOTB features can have custom features. It interacts through REST API with SAP Commerce Cloud or any other SAP, non-SAP tool which makes it an independent framework.

Spartacus is modular and extensible. So you can continuously upgrade and benefit from the latest version of components. You are also free to design and add your own components. SAP offers Spartacus as an Angular libraries package. To extend you the advantage of receiving new features and fixes as soon as they are available. You shouldn’t copy and paste the source code when you build a new Storefront. Rather, you should create a new Angular app and add dependencies to the Spartacus libraries.

Requirements

Frontend: Spartacus was written on an Angular platform and also uses node.js and yarn. Each version of Spartacus (1.x, 2.x, or 3.x) requires different versions of Angular, node.js, and yarn.

Backend: To use Spartacus, the SAP Commerce Cloud used must be on at least version 1905, but version 2005 is preferred and recommended.

Installing SAP Commerce 1905 with the Spartacus AddOn

Some of modification required for derived from installing SAP Commerce Cloud 1905 using recipes. The installation procedure includes steps for creating and using a b2c_for_spartacus recipe that makes use of the Spartacus Sample Data Addon.

1) Download and unzip the SAP Commerce Cloud 1905 or upper version zip package.

2) You can download the latest version by clicking on spartacussampledataaddon.zip for the Spartacus Sample Data AddOn.

3) Unzip the spartacussampledataaddon.zip and copy the spartacussampledataaddon folder to hybris/bin/modules/b2c-accelerator.

4) In the \HYB-1905\installer\recipes folder, duplicate the b2c_acc_plus folder and rename the copy of the b2c_acc_plus folder to b2c_for_spartacus.

5) In b2c_for_spartacus, open build.gradle and add below line and Save the file.

In the list of extensions, add below line

extName 'spartacussampledataaddon'

In the addons { forStoreFronts('yacceleratorstorefront') section of the build.gradle file, add 'spartacussampledataaddon' to the names list

addons {

forStoreFronts('yacceleratorstorefront') {

names('spartacussampledataaddon', 'captchaaddon',.....

6) Go to HYB-XXX\installer\customconfig folder, open custom.properties and below line code and save.

initialpassword.admin=<any_password>

Example

initialpassword.admin=nimda

7) Now, Open command prompt terminal and go to HYB-XXX\installer> and execute below command for window

install.bat -r b2c_for_spartacus -A local_property:initialpassword.admin=<<Your_Password>>

8) Initialize the system using the following command:

install.bat -r b2c_for_spartacus -A local_property:initialpassword.admin=nimda initialize

9) Start SAP Commerce Cloud with the following command

install.bat -r b2c_for_spartacus -A local_property:initialpassword.admin=nimda start

10) Verify your system is working.

Display the Admin Console: https://localhost:9002

Display Backoffice: https://localhost:9002/backoffice

Display the Accelerator Electronics storefront: https://localhost:9002/yacceleratorstorefront/?site=electronics-spa