Spartacus Setup
In this post, I will introduce the installation of Spartacus in our local environment by using occ v2 api from the hybris cloud platform. The cloud platform link is https://spartacus-demo.eastus.cloudapp.azure.com:8443
Spartacus is a lean, Angular-based JavaScript storefront for SAP Commerce Cloud. Spartacus talks to SAP Commerce Cloud exclusively through the Commerce REST API and is also an open-source project.
Before jumping into the Spartacus setup, you must check some requirements to start setup in your environment.
Your Angular development environment should include the following:
- Angular CLI: Version 12.0.5 or later, < 13.
- Yarn: Version 1.15 or later.
- Node.js: The most recent 14.x version is required.
Firstly we will check the requirements. By the way, the requirements may change day by day according to the Spartacus version.
Enter the command your terminal: ng version
and you get like the image as shown below;
After you have checked the requirements, you could follow these commands to complete the Spartacus installation steps;
1- Create a new angular app:
ng new karahanstore --style=scss
and change the directory for the new app;
cd karahanstore
2- Add Spartacus:
ng add @spartacus/schematics@latest --baseUrl https://spartacus-demo.eastus.cloudapp.azure.com:8443/ --baseSite=electronics-spa --ssr
3- Run App with “ng serve” or “ng s” terminal command
ng serve
And voila :) The Spartacus storefront has installed our environment
If you have any questions about this article don’t hesitate to contact me.