# prestashop/example-modules architecture

> Architecture diagram of the GitHub repository prestashop/example-modules, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prestashop/example-modules
- Repository: https://github.com/prestashop/example-modules

## Overview

This repository is a collection of PrestaShop example modules, not one end-user application: each module demonstrates a distinct extension point or workflow. The clearest sampled workflow is the customer-review status action: an admin request reaches a controller, which dispatches a CQRS command; its handler looks up or creates the reviewer and updates its status. The multistore example separately demonstrates CRUD forms, a listing grid, and shop-aware operations. README-described capabilities are retained as module-level nodes where source wiring was not sampled, so their internal connections are intentionally omitted.

Main entry points: [`demomultistoreform/src/Controller/DemoMultistoreController.php`](https://github.com/prestashop/example-modules/blob/master/demomultistoreform/src/Controller/DemoMultistoreController.php) (Content block controller), [`demoextendsymfonyform3/src/Repository/ReviewerRepository.php`](https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Repository/ReviewerRepository.php) (Reviewer repository), [`demoextendsymfonyform3/src/Domain/Reviewer/CommandHandler/ToggleIsAllowedToReviewHandler.php`](https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Domain/Reviewer/CommandHandler/ToggleIsAllowedToReviewHandler.php) (Toggle handler), [`demoextendsymfonyform3/src/Controller/Admin/CustomerReviewController.php`](https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Controller/Admin/CustomerReviewController.php) (Review action)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin experiences"]
  node_review_controller["Review action"]
  node_multistore_controller["Content block controller"]
  node_content_grid["Content block grid"]
  node_grid_example["Admin grid demo"]
  node_tabs_example["Controller tabs"]
  node_extend_grid_example["Grid row actions"]
end

subgraph group_data["Data and forms"]
  node_review_command["Toggle command"]
  node_review_handler["Toggle handler"]
  node_review_repo["Reviewer repository"]
  node_review_entity["Reviewer entity<br/>[Reviewer.php]"]
  node_review_query_handler["Settings query handler"]
  node_review_database[("Reviewer records")]
  node_content_query["Content block query"]
  node_content_form["Content block forms"]
  node_content_entity["Content block entity<br/>[ContentBlock.php]"]
  node_orm_store[("ORM persistence")]
  node_doctrine_example["Doctrine example"]
end

subgraph group_integration["Platform integrations"]
  node_api_example["API customization"]
  node_dashboard_example["Dashboard hooks"]
  node_console_example["Console command"]
  node_form_hooks_example["Form hooks"]
  node_cqrs_hooks_example["CQRS and hooks"]
  node_templates_example["Template extensions"]
  node_module_routes_example["Module routes"]
  node_js_routing_example["JavaScript routing"]
end

subgraph group_examples["Other examples"]
end

node_admin(("Admin user"))
node_multistore_user(("Admin user"))

node_admin -->|"requests status change"| node_review_controller
node_review_controller -->|"dispatches"| node_review_command
node_review_handler -->|"looks up reviewer"| node_review_repo
node_review_handler -->|"creates or updates"| node_review_entity
node_review_repo -->|"queries"| node_review_database
node_review_query_handler -->|"reads settings"| node_review_repo
node_multistore_user -->|"uses CRUD pages"| node_multistore_controller
node_multistore_controller -->|"requests listing"| node_content_grid
node_content_grid -->|"builds grid query"| node_content_query
node_multistore_controller -->|"builds and handles"| node_content_form
node_multistore_controller -->|"loads content blocks"| node_content_entity
node_multistore_controller -->|"persists changes"| node_orm_store

click node_review_controller "https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Controller/Admin/CustomerReviewController.php"
click node_review_command "https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Domain/Reviewer/Command/ToggleIsAllowedToReviewCommand.php"
click node_review_handler "https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Domain/Reviewer/CommandHandler/ToggleIsAllowedToReviewHandler.php"
click node_review_repo "https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Repository/ReviewerRepository.php"
click node_review_entity "https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Entity/Reviewer.php"
click node_review_query_handler "https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Domain/Reviewer/QueryHandler/GetReviewerSettingsForFormHandler.php"
click node_multistore_controller "https://github.com/prestashop/example-modules/blob/master/demomultistoreform/src/Controller/DemoMultistoreController.php"
click node_content_grid "https://github.com/prestashop/example-modules/blob/master/demomultistoreform/src/Grid/Definition/Factory/ContentBlockGridDefinitionFactory.php"
click node_content_query "https://github.com/prestashop/example-modules/blob/master/demomultistoreform/src/Grid/Query/ContentBlockQueryBuilder.php"
click node_content_form "https://github.com/prestashop/example-modules/blob/master/demomultistoreform/src/Form/ContentBlockFormDataProvider.php"
click node_content_entity "https://github.com/prestashop/example-modules/blob/master/demomultistoreform/src/Entity/ContentBlock.php"
click node_api_example "https://github.com/prestashop/example-modules/tree/master/api_module"
click node_dashboard_example "https://github.com/prestashop/example-modules/tree/master/dashexample"
click node_grid_example "https://github.com/prestashop/example-modules/tree/master/demo_grid"
click node_console_example "https://github.com/prestashop/example-modules/tree/master/democonsolecommand"
click node_tabs_example "https://github.com/prestashop/example-modules/tree/master/democontrollertabs"
click node_doctrine_example "https://github.com/prestashop/example-modules/tree/master/demodoctrine"
click node_extend_grid_example "https://github.com/prestashop/example-modules/tree/master/demoextendgrid"
click node_form_hooks_example "https://github.com/prestashop/example-modules/tree/master/demoextendsymfonyform1"
click node_cqrs_hooks_example "https://github.com/prestashop/example-modules/tree/master/demoextendsymfonyform3"
click node_templates_example "https://github.com/prestashop/example-modules/tree/master/demoextendtemplates"
click node_module_routes_example "https://github.com/prestashop/example-modules/tree/master/demomoduleroutes"
click node_js_routing_example "https://github.com/prestashop/example-modules/tree/master/demojsrouting"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_review_controller,node_multistore_controller,node_content_grid,node_grid_example,node_tabs_example,node_extend_grid_example,node_admin,node_multistore_user toneBlue
class node_review_command,node_review_handler,node_review_repo,node_review_entity,node_review_query_handler,node_review_database,node_content_query,node_content_form,node_content_entity,node_orm_store,node_doctrine_example toneAmber
class node_api_example,node_dashboard_example,node_console_example,node_form_hooks_example,node_cqrs_hooks_example,node_templates_example,node_module_routes_example,node_js_routing_example toneMint
```

## Components

### Admin experiences

- [Review action](https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Controller/Admin/CustomerReviewController.php): `demoextendsymfonyform3/src/Controller/Admin/CustomerReviewController.php`
- [Content block controller](https://github.com/prestashop/example-modules/blob/master/demomultistoreform/src/Controller/DemoMultistoreController.php): `demomultistoreform/src/Controller/DemoMultistoreController.php`
- [Content block grid](https://github.com/prestashop/example-modules/blob/master/demomultistoreform/src/Grid/Definition/Factory/ContentBlockGridDefinitionFactory.php): `demomultistoreform/src/Grid/Definition/Factory/ContentBlockGridDefinitionFactory.php`
- [Admin grid demo](https://github.com/prestashop/example-modules/tree/master/demo_grid): `demo_grid`
- [Controller tabs](https://github.com/prestashop/example-modules/tree/master/democontrollertabs): `democontrollertabs`
- [Grid row actions](https://github.com/prestashop/example-modules/tree/master/demoextendgrid): `demoextendgrid`

### Data and forms

- [Toggle command](https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Domain/Reviewer/Command/ToggleIsAllowedToReviewCommand.php): `demoextendsymfonyform3/src/Domain/Reviewer/Command/ToggleIsAllowedToReviewCommand.php`
- [Toggle handler](https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Domain/Reviewer/CommandHandler/ToggleIsAllowedToReviewHandler.php): `demoextendsymfonyform3/src/Domain/Reviewer/CommandHandler/ToggleIsAllowedToReviewHandler.php`
- [Reviewer repository](https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Repository/ReviewerRepository.php): `demoextendsymfonyform3/src/Repository/ReviewerRepository.php`
- [Reviewer entity](https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Entity/Reviewer.php): `demoextendsymfonyform3/src/Entity/Reviewer.php`
- [Settings query handler](https://github.com/prestashop/example-modules/blob/master/demoextendsymfonyform3/src/Domain/Reviewer/QueryHandler/GetReviewerSettingsForFormHandler.php): `demoextendsymfonyform3/src/Domain/Reviewer/QueryHandler/GetReviewerSettingsForFormHandler.php`
- **Reviewer records**
- [Content block query](https://github.com/prestashop/example-modules/blob/master/demomultistoreform/src/Grid/Query/ContentBlockQueryBuilder.php): `demomultistoreform/src/Grid/Query/ContentBlockQueryBuilder.php`
- [Content block forms](https://github.com/prestashop/example-modules/blob/master/demomultistoreform/src/Form/ContentBlockFormDataProvider.php): `demomultistoreform/src/Form/ContentBlockFormDataProvider.php`
- [Content block entity](https://github.com/prestashop/example-modules/blob/master/demomultistoreform/src/Entity/ContentBlock.php): `demomultistoreform/src/Entity/ContentBlock.php`
- **ORM persistence**
- [Doctrine example](https://github.com/prestashop/example-modules/tree/master/demodoctrine): `demodoctrine`

### Platform integrations

- [API customization](https://github.com/prestashop/example-modules/tree/master/api_module): `api_module`
- [Dashboard hooks](https://github.com/prestashop/example-modules/tree/master/dashexample): `dashexample`
- [Console command](https://github.com/prestashop/example-modules/tree/master/democonsolecommand): `democonsolecommand`
- [Form hooks](https://github.com/prestashop/example-modules/tree/master/demoextendsymfonyform1): `demoextendsymfonyform1`
- [CQRS and hooks](https://github.com/prestashop/example-modules/tree/master/demoextendsymfonyform3): `demoextendsymfonyform3`
- [Template extensions](https://github.com/prestashop/example-modules/tree/master/demoextendtemplates): `demoextendtemplates`
- [Module routes](https://github.com/prestashop/example-modules/tree/master/demomoduleroutes): `demomoduleroutes`
- [JavaScript routing](https://github.com/prestashop/example-modules/tree/master/demojsrouting): `demojsrouting`

### Other components

- **Admin user**
- **Admin user**

## Connections

- Admin user → Review action: requests status change
- Review action → Toggle command: dispatches
- Toggle handler → Reviewer repository: looks up reviewer
- Toggle handler → Reviewer entity: creates or updates
- Reviewer repository → Reviewer records: queries
- Settings query handler → Reviewer repository: reads settings
- Admin user → Content block controller: uses CRUD pages
- Content block controller → Content block grid: requests listing
- Content block grid → Content block query: builds grid query
- Content block controller → Content block forms: builds and handles
- Content block controller → Content block entity: loads content blocks
- Content block controller → ORM persistence: persists changes
