How adobe/adobe-commerce-samples works
Project Type and Purpose
• This is a “sample-code” monorepo for Adobe Commerce extensibility.
• It is not a single running application but a set of independent extension examples:
• admin-ui-sdk (front-end and serverless actions for Admin UI)
• api-mesh (GraphQL mesh proxies for Commerce and external APIs)
• events (serverless event-triggered actions)
• webhooks (serverless webhook handlers)
• starter-kit (end-to-end sample projects combining events, ingestion, scripts)
File-Structure Analysis
• Top-level directories each represent a “sample category.”
• Under admin-ui-sdk are multiple “extension packages.” Each package has:
• app.config.yaml & extension-manifest.json (deployment metadata)
• actions/commerce-backend-ui-1 (serverless registration code)
• web-src (React UI code loaded into Admin UI)
• api-mesh modules contain meshConfig.json, GraphQL schemas and resolvers, sample.env for environment variables.
• events and webhooks subdirectories follow a similar pattern:
• actions/<type> containing registration/config and index.js.
• tests or jest.setup.js for unit tests.
• starter-kit is a self-contained sample project:
• actions (customer, order, external, email, stock, etc.)
• app.config.yaml, hooks/, scripts/, utils/, test/
README Insights
• The repo is educational, meant to teach Adobe Commerce extension patterns.
• No single architecture is “running” here; instead there are dozens of small runtime modules deployable to Adobe I/O Runtime (Apache OpenWhisk).
a. Main Components
• Developer Workstation (AIO CLI & Git)
• Adobe I/O Runtime (serverless environment)
• Adobe Commerce Admin UI (host for web-src bundles)
• API Mesh Gateway (GraphQL proxy layer)
• External Services (e.g., third-party APIs, Adobe I/O Events)
b. Relationships and Data Flows
1. Developer uses AIO CLI to deploy each sample to Adobe I/O Runtime and register extension manifest with Commerce.
2. Admin UI loads web-src bundles (React UI) per extension-manifest.json.
3. UI code invokes serverless “actions” (commerce-backend-ui-1) via Adobe I/O Runtime endpoints.
4. Actions either call Commerce REST/GraphQL APIs or forward data to the API Mesh.
5. API Mesh merges Commerce GraphQL with external APIs and returns unified responses.
6. Event-triggered and webhook modules subscribe to Commerce event bus or webhook endpoints; they run actions on triggers.
7. starter-kit scripts and on-deploy hooks configure event subscriptions and back-office providers.
c. Architectural Patterns
• Micro-frontends: each admin-ui-sdk package is a small React app loaded at specific UI extension points.
• Serverless “actions”: discrete OpenWhisk functions registered with Adobe Commerce event bus.
• API Gateway / GraphQL Mesh: decouples client from multiple REST/GraphQL back-ends.
• Event-driven architecture: commerce events → event actions or webhook actions.
d. Key Technologies
• React (web-src)
• Node.js serverless actions
• Adobe I/O Runtime (OpenWhisk)
• GraphQL Mesh (api-mesh)
• YAML configs (app.config.yaml, meshConfig.json)
• AIO CLI (deployment)
Elements
• CLI → I/O Runtime (Deploy)
• Admin UI → web-src bundles
• UI → Serverless Actions
• Actions → Commerce APIs / API Mesh
• Event Source → Event Actions
• Blue for front-end (React)
• Green for serverless actions
• Orange for API Mesh components
• Gray for external services/config