# tonicirvianum/miniappcrud_bbddexample architecture

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

- Interactive diagram: https://gitdiagram.com/tonicirvianum/miniappcrud_bbddexample
- Repository: https://github.com/tonicirvianum/miniappcrud_bbddexample

## Overview

MiniAppCRUD is a PHP MVC product-management app with a simple login flow. Requests enter through the front controller, which registers routes and dispatches to controllers; product actions validate input and render pages or use the Product model. The README documents MySQL-backed schema setup and seeding, but Product writes still use session data while its reads use MySQL. The graph preserves both paths. Product, login, and error views are grouped by directory; unsampled details are represented only where the README or source index supports them.

Main entry points: [`App/Core/Controller.php`](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Core/Controller.php) (View renderer), [`App/Core/Router.php`](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Core/Router.php) (Router), [`App/Controllers/HomeController.php`](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Controllers/HomeController.php) (Home controller), [`App/Core/Database.php`](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Core/Database.php) (Database access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_request["Request routing"]
  node_entry["Front controller<br/>[index.php]"]
  node_router["Router<br/>[Router.php]"]
end

subgraph group_features["Application features"]
  node_home["Home controller<br/>[HomeController.php]"]
  node_products["Product controller"]
  node_login["Login controller"]
end

subgraph group_presentation["Views and rendering"]
  node_render["View renderer<br/>[Controller.php]"]
  node_homeview["Home page"]
  node_productviews["Product pages"]
  node_loginviews["Login pages"]
  node_errorview["404 page<br/>[404.view.php]"]
end

subgraph group_persistence["Persistence and setup"]
  node_productmodel["Product model<br/>[Product.php]"]
  node_category["Category model<br/>[Category.php]"]
  node_database["Database access<br/>[Database.php]"]
  node_schema["Product schema<br/>[Schema.php]"]
  node_seeder["Product seeder<br/>[Seeder.php]"]
  node_session["Session products<br/>[init.php]"]
end

node_browser(("Browser user"))
node_mysql[("MySQL database")]

node_browser -->|"sends request"| node_entry
node_entry -->|"registers routes"| node_router
node_entry -->|"dispatches request"| node_router
node_router -->|"dispatches routes"| node_home
node_router -->|"handles fallback"| node_home
node_router -->|"dispatches routes"| node_products
node_router -->|"dispatches routes"| node_login
node_home -->|"checks schema"| node_schema
node_home -->|"seeds products"| node_seeder
node_home -->|"creates connection"| node_database
node_products -->|"reads and mutates"| node_productmodel
node_productmodel -->|"queries through"| node_database
node_database -->|"executes SQL"| node_mysql
node_schema -->|"executes schema SQL"| node_database
node_seeder -->|"inserts rows"| node_database
node_products -->|"uses session data"| node_session
node_entry -->|"initializes products"| node_session
node_home -->|"renders page"| node_render
node_products -->|"renders pages"| node_render
node_login -->|"renders pages"| node_render
node_render -->|"loads view"| node_homeview
node_render -->|"loads views"| node_productviews
node_render -->|"loads views"| node_loginviews
node_render -->|"loads view"| node_errorview
node_productviews -->|"uses model"| node_category

click node_entry "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/index.php"
click node_router "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Core/Router.php"
click node_home "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Controllers/HomeController.php"
click node_products "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Controllers/ProductController.php"
click node_login "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Controllers/LoginController.php"
click node_render "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Core/Controller.php"
click node_homeview "https://github.com/tonicirvianum/miniappcrud_bbddexample/tree/main/App/Views/home"
click node_productviews "https://github.com/tonicirvianum/miniappcrud_bbddexample/tree/main/App/Views/products"
click node_loginviews "https://github.com/tonicirvianum/miniappcrud_bbddexample/tree/main/App/Views/login"
click node_errorview "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Views/errors/404.view.php"
click node_productmodel "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Models/Product.php"
click node_category "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Models/Category.php"
click node_database "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Core/Database.php"
click node_schema "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Database/Schema.php"
click node_seeder "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Database/Seeder.php"
click node_session "https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/config/init.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_entry,node_router,node_browser toneBlue
class node_home,node_products,node_login,node_mysql toneAmber
class node_render,node_homeview,node_productviews,node_loginviews,node_errorview toneMint
class node_productmodel,node_category,node_database,node_schema,node_seeder,node_session toneRose
```

## Components

### Request routing

- [Front controller](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/index.php): `index.php`
- [Router](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Core/Router.php): `App/Core/Router.php`

### Application features

- [Home controller](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Controllers/HomeController.php): `App/Controllers/HomeController.php`
- [Product controller](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Controllers/ProductController.php): `App/Controllers/ProductController.php`
- [Login controller](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Controllers/LoginController.php): `App/Controllers/LoginController.php`

### Views and rendering

- [View renderer](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Core/Controller.php): `App/Core/Controller.php`
- [Home page](https://github.com/tonicirvianum/miniappcrud_bbddexample/tree/main/App/Views/home): `App/Views/home`
- [Product pages](https://github.com/tonicirvianum/miniappcrud_bbddexample/tree/main/App/Views/products): `App/Views/products`
- [Login pages](https://github.com/tonicirvianum/miniappcrud_bbddexample/tree/main/App/Views/login): `App/Views/login`
- [404 page](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Views/errors/404.view.php): `App/Views/errors/404.view.php`

### Persistence and setup

- [Product model](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Models/Product.php): `App/Models/Product.php`
- [Category model](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Models/Category.php): `App/Models/Category.php`
- [Database access](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Core/Database.php): `App/Core/Database.php`
- [Product schema](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Database/Schema.php): `App/Database/Schema.php`
- [Product seeder](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/Database/Seeder.php): `App/Database/Seeder.php`
- [Session products](https://github.com/tonicirvianum/miniappcrud_bbddexample/blob/main/App/config/init.php): `App/config/init.php`

### Other components

- **Browser user**
- **MySQL database**

## Connections

- Browser user → Front controller: sends request (evidence: `index.php`)
- Front controller → Router: registers routes (evidence: `index.php`)
- Front controller → Router: dispatches request (evidence: `index.php`)
- Router → Home controller: dispatches routes (evidence: `index.php`)
- Router → Home controller: handles fallback (evidence: `App/Core/Router.php`)
- Router → Product controller: dispatches routes (evidence: `index.php`)
- Router → Login controller: dispatches routes (evidence: `index.php`)
- Home controller → Product schema: checks schema (evidence: `App/Controllers/HomeController.php`)
- Home controller → Product seeder: seeds products (evidence: `App/Controllers/HomeController.php`)
- Home controller → Database access: creates connection (evidence: `App/Controllers/HomeController.php`)
- Product controller → Product model: reads and mutates (evidence: `App/Controllers/ProductController.php`)
- Product model → Database access: queries through (evidence: `App/Models/Product.php`)
- Database access → MySQL database: executes SQL (evidence: `App/Core/Database.php`)
- Product schema → Database access: executes schema SQL (evidence: `App/Database/Schema.php`)
- Product seeder → Database access: inserts rows (evidence: `App/Database/Seeder.php`)
- Product controller → Session products: uses session data
- Front controller → Session products: initializes products (evidence: `index.php`)
- Home controller → View renderer: renders page (evidence: `App/Controllers/HomeController.php`)
- Product controller → View renderer: renders pages (evidence: `App/Controllers/ProductController.php`)
- Login controller → View renderer: renders pages (evidence: `App/Controllers/LoginController.php`)
- View renderer → Home page: loads view
- View renderer → Product pages: loads views
- View renderer → Login pages: loads views
- View renderer → 404 page: loads view
- Product pages → Category model: uses model (evidence: `App/Views/products/create.view.php`)
