# hadi-hilal/e_commerce architecture

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

- Interactive diagram: https://gitdiagram.com/hadi-hilal/e_commerce
- Repository: https://github.com/hadi-hilal/e_commerce

## Overview

HadoSaaS is a modular Laravel starter kit for SaaS and administration, with CMS, user and role management, shop taxonomy, system settings, and support inbox capabilities. The main documented workflow is an administrator submitting a module request, a controller delegating to application-level orchestration, and persistence through repositories and models. The sampled Page and Category controllers show parts of this flow; several other capabilities are represented from the README and file tree, not inspected implementations. Edges are limited to relationships shown in excerpts or documented architecture.

Main entry points: [`Modules/Cms/app/Http/Controllers/Admin/PageController.php`](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Http/Controllers/Admin/PageController.php) (Page controller), [`Modules/Cms/app/Application/Page/PageApplicationService.php`](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Application/Page/PageApplicationService.php) (Page service), [`Modules/Shop/app/Http/Controllers/Admin/CategoryController.php`](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Http/Controllers/Admin/CategoryController.php) (Category controller), [`Modules/Shop/app/Application/Category/CategoryApplicationService.php`](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Application/Category/CategoryApplicationService.php) (Category service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cms["CMS publishing"]
  node_page_controller["Page controller<br/>[PageController.php]"]
  node_page_service["Page service"]
  node_page_command["Page command"]
  node_content_query["Content query"]
  node_page_data["Page data<br/>[PageData.php]"]
  node_page_model["Page model<br/>[Page.php]"]
  node_cms_other["Blogs, FAQs, slides"]
  node_cms_routes["CMS route mapping"]
end

subgraph group_shop["Shop taxonomy"]
  node_category_controller["Category controller"]
  node_category_service["Category service"]
  node_category_data["Category data<br/>[CategoryData.php]"]
  node_category_model["Category model<br/>[Category.php]"]
  node_attribute_families["Attribute families"]
  node_shop_attributes["Attribute management"]
  node_shop_routes["Shop route mapping"]
end

subgraph group_users["Users and access"]
  node_role_controller["Role controller<br/>[RoleController.php]"]
  node_role_service["Role management"]
  node_user_management["User management"]
  node_user_model["User model<br/>[User.php]"]
  node_permissions["Permission rules<br/>[Permissions.php]"]
  node_auth_provider["Auth and gates"]
  node_user_routes["User route mapping"]
end

subgraph group_base["System administration"]
  node_base_admin["Settings and SEO"]
  node_media_controller["Media library"]
  node_media_model["Media model<br/>[Media.php]"]
  node_base_routes["Base route mapping"]
  node_install_command["App installer"]
  node_file_trait["File operations<br/>[FileTrait.php]"]
  node_flash_service["Flash messaging"]
  node_flash_contract["Flash contract"]
end

subgraph group_support["Support"]
  node_support_inbox["Contact and subscribers"]
  node_contact_controller["Contact controller"]
  node_support_routes["Support route mapping"]
end

node_admin(("Administrator"))

node_admin -.->|"submits request"| node_page_controller
node_page_controller -->|"delegates"| node_page_service
node_page_controller -->|"builds input"| node_page_command
node_page_controller -->|"builds query"| node_content_query
node_page_controller -->|"validates data"| node_page_data
node_page_service -->|"uses command"| node_page_command
node_page_service -->|"uses query"| node_content_query
node_page_service -->|"uses model"| node_page_model
node_page_service -->|"uses contract"| node_flash_contract
node_admin -.->|"submits request"| node_category_controller
node_category_controller -->|"delegates"| node_category_service
node_category_controller -->|"loads families"| node_attribute_families
node_category_controller -->|"builds input"| node_category_data
node_category_service -->|"uses model"| node_category_model
node_category_service -->|"uses data"| node_category_data
node_category_service -->|"uses files"| node_file_trait
node_role_controller -->|"delegates"| node_role_service
node_role_controller -->|"groups permissions"| node_permissions
node_auth_provider -->|"checks user"| node_user_model
node_media_controller -->|"uses model"| node_media_model
node_media_controller -->|"uses files"| node_file_trait
node_flash_service -->|"implements"| node_flash_contract
node_contact_controller -->|"delegates"| node_support_inbox

click node_page_controller "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Http/Controllers/Admin/PageController.php"
click node_page_service "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Application/Page/PageApplicationService.php"
click node_page_command "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Application/Page/Commands/UpsertPageCommand.php"
click node_content_query "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Application/Shared/Queries/ContentListQuery.php"
click node_page_data "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Data/PageData.php"
click node_page_model "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Models/Page.php"
click node_cms_other "https://github.com/hadi-hilal/e_commerce/tree/main/Modules/Cms/app/Application"
click node_cms_routes "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Providers/RouteServiceProvider.php"
click node_category_controller "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Http/Controllers/Admin/CategoryController.php"
click node_category_service "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Application/Category/CategoryApplicationService.php"
click node_category_data "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Data/CategoryData.php"
click node_category_model "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Models/Category.php"
click node_attribute_families "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Application/AttributeFamily/AttributeFamilyApplicationService.php"
click node_shop_attributes "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Application/Attribute/AttributeApplicationService.php"
click node_shop_routes "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Providers/RouteServiceProvider.php"
click node_role_controller "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/User/app/Http/Controllers/Admin/RoleController.php"
click node_role_service "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/User/app/Application/Role/RoleManagementApplicationService.php"
click node_user_management "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/User/app/Application/User/UserManagementApplicationService.php"
click node_user_model "https://github.com/hadi-hilal/e_commerce/blob/main/app/Models/User.php"
click node_permissions "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/User/app/Helpers/Permissions.php"
click node_auth_provider "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/User/app/Providers/AuthServiceProvider.php"
click node_user_routes "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/User/app/Providers/RouteServiceProvider.php"
click node_base_admin "https://github.com/hadi-hilal/e_commerce/tree/main/Modules/Base/app/Application"
click node_media_controller "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Base/app/Http/Controllers/Admin/MediaLibraryController.php"
click node_media_model "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Base/app/Models/Media.php"
click node_base_routes "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Base/app/Providers/RouteServiceProvider.php"
click node_install_command "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Core/app/Console/InstallAppCommand.php"
click node_file_trait "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Core/app/Traits/FileTrait.php"
click node_flash_service "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Core/app/Services/Flash/SessionFlashMessenger.php"
click node_flash_contract "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Core/app/Contracts/Flash/FlashMessengerInterface.php"
click node_support_inbox "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Support/app/Application/SupportAdmin/SupportInboxApplicationService.php"
click node_contact_controller "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Support/app/Http/Controllers/Admin/ContactFormController.php"
click node_support_routes "https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Support/app/Providers/RouteServiceProvider.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_page_controller,node_page_service,node_page_command,node_content_query,node_page_data,node_page_model,node_cms_other,node_cms_routes toneBlue
class node_category_controller,node_category_service,node_category_data,node_category_model,node_attribute_families,node_shop_attributes,node_shop_routes toneAmber
class node_role_controller,node_role_service,node_user_management,node_user_model,node_permissions,node_auth_provider,node_user_routes toneMint
class node_base_admin,node_media_controller,node_media_model,node_base_routes,node_install_command,node_file_trait,node_flash_service,node_flash_contract toneRose
class node_support_inbox,node_contact_controller,node_support_routes,node_admin toneIndigo
```

## Components

### CMS publishing

- [Page controller](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Http/Controllers/Admin/PageController.php): `Modules/Cms/app/Http/Controllers/Admin/PageController.php`
- [Page service](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Application/Page/PageApplicationService.php): `Modules/Cms/app/Application/Page/PageApplicationService.php`
- [Page command](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Application/Page/Commands/UpsertPageCommand.php): `Modules/Cms/app/Application/Page/Commands/UpsertPageCommand.php`
- [Content query](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Application/Shared/Queries/ContentListQuery.php): `Modules/Cms/app/Application/Shared/Queries/ContentListQuery.php`
- [Page data](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Data/PageData.php): `Modules/Cms/app/Data/PageData.php`
- [Page model](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Models/Page.php): `Modules/Cms/app/Models/Page.php`
- [Blogs, FAQs, slides](https://github.com/hadi-hilal/e_commerce/tree/main/Modules/Cms/app/Application): `Modules/Cms/app/Application`
- [CMS route mapping](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Cms/app/Providers/RouteServiceProvider.php): `Modules/Cms/app/Providers/RouteServiceProvider.php`

### Shop taxonomy

- [Category controller](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Http/Controllers/Admin/CategoryController.php): `Modules/Shop/app/Http/Controllers/Admin/CategoryController.php`
- [Category service](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Application/Category/CategoryApplicationService.php): `Modules/Shop/app/Application/Category/CategoryApplicationService.php`
- [Category data](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Data/CategoryData.php): `Modules/Shop/app/Data/CategoryData.php`
- [Category model](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Models/Category.php): `Modules/Shop/app/Models/Category.php`
- [Attribute families](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Application/AttributeFamily/AttributeFamilyApplicationService.php): `Modules/Shop/app/Application/AttributeFamily/AttributeFamilyApplicationService.php`
- [Attribute management](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Application/Attribute/AttributeApplicationService.php): `Modules/Shop/app/Application/Attribute/AttributeApplicationService.php`
- [Shop route mapping](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Shop/app/Providers/RouteServiceProvider.php): `Modules/Shop/app/Providers/RouteServiceProvider.php`

### Users and access

- [Role controller](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/User/app/Http/Controllers/Admin/RoleController.php): `Modules/User/app/Http/Controllers/Admin/RoleController.php`
- [Role management](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/User/app/Application/Role/RoleManagementApplicationService.php): `Modules/User/app/Application/Role/RoleManagementApplicationService.php`
- [User management](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/User/app/Application/User/UserManagementApplicationService.php): `Modules/User/app/Application/User/UserManagementApplicationService.php`
- [User model](https://github.com/hadi-hilal/e_commerce/blob/main/app/Models/User.php): `app/Models/User.php`
- [Permission rules](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/User/app/Helpers/Permissions.php): `Modules/User/app/Helpers/Permissions.php`
- [Auth and gates](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/User/app/Providers/AuthServiceProvider.php): `Modules/User/app/Providers/AuthServiceProvider.php`
- [User route mapping](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/User/app/Providers/RouteServiceProvider.php): `Modules/User/app/Providers/RouteServiceProvider.php`

### System administration

- [Settings and SEO](https://github.com/hadi-hilal/e_commerce/tree/main/Modules/Base/app/Application): `Modules/Base/app/Application`
- [Media library](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Base/app/Http/Controllers/Admin/MediaLibraryController.php): `Modules/Base/app/Http/Controllers/Admin/MediaLibraryController.php`
- [Media model](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Base/app/Models/Media.php): `Modules/Base/app/Models/Media.php`
- [Base route mapping](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Base/app/Providers/RouteServiceProvider.php): `Modules/Base/app/Providers/RouteServiceProvider.php`
- [App installer](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Core/app/Console/InstallAppCommand.php): `Modules/Core/app/Console/InstallAppCommand.php`
- [File operations](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Core/app/Traits/FileTrait.php): `Modules/Core/app/Traits/FileTrait.php`
- [Flash messaging](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Core/app/Services/Flash/SessionFlashMessenger.php): `Modules/Core/app/Services/Flash/SessionFlashMessenger.php`
- [Flash contract](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Core/app/Contracts/Flash/FlashMessengerInterface.php): `Modules/Core/app/Contracts/Flash/FlashMessengerInterface.php`

### Support

- [Contact and subscribers](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Support/app/Application/SupportAdmin/SupportInboxApplicationService.php): `Modules/Support/app/Application/SupportAdmin/SupportInboxApplicationService.php`
- [Contact controller](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Support/app/Http/Controllers/Admin/ContactFormController.php): `Modules/Support/app/Http/Controllers/Admin/ContactFormController.php`
- [Support route mapping](https://github.com/hadi-hilal/e_commerce/blob/main/Modules/Support/app/Providers/RouteServiceProvider.php): `Modules/Support/app/Providers/RouteServiceProvider.php`

### Other components

- **Administrator**

## Connections

- Administrator → Page controller: submits request
- Page controller → Page service: delegates (evidence: `Modules/Cms/app/Http/Controllers/Admin/PageController.php`)
- Page controller → Page command: builds input (evidence: `Modules/Cms/app/Http/Controllers/Admin/PageController.php`)
- Page controller → Content query: builds query (evidence: `Modules/Cms/app/Http/Controllers/Admin/PageController.php`)
- Page controller → Page data: validates data (evidence: `Modules/Cms/app/Http/Controllers/Admin/PageController.php`)
- Page service → Page command: uses command (evidence: `Modules/Cms/app/Application/Page/PageApplicationService.php`)
- Page service → Content query: uses query (evidence: `Modules/Cms/app/Application/Page/PageApplicationService.php`)
- Page service → Page model: uses model (evidence: `Modules/Cms/app/Application/Page/PageApplicationService.php`)
- Page service → Flash contract: uses contract (evidence: `Modules/Cms/app/Application/Page/PageApplicationService.php`)
- Administrator → Category controller: submits request
- Category controller → Category service: delegates (evidence: `Modules/Shop/app/Http/Controllers/Admin/CategoryController.php`)
- Category controller → Attribute families: loads families (evidence: `Modules/Shop/app/Http/Controllers/Admin/CategoryController.php`)
- Category controller → Category data: builds input (evidence: `Modules/Shop/app/Http/Controllers/Admin/CategoryController.php`)
- Category service → Category model: uses model (evidence: `Modules/Shop/app/Application/Category/CategoryApplicationService.php`)
- Category service → Category data: uses data (evidence: `Modules/Shop/app/Application/Category/CategoryApplicationService.php`)
- Category service → File operations: uses files (evidence: `Modules/Shop/app/Application/Category/CategoryApplicationService.php`)
- Role controller → Role management: delegates (evidence: `Modules/User/app/Http/Controllers/Admin/RoleController.php`)
- Role controller → Permission rules: groups permissions (evidence: `Modules/User/app/Http/Controllers/Admin/RoleController.php`)
- Auth and gates → User model: checks user (evidence: `Modules/User/app/Providers/AuthServiceProvider.php`)
- Media library → Media model: uses model (evidence: `Modules/Base/app/Http/Controllers/Admin/MediaLibraryController.php`)
- Media library → File operations: uses files (evidence: `Modules/Base/app/Http/Controllers/Admin/MediaLibraryController.php`)
- Flash messaging → Flash contract: implements (evidence: `Modules/Core/app/Services/Flash/SessionFlashMessenger.php`)
- Contact controller → Contact and subscribers: delegates (evidence: `Modules/Support/app/Http/Controllers/Admin/ContactFormController.php`)
