Code Monkey home page Code Monkey logo

fcecom-bridge-api-sap-commerce-cloud's Introduction

FirstSpirit Connect for Commerce - SAP Commerce Cloud Bridge

Overview

Connect for Commerce Bridge API

The bridge API serves as a REST interface which is able to fetch content, product and category information from any shop backend and to display them in reports in the FirstSpirit ContentCreator.

In order to connect the bridge API with a given shop backend a bridge is needed. It acts as a microservice between the shop backend and FirstSpirit. Further information about how to implement and use a bridge can be found in the official documentation.

For more information about FirstSpirit or Connect for Commerce please use this contact form to get in touch.

SAP Commerce Cloud

This project implements the bridge API to connect FirstSpirit and the SAP Commerce Cloud e-commerce platform.

For more information about SAP Commerce Cloud visit the SAP commerce website. Lean more about their API here and here.

Prerequisites

Getting Started

Configuration

The configuration is done by copying the .env.template file in the root directory to a .env file and editing it.

Param Description
PORT The port on which the bridge is started.
BRIDGE_AUTH_USERNAME The username to access the bridge's API.
BRIDGE_AUTH_PASSWORD The password to access the bridge's API.
DEFAULT_LANG The default bridge language used to retrieve fallback languages in the PUT/POST bodies.
CONN_MODE Whether to use HTTP or HTTPS for the bridge's API.
SSL_CERT The path to the certificate file to use when using HTTPS.
SSL_KEY The path to the private key file to use when using HTTPS.
OAUTH_TOKEN_URL The URL where the Oauth token can be retrieved from SAP Commerce.
BASE_URL The base URL of the SAP Commerce Server (the URL without any paths).
MEDIA_CDN_URL The URL of the Server where the Media files (Images) reside. (SAP Commerce default: the same as the BASE_URL).
OCC_PATH The path of the OCC V2 api, relative to the BASE_URL (SAP Commerce default: "/occ/v2/").
CMS_PATH The Path of the CMS webservices API, relative to the BASE_URL (SAP Commerce default: "/cmswebservices/v1/sites/").
BASE_SITE_ID The ID of the SAP Commerce Basesite used for content and products.
CATALOG_ID The ID of the product catalog used in SAP Commerce.
CATALOG_VERSION The version of the product catalog used in SAP Commerce.
CONTENT_CATALOG_ID The ID of the content catalog used in SAP Commerce.
CONTENT_CATALOG_VERSION The version of the content catalog used in SAP Commerce.
API_USERNAME The username to authenticate to SAP Commerce.
API_PASSWORD The password to authenticate to SAP Commerce.
CLIENT_ID The client ID used to authenticate to SAP Commerce using OAuth2.
CLIENT_SECRET The client secret used to identify to SAP Commerce using OAuth2.
AIR_KEY The AIR (Application Interface Register) Key, as obtained from SAP (optional).

Configure Template Mapping

To map FirstSpirit Templates to SAP Commerce Cloud Templates this Bridge uses a simple .json file, which can be found at 'src/resources/FStoSAPTemplateMapping.json'. To add to this map simply use the FirstSpirit template Ids as keys and the SAP Commerce Cloud template Ids as values.

Run bridge

Before starting the bridge for the first time, you have to install its dependencies:

npm install

To start the bridge run:

npm start

Run bridge in development mode

To start the bridge and re-start it whenever a file changed:

npm run start:watch

View the Swagger UI interface

Open http://localhost:3000/docs in your browser to display the bridge's interactive API documentation.

Configure FirstSpirit Module

In order to enable the Connect for Commerce FirstSpirit Module to communicate with the bridge, you have to configure it. Please refer to the documentation to learn how to achive this.

Multi-Tenant Support

We provide an example Dockerfile and docker-compose.yml to enable multi-tenant support for this service.

Build and tag the Docker image with a custom name and version:

docker build -t <IMAGE_NAME>:<VERSION> .

The docker-compose.yml demonstrates how to define multiple instances of the bridge with a different configuration.

Replace <IMAGE_NAME>:<VERSION> with the name and tag that you chose for your Docker image. Each configuration for an instance is set with a different .env.* file. The path to it needs to be defined under env_file.

Start the containers:

docker compose up -d

Stop the containers:

docker compose down

Please be aware that the Docker containers need to be accessible from your FirstSpirit instance in order to work with the Connect for Commerce module. A deployment to a Cloud provider might be necessary for this.

Legal Notices

The FirstSpirit Connect for Commerce SAP Commerce Cloud bridge is a product of Crownpeak Technology GmbH, Dortmund, Germany. The FirstSpirit Connect for Commerce SAP Commerce Cloud bridge is subject to the Apache-2.0 license.

Details regarding any third-party software products in use but not created by Crownpeak Technology GmbH, as well as the third-party licenses and, if applicable, update information can be found in the file THIRD-PARTY.txt.

Disclaimer

This document is provided for information purposes only. Crownpeak may change the contents hereof without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. Crownpeak specifically disclaims any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. The technologies, functionality, services, and processes described herein are subject to change without notice.

fcecom-bridge-api-sap-commerce-cloud's People

Contributors

ecom-espirit avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

davidwaldmann

fcecom-bridge-api-sap-commerce-cloud's Issues

Grant_type of OAuth2 is hardcoded to "password" and cannot be changed

The grant_type of OAuth2 cannot be changed via the .env-Parameters from "password" to "client-credentials", for example. (Even though it is possible to set client_id and client_secret.

src->utils->http-client.js (line 17):
const getOwnerCredentials = oauth.client(axios.create(), { url, grant_type: 'password', client_id, client_secret, username, password });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.