# mekkumar/magento2-store-locator architecture

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

- Interactive diagram: https://gitdiagram.com/mekkumar/magento2-store-locator
- Repository: https://github.com/mekkumar/magento2-store-locator

## Overview

This Magento 2 extension lets administrators maintain store records and presents enabled locations in a searchable, map-based storefront. The main paths are admin listing/edit/save/delete and frontend page rendering with store data and map configuration. The sampled code verifies the admin persistence and frontend data-loading layers; map interaction and several advertised store details are documented capabilities, but their implementation was not sampled, so those links are documented rather than inferred from source.

Main entry points: [`Model/Store.php`](https://github.com/mekkumar/magento2-store-locator/blob/main/Model/Store.php) (Store model), [`Block/Adminhtml/Store/Grid.php`](https://github.com/mekkumar/magento2-store-locator/blob/main/Block/Adminhtml/Store/Grid.php) (Store grid), [`Controller/Adminhtml/Store/Edit.php`](https://github.com/mekkumar/magento2-store-locator/blob/main/Controller/Adminhtml/Store/Edit.php) (Edit controller), [`Block/StoreLocator.php`](https://github.com/mekkumar/magento2-store-locator/blob/main/Block/StoreLocator.php) (Locator data block)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin management"]
  node_admin_list["Store listing<br/>[Index.php]"]
  node_admin_grid["Store grid<br/>[Grid.php]"]
  node_admin_edit["Edit controller<br/>[Edit.php]"]
  node_admin_form["Edit form<br/>[Edit.php]"]
  node_admin_save["Save controller<br/>[Save.php]"]
  node_admin_delete["Delete controller<br/>[Delete.php]"]
  node_admin_views["Admin views"]
  node_admin_routes["Admin routes<br/>[routes.xml]"]
end

subgraph group_frontend["Storefront locator"]
  node_frontend_controller["Locator page controller<br/>[Index.php]"]
  node_locator_block["Locator data block<br/>[StoreLocator.php]"]
  node_locator_template["Locator template"]
  node_map_script["Map interaction<br/>[store-locator.js]"]
  node_map_styles["Map styling<br/>[store-locator.css]"]
end

subgraph group_data["Store data"]
  node_store_model["Store model<br/>[Store.php]"]
  node_store_resource["Store resource<br/>[Store.php]"]
  node_store_collection["Store collection<br/>[Collection.php]"]
  node_store_table[("Store table<br/>[db_schema.xml]")]
end

subgraph group_config["Module configuration"]
  node_module_config["Locator settings<br/>[system.xml]"]
end

node_admin_user(("Admin user"))
node_frontend_user(("Storefront visitor"))
node_map_service["Google Maps"]

node_admin_user -.->|"manages stores"| node_admin_list
node_admin_list -.->|"renders listing"| node_admin_grid
node_admin_grid -->|"loads stores"| node_store_collection
node_admin_grid -->|"links editing"| node_admin_edit
node_admin_edit -->|"provides store"| node_admin_form
node_admin_edit -->|"loads store"| node_store_model
node_admin_save -->|"saves store"| node_store_model
node_admin_delete -->|"deletes store"| node_store_model
node_admin_form -.->|"submits changes"| node_admin_save
node_store_model -->|"uses resource"| node_store_resource
node_store_resource -->|"persists records"| node_store_table
node_store_collection -->|"collects models"| node_store_model
node_frontend_user -->|"opens locator"| node_frontend_controller
node_frontend_controller -.->|"renders page data"| node_locator_block
node_locator_block -->|"loads enabled stores"| node_store_collection
node_locator_block -->|"reads map settings"| node_module_config
node_locator_template -.->|"supports map UI"| node_map_script
node_map_script -.->|"renders interactive map"| node_map_service
node_frontend_user -.->|"searches locations"| node_locator_template
node_map_styles -.->|"styles locator"| node_locator_template
node_admin_user -.->|"creates or updates"| node_admin_save
node_admin_user -.->|"removes stores"| node_admin_delete

click node_admin_list "https://github.com/mekkumar/magento2-store-locator/blob/main/Controller/Adminhtml/Store/Index.php"
click node_admin_grid "https://github.com/mekkumar/magento2-store-locator/blob/main/Block/Adminhtml/Store/Grid.php"
click node_admin_edit "https://github.com/mekkumar/magento2-store-locator/blob/main/Controller/Adminhtml/Store/Edit.php"
click node_admin_form "https://github.com/mekkumar/magento2-store-locator/blob/main/Block/Adminhtml/Store/Edit.php"
click node_admin_save "https://github.com/mekkumar/magento2-store-locator/blob/main/Controller/Adminhtml/Store/Save.php"
click node_admin_delete "https://github.com/mekkumar/magento2-store-locator/blob/main/Controller/Adminhtml/Store/Delete.php"
click node_store_model "https://github.com/mekkumar/magento2-store-locator/blob/main/Model/Store.php"
click node_store_resource "https://github.com/mekkumar/magento2-store-locator/blob/main/Model/ResourceModel/Store.php"
click node_store_collection "https://github.com/mekkumar/magento2-store-locator/blob/main/Model/ResourceModel/Store/Collection.php"
click node_store_table "https://github.com/mekkumar/magento2-store-locator/blob/main/etc/db_schema.xml"
click node_frontend_controller "https://github.com/mekkumar/magento2-store-locator/blob/main/Controller/Index/Index.php"
click node_locator_block "https://github.com/mekkumar/magento2-store-locator/blob/main/Block/StoreLocator.php"
click node_locator_template "https://github.com/mekkumar/magento2-store-locator/blob/main/view/frontend/templates/store-locator.phtml"
click node_map_script "https://github.com/mekkumar/magento2-store-locator/blob/main/view/frontend/web/js/store-locator.js"
click node_map_styles "https://github.com/mekkumar/magento2-store-locator/blob/main/view/frontend/web/css/store-locator.css"
click node_module_config "https://github.com/mekkumar/magento2-store-locator/blob/main/etc/adminhtml/system.xml"
click node_admin_views "https://github.com/mekkumar/magento2-store-locator/tree/main/view/adminhtml/templates/store"
click node_admin_routes "https://github.com/mekkumar/magento2-store-locator/blob/main/etc/adminhtml/routes.xml"

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_admin_list,node_admin_grid,node_admin_edit,node_admin_form,node_admin_save,node_admin_delete,node_admin_views,node_admin_routes,node_admin_user toneBlue
class node_frontend_controller,node_locator_block,node_locator_template,node_map_script,node_map_styles toneAmber
class node_store_model,node_store_resource,node_store_collection,node_store_table toneMint
class node_module_config toneRose
class node_frontend_user,node_map_service toneIndigo
```

## Components

### Admin management

- [Store listing](https://github.com/mekkumar/magento2-store-locator/blob/main/Controller/Adminhtml/Store/Index.php): `Controller/Adminhtml/Store/Index.php`
- [Store grid](https://github.com/mekkumar/magento2-store-locator/blob/main/Block/Adminhtml/Store/Grid.php): `Block/Adminhtml/Store/Grid.php`
- [Edit controller](https://github.com/mekkumar/magento2-store-locator/blob/main/Controller/Adminhtml/Store/Edit.php): `Controller/Adminhtml/Store/Edit.php`
- [Edit form](https://github.com/mekkumar/magento2-store-locator/blob/main/Block/Adminhtml/Store/Edit.php): `Block/Adminhtml/Store/Edit.php`
- [Save controller](https://github.com/mekkumar/magento2-store-locator/blob/main/Controller/Adminhtml/Store/Save.php): `Controller/Adminhtml/Store/Save.php`
- [Delete controller](https://github.com/mekkumar/magento2-store-locator/blob/main/Controller/Adminhtml/Store/Delete.php): `Controller/Adminhtml/Store/Delete.php`
- [Admin views](https://github.com/mekkumar/magento2-store-locator/tree/main/view/adminhtml/templates/store): `view/adminhtml/templates/store`
- [Admin routes](https://github.com/mekkumar/magento2-store-locator/blob/main/etc/adminhtml/routes.xml): `etc/adminhtml/routes.xml`

### Storefront locator

- [Locator page controller](https://github.com/mekkumar/magento2-store-locator/blob/main/Controller/Index/Index.php): `Controller/Index/Index.php`
- [Locator data block](https://github.com/mekkumar/magento2-store-locator/blob/main/Block/StoreLocator.php): `Block/StoreLocator.php`
- [Locator template](https://github.com/mekkumar/magento2-store-locator/blob/main/view/frontend/templates/store-locator.phtml): `view/frontend/templates/store-locator.phtml`
- [Map interaction](https://github.com/mekkumar/magento2-store-locator/blob/main/view/frontend/web/js/store-locator.js): `view/frontend/web/js/store-locator.js`
- [Map styling](https://github.com/mekkumar/magento2-store-locator/blob/main/view/frontend/web/css/store-locator.css): `view/frontend/web/css/store-locator.css`

### Store data

- [Store model](https://github.com/mekkumar/magento2-store-locator/blob/main/Model/Store.php): `Model/Store.php`
- [Store resource](https://github.com/mekkumar/magento2-store-locator/blob/main/Model/ResourceModel/Store.php): `Model/ResourceModel/Store.php`
- [Store collection](https://github.com/mekkumar/magento2-store-locator/blob/main/Model/ResourceModel/Store/Collection.php): `Model/ResourceModel/Store/Collection.php`
- [Store table](https://github.com/mekkumar/magento2-store-locator/blob/main/etc/db_schema.xml): `etc/db_schema.xml`

### Module configuration

- [Locator settings](https://github.com/mekkumar/magento2-store-locator/blob/main/etc/adminhtml/system.xml): `etc/adminhtml/system.xml`

### Other components

- **Admin user**
- **Storefront visitor**
- **Google Maps**

## Connections

- Admin user → Store listing: manages stores (evidence: `README.md`)
- Store listing → Store grid: renders listing
- Store grid → Store collection: loads stores (evidence: `Block/Adminhtml/Store/Grid.php`)
- Store grid → Edit controller: links editing (evidence: `Block/Adminhtml/Store/Grid.php`)
- Edit controller → Edit form: provides store (evidence: `Controller/Adminhtml/Store/Edit.php`)
- Edit controller → Store model: loads store (evidence: `Controller/Adminhtml/Store/Edit.php`)
- Save controller → Store model: saves store (evidence: `Controller/Adminhtml/Store/Save.php`)
- Delete controller → Store model: deletes store (evidence: `Controller/Adminhtml/Store/Delete.php`)
- Edit form → Save controller: submits changes
- Store model → Store resource: uses resource (evidence: `Model/Store.php`)
- Store resource → Store table: persists records (evidence: `Model/ResourceModel/Store.php`)
- Store collection → Store model: collects models (evidence: `Model/ResourceModel/Store/Collection.php`)
- Storefront visitor → Locator page controller: opens locator (evidence: `Controller/Index/Index.php`)
- Locator page controller → Locator data block: renders page data (evidence: `Controller/Index/Index.php`)
- Locator data block → Store collection: loads enabled stores (evidence: `Block/StoreLocator.php`)
- Locator data block → Locator settings: reads map settings (evidence: `Block/StoreLocator.php`)
- Locator template → Map interaction: supports map UI (evidence: `README.md`)
- Map interaction → Google Maps: renders interactive map (evidence: `README.md`)
- Storefront visitor → Locator template: searches locations (evidence: `README.md`)
- Map styling → Locator template: styles locator
- Admin user → Save controller: creates or updates (evidence: `README.md`)
- Admin user → Delete controller: removes stores (evidence: `README.md`)
