How spryker-feature/spryker-core-e-commerce works
Project Type and Purpose
• This is a Composer-packaged Spryker “feature” library named “spryker-core-e-commerce.” It provides a set of self-contained modules (e.g., Catalog, Cart, Prices, Product) that plug into a larger Spryker application to deliver core e-commerce functionality.
• It is not a standalone application but an extension package meant to be installed into the Spryker Commerce OS. Its purpose is to supply reusable business modules.
File Structure
• Top-level files:
• .travis.yml – CI configuration
• LICENSE – license terms
• README.md – high-level description
• composer.json – package metadata & dependencies
• No src/ or modules/ directory is shown here, but by Spryker convention each feature ships its modules under a src directory following the pattern:
src/SprykerFeature/SprykerCoreECommerce/*Module*/
• Each module will typically have sub-directories for Communication, Business, Persistence, Shared, etc.
README for Additional Insights
• The README confirms the package delivers “main modules providing E-commerce functionality like Catalog, Cart, Prices, Product.”
• Installation via composer require spryker-feature/spryker-core-e-commerce implies it plugs into the standard Spryker dependency injection and module registration mechanism.
a. Main Components
• Spryker Application Shell (host application)
• Core E-commerce Feature Package
• Catalog Module
• Cart Module
• Prices Module
• Product Module
• (Any additional modules shipped in the feature)
• Shared Infrastructure
• Database (e.g., MySQL)
• Search Engine (e.g., Elasticsearch)
• Message Broker or Event Bus (optional)
• External Integrations (e.g., Payment Providers, Tax Services)
b. Relationships & Interactions
• Modules communicate via Spryker facades and transfer objects.
• Frontend (Yves) layer calls the Cart and Product facades.
• Zed (back-office) layer uses Persistence repositories.
• Business logic modules invoke each other (e.g., Cart calls Prices to calculate totals, Catalog calls Product to retrieve details).
• Persistence modules read/write from the shared database.
• Search modules index to and query from Elasticsearch.
c. Architectural Patterns & Design Principles
• Modular Monolith: each feature module encapsulates its own Business, Persistence, Communication layers.
• Layered Architecture:
• Communication Layer (Controllers, Plugins)
• Business Layer (Facade, Model)
• Persistence Layer (Repositories, Entities)
• Shared Layer (Transfer Objects, Constants)
• Dependency Inversion: modules depend on facades or interfaces rather than concrete implementations.
d. Key Technologies & Frameworks
• PHP 7.x/8.x, Composer
• Spryker Commerce OS (Yves + Zed applications)
• Symfony HTTP Foundation (under the hood)
• Doctrine DBAL or Propel for persistence
• Elasticsearch client (for search)