# daniellbp2005/layout architecture

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

- Interactive diagram: https://gitdiagram.com/daniellbp2005/layout
- Repository: https://github.com/daniellbp2005/layout

## Overview

This PHP/MySQL e-commerce site presents World Cup sticker products by category and lets shoppers manage a session-based cart. The main path is catalog browsing, adding products, then viewing or changing cart quantities in a fetched modal. README-documented catalog expansion and product entry are retained, though their full implementation was not sampled. The sampled sources show catalog reads, AJAX expansion, and browser-to-cart-handler requests; links from cart handlers to storage are omitted where their source was not provided.

Main entry points: [`includes/crud.php`](https://github.com/daniellbp2005/layout/blob/main/includes/crud.php) (PDO CRUD), [`js/carrinho.js`](https://github.com/daniellbp2005/layout/blob/main/js/carrinho.js) (Cart controls), [`includes/init.php`](https://github.com/daniellbp2005/layout/blob/main/includes/init.php) (Session setup), [`index.php`](https://github.com/daniellbp2005/layout/blob/main/index.php) (Catalog page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Product catalog"]
  node_catalog_page["Catalog page<br/>[index.php]"]
  node_catalog_expand["Category expansion<br/>[atualizar.php]"]
  node_expand_client["Expand controls<br/>[atualizar.js]"]
  node_scroll_client["Horizontal scrolling<br/>[mover-linha.js]"]
end

subgraph group_cart["Shopping cart"]
  node_cart_client["Cart controls<br/>[carrinho.js]"]
  node_cart_add["Add item handler<br/>[addCarrinho.php]"]
  node_cart_update["Cart update handler"]
  node_session_init["Session setup<br/>[init.php]"]
  node_cart_open["Modal loader<br/>[abrirCarinho.js]"]
  node_cart_view["Cart modal view<br/>[modalCarrinho.php]"]
end

subgraph group_data["Persistence"]
  node_product_db[("MySQL products")]
  node_crud["PDO CRUD<br/>[crud.php]"]
end

subgraph group_management["Product management"]
  node_product_entry["Product entry<br/>[addFigurinha.php]"]
  node_product_table["Product table<br/>[table.php]"]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_catalog_page
node_catalog_page -->|"reads products"| node_crud
node_crud -->|"queries"| node_product_db
node_shopper -->|"expands category"| node_expand_client
node_expand_client -->|"posts category"| node_catalog_expand
node_catalog_expand -->|"reads products"| node_crud
node_shopper -->|"scrolls catalog"| node_scroll_client
node_shopper -->|"manages cart"| node_cart_client
node_cart_client -->|"posts item"| node_cart_add
node_cart_client -->|"posts quantity"| node_cart_update
node_shopper -->|"opens cart"| node_cart_open
node_cart_open -->|"fetches view"| node_cart_view
node_cart_view -->|"starts session"| node_session_init
node_cart_add -->|"uses session"| node_session_init
node_cart_update -->|"uses session"| node_session_init
node_shopper -->|"adds product"| node_product_entry
node_product_entry -->|"product operations"| node_crud
node_shopper -->|"views products"| node_product_table

click node_catalog_page "https://github.com/daniellbp2005/layout/blob/main/index.php"
click node_catalog_expand "https://github.com/daniellbp2005/layout/blob/main/AJAX/atualizar.php"
click node_expand_client "https://github.com/daniellbp2005/layout/blob/main/js/atualizar.js"
click node_scroll_client "https://github.com/daniellbp2005/layout/blob/main/js/mover-linha.js"
click node_crud "https://github.com/daniellbp2005/layout/blob/main/includes/crud.php"
click node_cart_client "https://github.com/daniellbp2005/layout/blob/main/js/carrinho.js"
click node_cart_add "https://github.com/daniellbp2005/layout/blob/main/addCarrinho.php"
click node_cart_update "https://github.com/daniellbp2005/layout/blob/main/atualizarCarrinho.php"
click node_session_init "https://github.com/daniellbp2005/layout/blob/main/includes/init.php"
click node_cart_open "https://github.com/daniellbp2005/layout/blob/main/modal/abrirCarinho.js"
click node_cart_view "https://github.com/daniellbp2005/layout/blob/main/modal/modalCarrinho.php"
click node_product_entry "https://github.com/daniellbp2005/layout/blob/main/addFigurinha.php"
click node_product_table "https://github.com/daniellbp2005/layout/blob/main/table.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_catalog_page,node_catalog_expand,node_expand_client,node_scroll_client toneBlue
class node_cart_client,node_cart_add,node_cart_update,node_session_init,node_cart_open,node_cart_view toneAmber
class node_product_db,node_crud toneMint
class node_product_entry,node_product_table toneRose
class node_shopper toneIndigo
```

## Components

### Product catalog

- [Catalog page](https://github.com/daniellbp2005/layout/blob/main/index.php): `index.php`
- [Category expansion](https://github.com/daniellbp2005/layout/blob/main/AJAX/atualizar.php): `AJAX/atualizar.php`
- [Expand controls](https://github.com/daniellbp2005/layout/blob/main/js/atualizar.js): `js/atualizar.js`
- [Horizontal scrolling](https://github.com/daniellbp2005/layout/blob/main/js/mover-linha.js): `js/mover-linha.js`

### Shopping cart

- [Cart controls](https://github.com/daniellbp2005/layout/blob/main/js/carrinho.js): `js/carrinho.js`
- [Add item handler](https://github.com/daniellbp2005/layout/blob/main/addCarrinho.php): `addCarrinho.php`
- [Cart update handler](https://github.com/daniellbp2005/layout/blob/main/atualizarCarrinho.php): `atualizarCarrinho.php`
- [Session setup](https://github.com/daniellbp2005/layout/blob/main/includes/init.php): `includes/init.php`
- [Modal loader](https://github.com/daniellbp2005/layout/blob/main/modal/abrirCarinho.js): `modal/abrirCarinho.js`
- [Cart modal view](https://github.com/daniellbp2005/layout/blob/main/modal/modalCarrinho.php): `modal/modalCarrinho.php`

### Persistence

- **MySQL products**
- [PDO CRUD](https://github.com/daniellbp2005/layout/blob/main/includes/crud.php): `includes/crud.php`

### Product management

- [Product entry](https://github.com/daniellbp2005/layout/blob/main/addFigurinha.php): `addFigurinha.php`
- [Product table](https://github.com/daniellbp2005/layout/blob/main/table.php): `table.php`

### Other components

- **Shopper**

## Connections

- Shopper → Catalog page: browses
- Catalog page → PDO CRUD: reads products
- PDO CRUD → MySQL products: queries
- Shopper → Expand controls: expands category
- Expand controls → Category expansion: posts category
- Category expansion → PDO CRUD: reads products
- Shopper → Horizontal scrolling: scrolls catalog
- Shopper → Cart controls: manages cart
- Cart controls → Add item handler: posts item
- Cart controls → Cart update handler: posts quantity
- Shopper → Modal loader: opens cart
- Modal loader → Cart modal view: fetches view
- Cart modal view → Session setup: starts session
- Add item handler → Session setup: uses session
- Cart update handler → Session setup: uses session
- Shopper → Product entry: adds product
- Product entry → PDO CRUD: product operations
- Shopper → Product table: views products
