Platform Module Structure
At the core of this architecture is theplatform module, which implements the Factory pattern to support different e-commerce platform strategies.
The directory structure of the platform module is as follows:
Extending the Platform Module
To integrate Enterprise Commerce with a different e-commerce engine, such as BigCommerce, developers simply need to extend the platform layer by adding their own strategy. This addition requires no changes to the frontend layer, maintaining a consistent API across different e-commerce backends. Here’s a high-level overview of the steps to extend the platform module:- Create a new directory within the
platformmodule to house the new strategy, e.g.,bigcommerce. - Implement the necessary normalization logic, GraphQL fragments, queries, mutations, and TypeScript types similar to the existing
shopifystrategy. - Update the
platformmodule’sindex.tsto include and expose the new strategy through the Factory pattern.
platform/your-custom-backend/index.ts