Skip to content

Commit

Permalink
Merge pull request #17 from commercetools/prateek-ct-patch-2
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
leungkinghin-ct authored Nov 13, 2023
2 parents 9d356b6 + 9fceeed commit 80e982b
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# connect-product-ingestion-template
This repository provides a [connect](https://docs.commercetools.com/connect) template for a search ingestion connector for populating a Store-specific external search engine. This boilerplate code acts as a starting point for such integration.
This repository provides a [connect](https://docs.commercetools.com/connect) template for a product ingestion connector for populating a external systems with product data from composable commerce. This boilerplate code acts as a starting point for such integration.

This template uses the [Store](https://docs.commercetools.com/api/projects/stores) and [Product Selection](https://docs.commercetools.com/api/projects/product-selections) data models from commercetools composable commerce which can be used for querying Store-specific product data to power Store-specific frontends. Template is based on asynchronous [Subscriptions](https://docs.commercetools.com/api/projects/subscriptions) to keep the search indices up to date.
This template uses the [Product type](https://docs.commercetools.com/api/projects/productTypes), [Product](https://docs.commercetools.com/api/projects/products), [Store](https://docs.commercetools.com/api/projects/stores), [Product Selection](https://docs.commercetools.com/api/projects/product-selections) data models from commercetools composable commerce which can be used for querying Store-specific product data to sync into external systems. Template is based on asynchronous [Subscriptions](https://docs.commercetools.com/api/projects/subscriptions) to keep the external systems up to date.

## Template Features
- NodeJS supported.
Expand All @@ -18,30 +18,30 @@ Users are expected to create API client responsible for fetching product, store
#### 2. commercetools composable commerce Data setup
Users are expected to create store and link product selection, accordingly linking products to corresponding product selection. The Store detail is taken as input as an environment variable / configuration for connect. Details of store can be provided as environment variables (configuration for connect) `CTP_STORE_KEY`. For details, please read [Deployment Configuration](./README.md#Deployment Configuration).

#### 3. external search index creation
Users are expected to create search index in external search engine . The index details are taken as input as an environment variable / configuration for connect. Details of search index can be provided as environment variables (configuration for connect) `SEARCH_PLATFORM_CONFIG`.For details, please read [Deployment Configuration](./README.md#Deployment Configuration).
#### 3. external system
Users are expected to create api clients/ keys in external system . Those details are taken as input as an environment variable / configuration for connect. Details of external system can be provided as environment variables (configuration for connect) `SEARCH_PLATFORM_CONFIG`.For details, please read [Deployment Configuration](./README.md#Deployment Configuration).


## Getting started
The template contains two separated modules :
- Full Ingestion : Provides a REST-API to users to export all products from specific store of a commercetools project to external search index as initial load or for full reindexing whenever needed.
- Incremental Updater : Receives message from commercetools project once there are product changes in commercetools store. The modified products are then synchronized to the existing external search index.
- Full Ingestion : Provides a REST-API to users to export all products from specific store of a commercetools project to external system as initial load or for full reindexing whenever needed.
- Incremental Updater : Receives message from commercetools project once there are product changes in commercetools store. The modified products are then synchronized to the external system.

Regarding the development of both modules, please refer to the following documetations:
- Development of Full Ingestion
- Development of Incremental Updater

#### 1. Develop your search-specific needs
To import the [commercetools composable commerce Product Projections](https://docs.commercetools.com/api/projects/productProjections) to external search index, users need to extend this connector with the following tasks
- Data Mapping: Implementaion to transform the product projection objects from commercetools structure to users-desired structure for the search index.
- Data Persistence: Implementation to save/remove product data to the specific search index using libraries provided by external search product. Please remember that the product data might not be saved into the external search index in a single attempt, it should have needed retry and recovery mechanism.
#### 1. Develop your specific needs
To import the [commercetools composable commerce Product Projections](https://docs.commercetools.com/api/projects/productProjections) to external system, users need to extend this connector with the following tasks
- Data Mapping: Implementaion to transform the product projection objects from commercetools structure to users-desired structure for external system.
- Data Persistence: Implementation to save/remove product data to the external system using libraries provided by external systems. Please remember that the product data might not be saved into the external system in a single attempt, it should have needed retry and recovery mechanism.

#### 2. Register as connector in commercetools Connect
Follow guidelines [here](https://docs.commercetools.com/connect/getting-started) to register the connector for public/private use.


## Deployment Configuration
In order to deploy your customized search connector application on commercetools Connect, it needs to be published. For details, please refer to [documentation about commercetools Connect](https://docs.commercetools.com/connect/concepts)
In order to deploy your customized connector application on commercetools Connect, it needs to be published. For details, please refer to [documentation about commercetools Connect](https://docs.commercetools.com/connect/concepts)
In addition, in order to support connect, the search connector template has a folder structure as listed below
```
├── full-ingestion
Expand Down Expand Up @@ -76,7 +76,7 @@ deployAs:
- key: CTP_REGION
description: Region of commercetools project
- key: SEARCH_PLATFORM_CONFIG
description: Escaped JSON object including credentails to search platform and other settings
description: Escaped JSON object including credentails to external platform and other settings
- name: incremental-updater
applicationType: event
endpoint: /deltaSync
Expand All @@ -98,7 +98,7 @@ deployAs:
- key: CTP_REGION
description: Region of commercetools project
- key: SEARCH_PLATFORM_CONFIG
description: Escaped JSON object including credentails to search platform and other settings
description: Escaped JSON object including credentails to external platform and other settings
```

Here you can see the details about various variables in configuration
Expand All @@ -107,7 +107,7 @@ Here you can see the details about various variables in configuration
- CTP_CLIENT_SECRET: The client secret of commercetools user account. It is used in commercetools client to communicate with commercetools platform via SDK.
- CTP_SCOPE: The scope constrains the endpoints to which the commercetools client has access, as well as the read/write access right to an endpoint.
- CTP_REGION: As the commercetools APIs are provided in six different region, it defines the region which your commercetools user account belongs to.
- SEARCH_PLATFORM_CONFIG: It defines the configurations required by the external search index, such as credentials, search index unique identifier, etc.
- SEARCH_PLATFORM_CONFIG: It defines the configurations required by the external system, such as credentials, search index unique identifier, etc.
Following is a sample JSON object of this variable.

```
Expand Down

0 comments on commit 80e982b

Please sign in to comment.