How sayedkhairy/woocommerce works
Project type and purpose
• This is WooCommerce, a full-stack WordPress e-commerce plugin. It extends WordPress on the back end, provides a storefront on the front end, bundles PHP business logic, templates and JavaScript assets, plus REST APIs and extensive test harnesses.
File structure
• Top-level directories:
– assets/ (CSS, JS, fonts, images) – static front-end & admin UI assets
– includes/ (PHP classes: core, admin modules, REST controllers, gateways, integrations, data-stores, emails, shipping, widgets, shortcodes, hooks) – main application logic
– src/ (new PSR-4 PHP code: dependency injection container, proxies, blocks, checkout helpers) – new modular architecture
– templates/ (PHP/HTML templates for front-end and emails) – view layer
– tests/ (legacy unit tests, PHPUnit, Behat CLI, e2e API tests, Puppeteer/Jest for front end) – quality assurance
– bin/, composer.json, vendor management, build scripts – tooling and packaging
• Architectural patterns:
– Service-provider container (src/Internal/DependencyManagement) for DI
– Proxy layer to wrap legacy code (src/Proxies)
– Data-store abstraction for CRUD (includes/data-stores)
– Hook/filter observer pattern (WordPress actions & filters)
– REST API controllers mirrored across v1→v3 in includes/rest-api
– Modular payment gateways, shipping methods, email handlers
README for insights
• Confirms core plugin, no internal architecture doc. Relies on standard WordPress plugin bootstrap (woocommerce.php).
Details to capture
• Use of DI container and proxies bridging legacy and modern code
• Multi-version REST API controllers
• Test harnesses per layer (unit, integration, e2e) as side-bars
• Build & packaging scripts (bin/, composer.json, lerna.json) to developer tooling