Skip to main content
Divine eCommerce is built on its own small PHP framework assembled from standard PSR components — not a fork of another shop.

Stack

Folders

Modules

Each module under src/Modules/ owns its routes, controllers, models and services:

Request pipeline

nginx passes every non-static request to public/index.php, then through PSR-15 middleware in this order:
  1. Error handler — error pages and the application log, plus detailed traces when APP_DEBUG=true.
  2. Security headers.
  3. Session.
  4. Method override — HTML forms can send PUT and DELETE through a _method field.
  5. Authentication — loads the signed-in account and its role permissions.
  6. CSRF — every POST, PUT, PATCH and DELETE needs a valid token, except under /api/.
  7. Clockwork profiler — only when APP_DEBUG=true.
Route groups add access checks: manager or higher for /admin (with per-section permissions — see Staff & permissions), a signed-in account for /account.

Events and hooks

The core dispatches four events — OrderCreated, ProductUpdated, CartItemAdded and CustomerRegistered — through league/event; the core itself listens to ProductUpdated to keep the filter index current. Templates expose hook positions (home.before_content, home.after_content) that modules and plugins fill with HookRegistry::register(). Details in Write a plugin.

Templates

  • Pages live in src/App/Frontend/views/ — page/, components/, layouts/, emails/ and errors/. The base layouts are layouts/base/client.twig and layouts/base/admin.twig.
  • Each module’s Views/ folder is available as a Twig namespace named after the module, for example @slider; so is each active plugin’s, for example @example_hello.
  • There’s no theme or override layer: customize the store by editing these templates and the SCSS.
  • Useful Twig functions: csrf_field(), method_field(), asset(), menu('header'), hook('…'), module_styles() / module_scripts(), admin_can('/admin/…').

Database

  • PostgreSQL only. Search and the write layer depend on it.
  • Writes go through BaseRepository helpers — insertRow(), updateRow(), insertAndGetId() — which convert booleans safely for PostgreSQL. make lint-writes (also part of make check and CI) fails when a model writes another way.
  • Money is handled with brick/money, in a single currency, UAH.
  • Search reads products directly and everything else from a materialized view, search_index, which the worker refreshes within about a minute of a change.
  • Filters are served from precomputed facet tables (product_facets, facet_settings), rebuilt per product on every change and in full by Rebuild or make reindex-facets.