# mohamedayman87/mvc_crud architecture

> Architecture diagram of the GitHub repository mohamedayman87/mvc_crud, 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/mohamedayman87/mvc_crud
- Repository: https://github.com/mohamedayman87/mvc_crud

## Overview

This is a PHP product-catalog CRUD application built around a small MVC-style framework. A browser request enters through the public front controller, whose App router dispatches a controller action; product actions read or modify product records and render catalog or form pages. The internal layers are the product model, shared database connection, and bundled MySQLi wrapper. The README is empty, so capability coverage comes from the available controller and view excerpts; the database and template paths are only partially sampled.

Main entry points: [`app/Core/View.php`](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Core/View.php) (View Loader), [`app/Libs/DB/MysqliDb.php`](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Libs/DB/MysqliDb.php) (MySQLi Wrapper), [`app/Core/App.php`](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Core/App.php) (App Router), [`app/Controllers/ProductController.php`](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Controllers/ProductController.php) (Product Actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Request Runtime"]
  node_front["Public Entry<br/>[index.php]"]
  node_autoload["Bootstrap<br/>[autoload.php]"]
  node_router["App Router<br/>[App.php]"]
end

subgraph group_catalog["Product Catalog"]
  node_home["Home Actions<br/>[HomeController.php]"]
  node_productctl["Product Actions"]
end

subgraph group_data["Data Access"]
  node_productmodel["Product Model<br/>[product.php]"]
  node_modelbase["Model Base<br/>[Model.php]"]
  node_mysqli["MySQLi Wrapper<br/>[MysqliDb.php]"]
  node_dbobject["Object Mapper<br/>[dbObject.php]"]
end

subgraph group_presentation["Presentation"]
  node_viewloader["View Loader<br/>[View.php]"]
  node_cataloglist["Catalog Page<br/>[index.php]"]
  node_productforms["Product Forms"]
  node_homeview["Home Page<br/>[home.php]"]
  node_sharedviews["Shared Layout"]
end

node_browser(("Browser"))
node_mysql[("MySQL Database")]

node_browser -->|"requests"| node_front
node_front -->|"requires"| node_autoload
node_autoload -->|"starts"| node_router
node_router -->|"dispatches"| node_home
node_router -.->|"dispatches"| node_productctl
node_home -->|"loads view"| node_viewloader
node_productctl -->|"uses"| node_productmodel
node_productctl -->|"loads view"| node_viewloader
node_productmodel -->|"extends"| node_modelbase
node_modelbase -->|"creates connection"| node_mysqli
node_productmodel -->|"queries products"| node_mysqli
node_mysqli -->|"connects"| node_mysql
node_dbobject -->|"delegates queries"| node_mysqli
node_viewloader -.->|"renders"| node_cataloglist
node_viewloader -.->|"renders"| node_productforms
node_viewloader -.->|"renders"| node_homeview
node_cataloglist -->|"includes layout"| node_sharedviews

click node_front "https://github.com/mohamedayman87/mvc_crud/blob/main/public/index.php"
click node_autoload "https://github.com/mohamedayman87/mvc_crud/blob/main/public/autoload.php"
click node_router "https://github.com/mohamedayman87/mvc_crud/blob/main/app/Core/App.php"
click node_home "https://github.com/mohamedayman87/mvc_crud/blob/main/app/Controllers/HomeController.php"
click node_productctl "https://github.com/mohamedayman87/mvc_crud/blob/main/app/Controllers/ProductController.php"
click node_productmodel "https://github.com/mohamedayman87/mvc_crud/blob/main/app/Models/product.php"
click node_modelbase "https://github.com/mohamedayman87/mvc_crud/blob/main/app/Core/Model.php"
click node_mysqli "https://github.com/mohamedayman87/mvc_crud/blob/main/app/Libs/DB/MysqliDb.php"
click node_dbobject "https://github.com/mohamedayman87/mvc_crud/blob/main/app/Libs/DB/dbObject.php"
click node_viewloader "https://github.com/mohamedayman87/mvc_crud/blob/main/app/Core/View.php"
click node_cataloglist "https://github.com/mohamedayman87/mvc_crud/blob/main/app/Views/products/index.php"
click node_productforms "https://github.com/mohamedayman87/mvc_crud/tree/main/app/Views/products"
click node_homeview "https://github.com/mohamedayman87/mvc_crud/blob/main/app/Views/home.php"
click node_sharedviews "https://github.com/mohamedayman87/mvc_crud/tree/main/app/Views/inc"

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_front,node_autoload,node_router,node_browser toneBlue
class node_home,node_productctl,node_mysql toneAmber
class node_productmodel,node_modelbase,node_mysqli,node_dbobject toneMint
class node_viewloader,node_cataloglist,node_productforms,node_homeview,node_sharedviews toneRose
```

## Components

### Request Runtime

- [Public Entry](https://github.com/mohamedayman87/mvc_crud/blob/main/public/index.php): `public/index.php`
- [Bootstrap](https://github.com/mohamedayman87/mvc_crud/blob/main/public/autoload.php): `public/autoload.php`
- [App Router](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Core/App.php): `app/Core/App.php`

### Product Catalog

- [Home Actions](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Controllers/HomeController.php): `app/Controllers/HomeController.php`
- [Product Actions](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Controllers/ProductController.php): `app/Controllers/ProductController.php`

### Data Access

- [Product Model](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Models/product.php): `app/Models/product.php`
- [Model Base](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Core/Model.php): `app/Core/Model.php`
- [MySQLi Wrapper](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Libs/DB/MysqliDb.php): `app/Libs/DB/MysqliDb.php`
- [Object Mapper](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Libs/DB/dbObject.php): `app/Libs/DB/dbObject.php`

### Presentation

- [View Loader](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Core/View.php): `app/Core/View.php`
- [Catalog Page](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Views/products/index.php): `app/Views/products/index.php`
- [Product Forms](https://github.com/mohamedayman87/mvc_crud/tree/main/app/Views/products): `app/Views/products`
- [Home Page](https://github.com/mohamedayman87/mvc_crud/blob/main/app/Views/home.php): `app/Views/home.php`
- [Shared Layout](https://github.com/mohamedayman87/mvc_crud/tree/main/app/Views/inc): `app/Views/inc`

### Other components

- **Browser**
- **MySQL Database**

## Connections

- Browser → Public Entry: requests
- Public Entry → Bootstrap: requires (evidence: `public/index.php`)
- Bootstrap → App Router: starts (evidence: `public/autoload.php`)
- App Router → Home Actions: dispatches (evidence: `app/Core/App.php`)
- App Router → Product Actions: dispatches
- Home Actions → View Loader: loads view (evidence: `app/Controllers/HomeController.php`)
- Product Actions → Product Model: uses (evidence: `app/Controllers/ProductController.php`)
- Product Actions → View Loader: loads view (evidence: `app/Controllers/ProductController.php`)
- Product Model → Model Base: extends (evidence: `app/Models/product.php`)
- Model Base → MySQLi Wrapper: creates connection (evidence: `app/Core/Model.php`)
- Product Model → MySQLi Wrapper: queries products (evidence: `app/Models/product.php`)
- MySQLi Wrapper → MySQL Database: connects (evidence: `app/Libs/DB/MysqliDb.php`)
- Object Mapper → MySQLi Wrapper: delegates queries (evidence: `app/Libs/DB/dbObject.php`)
- View Loader → Catalog Page: renders
- View Loader → Product Forms: renders
- View Loader → Home Page: renders
- Catalog Page → Shared Layout: includes layout (evidence: `app/Views/products/index.php`)
