# ndizigiye/drecomm_productvideo architecture

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

- Interactive diagram: https://gitdiagram.com/ndizigiye/drecomm_productvideo
- Repository: https://github.com/ndizigiye/drecomm_productvideo

## Overview

This Magento extension lets administrators attach video URLs to products or upload videos to YouTube, manage their status, and show product videos on the storefront. The admin controller owns save, delete, and status actions; its form and grid provide the management UI. Storefront blocks retrieve product-associated videos and support YouTube/Vimeo thumbnails, while the helper handles URL parsing and YouTube upload/deletion. The README is brief, and unsampled configuration/layout files suggest further Magento wiring, so those links are not asserted here.

Main entry points: [`app/code/community/Drecomm/ProductVideo/Helper/Global.php`](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Helper/Global.php) (Video helper), [`app/code/community/Drecomm/ProductVideo/controllers/Adminhtml/VideoController.php`](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/controllers/Adminhtml/VideoController.php) (Video actions), [`app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Edit/Form.php`](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Edit/Form.php) (Video form), [`app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Grid.php`](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Grid.php) (Video grid)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin management"]
  node_controller["Video actions"]
  node_edit["Edit container<br/>[Edit.php]"]
  node_form["Video form<br/>[Form.php]"]
  node_gridcontainer["Video grid page<br/>[Video.php]"]
  node_grid["Video grid<br/>[Grid.php]"]
  node_tabs["Product tabs<br/>[Tabs.php]"]
  node_renderer["Grid renderer<br/>[Renderer.php]"]
  node_formjs["Upload form scripts<br/>[form.js]"]
end

subgraph group_video["Video services"]
  node_helper["Video helper<br/>[Global.php]"]
  node_gmail["Gmail validation<br/>[GmailValidate.php]"]
  node_youtube{{"YouTube service"}}
  node_vimeo{{"Vimeo thumbnail API"}}
end

subgraph group_storefront["Storefront display"]
  node_lightbox["PrettyPhoto viewer"]
  node_view["Product video block<br/>[VideoView.php]"]
  node_template["Video templates<br/>[video.phtml]"]
end

subgraph group_persistence["Video persistence"]
  node_resource["Video resource<br/>[Video.php]"]
  node_collection["Video collection<br/>[Collection.php]"]
  node_model["Video model<br/>[Video.php]"]
  node_database[("Magento video table")]
end

node_admin(("Store admin"))

node_admin -->|"manages videos"| node_controller
node_controller -->|"creates edit UI"| node_edit
node_controller -->|"saves and deletes"| node_model
node_controller -.->|"uses upload features"| node_helper
node_edit -.->|"renders"| node_form
node_form -->|"requests upload token"| node_helper
node_form -->|"loads video"| node_model
node_form -.->|"uses validation scripts"| node_formjs
node_gridcontainer -.->|"hosts grid"| node_grid
node_grid -->|"queries product videos"| node_collection
node_grid -->|"routes mass actions"| node_controller
node_tabs -.->|"adds product tab"| node_gridcontainer
node_renderer -.->|"formats grid values"| node_grid
node_helper -->|"checks video status"| node_collection
node_helper -->|"uploads and deletes"| node_youtube
node_helper -->|"fetches thumbnails"| node_vimeo
node_gmail -->|"validates credentials"| node_youtube
node_view -->|"loads product videos"| node_collection
node_view -->|"parses video IDs"| node_helper
node_template -.->|"renders video data"| node_view
node_template -.->|"opens video viewer"| node_lightbox
node_resource -->|"maps video table"| node_database
node_collection -.->|"uses resource mapping"| node_resource
node_model -.->|"uses resource mapping"| node_resource

