# mekkumar/module-drag-actions architecture

> Architecture diagram of the GitHub repository mekkumar/module-drag-actions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mekkumar/module-drag-actions
- Repository: https://github.com/mekkumar/module-drag-actions

## Overview

Kumar_DragActions is a Magento 2 storefront extension for drag- and swipe-based product actions. Customers discover a product through the floating interface, choose an action, optionally configure eligible products, and submit it to a controller that invokes Magento’s cart, wishlist, or compare functionality. The README documents layout injection, frontend rendering, admin controls, and the supported action flows. The sampled sources confirm controller dispatch and configuration rendering; unsampled layout, templates, and settings are represented only where documented, so some links cite the README.

Main entry points: [`Controller/Action/Execute.php`](https://github.com/mekkumar/module-drag-actions/blob/main/Controller/Action/Execute.php) (Action endpoint), [`view/frontend/web/js/drag-actions.js`](https://github.com/mekkumar/module-drag-actions/blob/main/view/frontend/web/js/drag-actions.js) (Drag and swipe UI), [`Block/DragActions.php`](https://github.com/mekkumar/module-drag-actions/blob/main/Block/DragActions.php) (Action block), [`Controller/Product/Configure.php`](https://github.com/mekkumar/module-drag-actions/blob/main/Controller/Product/Configure.php) (Configure endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Storefront interaction"]
  node_layout["Layout injection"]
  node_action_block["Action block<br/>[DragActions.php]"]
  node_action_templates["Action templates"]
  node_drag_ui["Drag and swipe UI<br/>[drag-actions.js]"]
  node_loader_style["Overlay styling"]
end

subgraph group_configuration["Product configuration"]
  node_config_controller["Configure endpoint<br/>[Configure.php]"]
  node_config_block["Configuration block<br/>[Configure.php]"]
  node_config_template["Configuration form<br/>[configure.phtml]"]
end

subgraph group_actions["Action processing"]
  node_execute_controller["Action endpoint<br/>[Execute.php]"]
end

subgraph group_admin["Admin settings"]
  node_admin_settings["Admin configuration<br/>[system.xml]"]
  node_config_helper["Settings helper<br/>[Data.php]"]
end

node_customer(("Storefront customer"))
node_product_repository["Product repository"]
node_cart[("Magento cart")]
node_wishlist[("Magento wishlist")]
node_compare["Magento compare"]

node_customer -->|"uses"| node_drag_ui
node_layout -->|"injects"| node_action_block
node_action_block -->|"renders"| node_action_templates
node_action_templates -->|"initializes"| node_drag_ui
node_drag_ui -->|"shows overlay"| node_loader_style
node_drag_ui -->|"requests configuration"| node_config_controller
node_config_controller -->|"loads product"| node_product_repository
node_config_controller -->|"creates block"| node_config_block
node_config_block -->|"renders"| node_config_template
node_drag_ui -->|"submits action"| node_execute_controller
node_execute_controller -->|"loads product"| node_product_repository
node_execute_controller -->|"adds or removes"| node_cart
node_execute_controller -->|"saves item"| node_wishlist
node_execute_controller -->|"adds product"| node_compare
node_admin_settings -->|"configures"| node_config_helper
node_action_block -->|"reads settings"| node_config_helper

click node_layout "https://github.com/mekkumar/module-drag-actions/tree/main/view/frontend/layout"
click node_action_block "https://github.com/mekkumar/module-drag-actions/blob/main/Block/DragActions.php"
click node_action_templates "https://github.com/mekkumar/module-drag-actions/tree/main/view/frontend/templates"
click node_drag_ui "https://github.com/mekkumar/module-drag-actions/blob/main/view/frontend/web/js/drag-actions.js"
click node_loader_style "https://github.com/mekkumar/module-drag-actions/tree/main/view/frontend/web/css"
click node_config_controller "https://github.com/mekkumar/module-drag-actions/blob/main/Controller/Product/Configure.php"
click node_config_block "https://github.com/mekkumar/module-drag-actions/blob/main/Block/Product/Configure.php"
click node_config_template "https://github.com/mekkumar/module-drag-actions/blob/main/view/frontend/templates/product/configure.phtml"
click node_execute_controller "https://github.com/mekkumar/module-drag-actions/blob/main/Controller/Action/Execute.php"
click node_admin_settings "https://github.com/mekkumar/module-drag-actions/blob/main/etc/adminhtml/system.xml"
click node_config_helper "https://github.com/mekkumar/module-drag-actions/blob/main/Helper/Data.php"

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_layout,node_action_block,node_action_templates,node_drag_ui,node_loader_style toneBlue
class node_config_controller,node_config_block,node_config_template,node_cart,node_wishlist toneAmber
class node_execute_controller toneMint
class node_admin_settings,node_config_helper toneRose
class node_customer,node_product_repository,node_compare toneIndigo
```

## Components

### Storefront interaction

- [Layout injection](https://github.com/mekkumar/module-drag-actions/tree/main/view/frontend/layout): `view/frontend/layout`
- [Action block](https://github.com/mekkumar/module-drag-actions/blob/main/Block/DragActions.php): `Block/DragActions.php`
- [Action templates](https://github.com/mekkumar/module-drag-actions/tree/main/view/frontend/templates): `view/frontend/templates`
- [Drag and swipe UI](https://github.com/mekkumar/module-drag-actions/blob/main/view/frontend/web/js/drag-actions.js): `view/frontend/web/js/drag-actions.js`
- [Overlay styling](https://github.com/mekkumar/module-drag-actions/tree/main/view/frontend/web/css): `view/frontend/web/css`

### Product configuration

- [Configure endpoint](https://github.com/mekkumar/module-drag-actions/blob/main/Controller/Product/Configure.php): `Controller/Product/Configure.php`
- [Configuration block](https://github.com/mekkumar/module-drag-actions/blob/main/Block/Product/Configure.php): `Block/Product/Configure.php`
- [Configuration form](https://github.com/mekkumar/module-drag-actions/blob/main/view/frontend/templates/product/configure.phtml): `view/frontend/templates/product/configure.phtml`

### Action processing

- [Action endpoint](https://github.com/mekkumar/module-drag-actions/blob/main/Controller/Action/Execute.php): `Controller/Action/Execute.php`

### Admin settings

- [Admin configuration](https://github.com/mekkumar/module-drag-actions/blob/main/etc/adminhtml/system.xml): `etc/adminhtml/system.xml`
- [Settings helper](https://github.com/mekkumar/module-drag-actions/blob/main/Helper/Data.php): `Helper/Data.php`

### Other components

- **Storefront customer**
- **Product repository**
- **Magento cart**
- **Magento wishlist**
- **Magento compare**

## Connections

- Storefront customer → Drag and swipe UI: uses (evidence: `README.md`)
- Layout injection → Action block: injects (evidence: `README.md`)
- Action block → Action templates: renders (evidence: `README.md`)
- Action templates → Drag and swipe UI: initializes (evidence: `README.md`)
- Drag and swipe UI → Overlay styling: shows overlay (evidence: `README.md`)
- Drag and swipe UI → Configure endpoint: requests configuration (evidence: `view/frontend/web/js/drag-actions.js`)
- Configure endpoint → Product repository: loads product (evidence: `Controller/Product/Configure.php`)
- Configure endpoint → Configuration block: creates block (evidence: `Controller/Product/Configure.php`)
- Configuration block → Configuration form: renders
- Drag and swipe UI → Action endpoint: submits action (evidence: `README.md`)
- Action endpoint → Product repository: loads product (evidence: `Controller/Action/Execute.php`)
- Action endpoint → Magento cart: adds or removes (evidence: `Controller/Action/Execute.php`)
- Action endpoint → Magento wishlist: saves item (evidence: `Controller/Action/Execute.php`)
- Action endpoint → Magento compare: adds product (evidence: `Controller/Action/Execute.php`)
- Admin configuration → Settings helper: configures (evidence: `README.md`)
- Action block → Settings helper: reads settings (evidence: `Block/DragActions.php`)
