How prestashop/hummingbird works
Main Components
• Modules: There is a large “modules” directory containing many PrestaShop modules (e.g., blockwishlist, ps_advertising, ps_banner, etc.). Represent each module as a separate subcomponent or group them functionally (e.g., customer account modules, catalog modules, etc.).
• Template System: The “templates” directory holds various .tpl files organized into sections (catalog, checkout, cms, customer, errors, layouts). Show this as the view layer responsible for rendering the front-end pages.
• Asset Pipeline:
• Source Code (src): This directory contains JavaScript (JS), TypeScript (TS definitions), SCSS files (styles), images, and helper files. It is the “raw” front-end asset source.
• Build Infrastructure (webpack, babel.config.js, postcss.config.js, package.json): Represent these as the asset bundling/compiling unit using Webpack and other tools. They process and compile JS/SCSS to deliver production-ready assets.
• Storybook & Stories (storybook, stories): These directories provide interactive documentation for UI components. Indicate them as the UI development/documentation layer.
• Configuration and CI/CD:
• Configuration files (e.g., .editorconfig, .eslintignore, .eslintrc.js, .stylelintignore, .stylelintrc, tsconfig.json) and CI workflows under “.github/workflows” are essential for code quality and continuous integration.
• Environment configuration for Webpack (the .env examples in the “webpack” folder) should be shown as part of the build/deployment configuration.
• External Services and Deployment:
• CI/CD: Represent the role of Github Actions (via the various YAML files in .github/workflows) which run linting, unit tests, type-checks, and deploy Storybook documentation.
• Continuous Deployment: The README mentions that Storybook gets deployed via Github Pages when code reaches master.
Relationships & Data Flow
• Flow from Development Sources → Asset Build → Generated assets that are then used by PrestaShop’s front-end rendering.
• How configuration and build tools (Webpack, Babel, PostCSS) process the raw assets (found in “src” and “stories”) into the compiled theme.
Architectural Patterns & Design Principles
• Modularity: The project is highly modular – each functionality is in its own module (both PrestaShop modules and separate JS/SCSS components). Highlight this by grouping related modules.
• Separation of Concerns: There is a clear separation between the backend templating (PHP, TPL files), the front-end assets (JS/SCSS), and the build/documentation pipelines.
• Build and Deployment Pipeline: The configuration files and GitHub workflows indicate a robust CI/CD process. Make sure to illustrate this automated pipeline.
Relevant Technologies, Frameworks, and Tools
• PrestaShop (8.1.x): The underlying commerce platform.
• Webpack, Babel, Node.js, and NPM: Tools used for building and bundling assets.
• Storybook: For interactive UI documentation.
• ESLint, Stylelint, and TypeScript: For enforcing coding standards and type checking.
• PHP and TPL: Used within modules and templates for dynamic content rendering.
• SCSS/CSS and JavaScript/TypeScript: For front-end component styling and behavior.