{"id":19622194,"url":"https://github.com/commercetools/launchpad-algolia-sync","last_synced_at":"2025-08-25T05:15:38.670Z","repository":{"id":202610476,"uuid":"697801141","full_name":"commercetools/launchpad-algolia-sync","owner":"commercetools","description":"Search connector application for synchronization between the Good Store and Algolia","archived":false,"fork":false,"pushed_at":"2024-07-04T11:17:44.000Z","size":740,"stargazers_count":5,"open_issues_count":5,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-20T15:17:58.344Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commercetools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-28T13:59:33.000Z","updated_at":"2025-04-16T16:15:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"55a7022d-7b9a-46b6-8dd0-e01ef6ac3ebb","html_url":"https://github.com/commercetools/launchpad-algolia-sync","commit_stats":null,"previous_names":["commercetools/goodstore-algolia-sync","commercetools/launchpad-algolia-sync"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Flaunchpad-algolia-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Flaunchpad-algolia-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Flaunchpad-algolia-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Flaunchpad-algolia-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commercetools","download_url":"https://codeload.github.com/commercetools/launchpad-algolia-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251246391,"owners_count":21558762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T11:26:32.935Z","updated_at":"2025-04-28T03:32:26.420Z","avatar_url":"https://github.com/commercetools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# launchpad-algolia-sync\nThis is a connect application which aims at synchronizing products between `Launchpad template` and algolia search index. This repository is developed based on [connect-search-ingestion-template](https://github.com/commercetools/connect-search-ingestion-template)\n\nThis connector uses the [Product type](https://docs.commercetools.com/api/projects/productTypes) and [Product](https://docs.commercetools.com/api/projects/products) data models from composable commerce which can be used for mapping and syncing data into Algolia index to power frontend. Connector is based on asynchronous [Subscriptions](https://docs.commercetools.com/api/projects/subscriptions) to keep the search index up to date.\n\n## Connector Features\n- NodeJS supported.\n- Uses Express as web server framework.\n- Uses [commercetools SDK](https://docs.commercetools.com/sdk/js-sdk-getting-started) for the commercetools-specific communication.\n- Includes local development utilities in npm commands to build, start, test, lint \u0026 prettify code.\n- Uses JSON formatted logger with log levels\n- Setup sample integration tests with [Jest](https://jestjs.io/) and [supertest](https://github.com/ladjs/supertest#readme)\n\n## Prerequisite\n#### 1. commercetools composable commerce API client\nUsers are expected to create API client responsible for fetching product details from composable commerce project, API client should have enough scope to be able to do so. These API client details are taken as input as an environment variable/ configuration for connect. Details of composable commerce project can be provided as environment variables (configuration for connect) `CTP_PROJECT_KEY` , `CTP_CLIENT_ID`, `CTP_CLIENT_SECRET`, `CTP_SCOPE`, `CTP_REGION`. For details, please read [Deployment Configuration](./README.md#deployment-configuration).\n\n\n#### 2. Algolia index creation\nUsers are expected to create search index in Algolia. 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).\n\n \n## Getting started\nThe connector contains two separated modules :\n- Full Ingestion : Provides a REST-API to users to export all products from specific store of a commercetools project to Algolia index for initial load or  for full reindexing whenever needed. \n- Incremental Updater : Receives message from composable commerce project once there are product changes. The modified products are then synchronized to the existing Algolia index.\n\n\n#### 1. Develop your search-specific needs \nWhile extending Launchpad data model in composable commerce, users need to also extend this connector with the following tasks\n- Data Mapping: Implementation to transform the product type \u0026 product resources from commercetools structure to users-desired structure for the Algolia index.\n- Data Persistence: Implementation to save/remove new mapped product data to the specific Algolia index using Algolia libraries included in the connector.\n\n#### 2. Register as connector in commercetools Connect\nFollow guidelines [here](https://docs.commercetools.com/connect/getting-started) to register the connector for private use. \n\n## Deployment Configuration\nIn order to deploy your Algolia connector application on commercetools Connect, it needs to be published. Connector needs to be published with certification false to be able to create deployment for production use. For details, please refer to [documentation about commercetools Connect](https://docs.commercetools.com/connect/concepts)\nIn addition, in order to support connect, the search connector template has a folder structure as listed below\n```\n├── full-ingestion\n│   ├── src\n│   ├── test\n│   └── package.json\n├── incremental-updater\n│   ├── src\n│   ├── test\n│   └── package.json\n└── connect.yaml\n```\n\nConnect deployment configuration is specified in `connect.yaml` which is required information needed for publishing of the application. Following is the deployment configuration used by full ingestion and incremental updater modules\n```\ndeployAs:\n  - name: full-ingestion\n    applicationType: service\n    endpoint: /fullSync\n    scripts:\n      postDeploy: npm install\n    configuration:\n      securedConfiguration:\n        - key: CTP_PROJECT_KEY\n          description: commercetools project key\n        - key: CTP_CLIENT_ID\n          description: commercetools client ID\n        - key: CTP_CLIENT_SECRET\n          description: commercetools client secret\n        - key: CTP_SCOPE\n          description: commercetools client scope\n        - key: CTP_REGION\n          description: Region of commercetools project\n        - key: LOCALE\n          description: Locale used in launchpad site. It includes 'en-US', 'de-DE'\n        - key: SEARCH_PLATFORM_CONFIG\n          description: Escaped JSON object including credentials to search platform and other settings\n  - name: incremental-updater\n    applicationType: event\n    endpoint: /deltaSync\n    scripts:\n      postDeploy: npm install \u0026\u0026 npm run connector:post-deploy\n      preUndeploy: npm install \u0026\u0026 npm run connector:pre-undeploy\n    configuration:\n      standardConfiguration:\n        - key: CTP_PRODUCT_CHANGE_SUBSCRIPTION_KEY\n          description: Key of commercetools subscription which subscribes any change in commercetools product resources\n      securedConfiguration:\n        - key: CTP_PROJECT_KEY\n          description: commercetools project key\n        - key: CTP_CLIENT_ID\n          description: commercetools client ID\n        - key: CTP_CLIENT_SECRET\n          description: commercetools client secret\n        - key: CTP_SCOPE\n          description: commercetools client scope\n        - key: CTP_REGION\n          description: Region of commercetools project\n        - key: LOCALE\n          description: Locale used in launchpad site. It includes 'en-US', 'de-DE'\n        - key: SEARCH_PLATFORM_CONFIG\n          description: Escaped JSON object including credentials to search platform and other settings\n```\n\nHere you can see the details about various variables in configuration\n- CTP_PROJECT_KEY: The key of commercetools project.\n- CTP_CLIENT_ID: The client ID of your commercetools user account. It is used in commercetools client to communicate with commercetools platform via SDK.\n- CTP_CLIENT_SECRET: The client secret of commercetools user account. It is used in commercetools client to communicate with commercetools platform via SDK.\n- 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.\n- CTP_REGION: As the commercetools APIs are provided in six different region, it defines the region which your commercetools user account belongs to.\n- CTP_PRODUCT_CHANGE_SUBSCRIPTION_KEY: Key of commercetools subscription which subscribes any change in commercetools product resources. Remind that it needs to be unique per deployed connector application. That means it cannot be shared among multiple applications and Algolia search indices.\n- LOCALE: Locale in `launchpad`. It includes 'en-US' and 'de-DE'. Since it is suggested each search index supports only single locale, locale code requires to be provided as environment variable for connector.\n- SEARCH_PLATFORM_CONFIG: It defines the configurations required by the Algolia index, such as credentials, Algolia index unique identifier, etc.\n  Following is a sample JSON object of this variable.\n  \n    ```\n    {\n        applicationId: xxx,\n        searchApiKey: yyy,\n        index: zzz\n    }\n\n    ```\n  The value of this configuration variable needs to be in escaped JSON format. Hence, based on the sample above, the expected value of this variable becomes\n  ```\n  '{ \"applicationId\": \"xxx\", \"searchApiKey\": \"yyy\", \"index\": \"zzz\" }'\n  ```\n- CTP_STORE_KEY : Only used in incremental updater. It specifies the key of commercetools store so that connector can look up the modified product under the specific store in commercetools platform.\n\n## Recommendations\n#### Implement your own test cases\nWe have provided simple integration test cases with [Jest](https://jestjs.io/) and [supertest](https://github.com/ladjs/supertest#readme). The implementation is under `test` folder in both `full-ingestion` and `incremental-updater` modules. It is recommended to implement further test cases based on your own needs to test your development. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Flaunchpad-algolia-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommercetools%2Flaunchpad-algolia-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Flaunchpad-algolia-sync/lists"}