click node_controller "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/controllers/Adminhtml/VideoController.php"
click node_edit "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Edit.php"
click node_form "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Edit/Form.php"
click node_gridcontainer "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video.php"
click node_grid "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Grid.php"
click node_tabs "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Tabs.php"
click node_renderer "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Renderer.php"
click node_formjs "https://github.com/ndizigiye/drecomm_productvideo/blob/master/js/video/form.js"
click node_helper "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Helper/Global.php"
click node_gmail "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Model/GmailValidate.php"
click node_lightbox "https://github.com/ndizigiye/drecomm_productvideo/blob/master/js/video/jquery.prettyPhoto.js"
click node_view "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/VideoView.php"
click node_template "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/design/frontend/base/default/template/video/video.phtml"
click node_resource "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Model/Resource/Video.php"
click node_collection "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Model/Resource/Video/Collection.php"
click node_model "https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Model/Video.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_controller,node_edit,node_form,node_gridcontainer,node_grid,node_tabs,node_renderer,node_formjs toneBlue
class node_helper,node_gmail,node_youtube,node_vimeo toneAmber
class node_lightbox,node_view,node_template toneMint
class node_resource,node_collection,node_model,node_database toneRose
class node_admin toneIndigo
```

## Components

### Admin management

- [Video actions](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/controllers/Adminhtml/VideoController.php): `app/code/community/Drecomm/ProductVideo/controllers/Adminhtml/VideoController.php`
- [Edit container](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Edit.php): `app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Edit.php`
- [Video form](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Edit/Form.php): `app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Edit/Form.php`
- [Video grid page](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video.php): `app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video.php`
- [Video grid](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Grid.php): `app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Grid.php`
- [Product tabs](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Tabs.php): `app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Tabs.php`
- [Grid renderer](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Renderer.php): `app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Renderer.php`
- [Upload form scripts](https://github.com/ndizigiye/drecomm_productvideo/blob/master/js/video/form.js): `js/video/form.js`

### Video services

- [Video helper](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Helper/Global.php): `app/code/community/Drecomm/ProductVideo/Helper/Global.php`
- [Gmail validation](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Model/GmailValidate.php): `app/code/community/Drecomm/ProductVideo/Model/GmailValidate.php`
- **YouTube service**
- **Vimeo thumbnail API**

### Storefront display

- [PrettyPhoto viewer](https://github.com/ndizigiye/drecomm_productvideo/blob/master/js/video/jquery.prettyPhoto.js): `js/video/jquery.prettyPhoto.js`
- [Product video block](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Block/VideoView.php): `app/code/community/Drecomm/ProductVideo/Block/VideoView.php`
- [Video templates](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/design/frontend/base/default/template/video/video.phtml): `app/design/frontend/base/default/template/video/video.phtml`

### Video persistence

- [Video resource](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Model/Resource/Video.php): `app/code/community/Drecomm/ProductVideo/Model/Resource/Video.php`
- [Video collection](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Model/Resource/Video/Collection.php): `app/code/community/Drecomm/ProductVideo/Model/Resource/Video/Collection.php`
- [Video model](https://github.com/ndizigiye/drecomm_productvideo/blob/master/app/code/community/Drecomm/ProductVideo/Model/Video.php): `app/code/community/Drecomm/ProductVideo/Model/Video.php`
- **Magento video table**

### Other components

- **Store admin**

## Connections

- Store admin → Video actions: manages videos (evidence: `app/code/community/Drecomm/ProductVideo/controllers/Adminhtml/VideoController.php`)
- Video actions → Edit container: creates edit UI (evidence: `app/code/community/Drecomm/ProductVideo/controllers/Adminhtml/VideoController.php`)
- Video actions → Video model: saves and deletes (evidence: `app/code/community/Drecomm/ProductVideo/controllers/Adminhtml/VideoController.php`)
- Video actions → Video helper: uses upload features
- Edit container → Video form: renders
- Video form → Video helper: requests upload token (evidence: `app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Edit/Form.php`)
- Video form → Video model: loads video (evidence: `app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Edit/Form.php`)
- Video form → Upload form scripts: uses validation scripts
- Video grid page → Video grid: hosts grid
- Video grid → Video collection: queries product videos (evidence: `app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Grid.php`)
- Video grid → Video actions: routes mass actions (evidence: `app/code/community/Drecomm/ProductVideo/Block/Adminhtml/Video/Grid.php`)
- Product tabs → Video grid page: adds product tab
- Grid renderer → Video grid: formats grid values
- Video helper → Video collection: checks video status (evidence: `app/code/community/Drecomm/ProductVideo/Helper/Global.php`)
- Video helper → YouTube service: uploads and deletes (evidence: `app/code/community/Drecomm/ProductVideo/Helper/Global.php`)
- Video helper → Vimeo thumbnail API: fetches thumbnails (evidence: `app/code/community/Drecomm/ProductVideo/Helper/Global.php`)
- Gmail validation → YouTube service: validates credentials (evidence: `app/code/community/Drecomm/ProductVideo/Model/GmailValidate.php`)
- Product video block → Video collection: loads product videos (evidence: `app/code/community/Drecomm/ProductVideo/Block/VideoView.php`)
- Product video block → Video helper: parses video IDs (evidence: `app/code/community/Drecomm/ProductVideo/Block/VideoView.php`)
- Video templates → Product video block: renders video data
- Video templates → PrettyPhoto viewer: opens video viewer
- Video resource → Magento video table: maps video table (evidence: `app/code/community/Drecomm/ProductVideo/Model/Resource/Video.php`)
- Video collection → Video resource: uses resource mapping
- Video model → Video resource: uses resource mapping
