# camilo180601/camele-ecommerce architecture

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

- Interactive diagram: https://gitdiagram.com/camilo180601/camele-ecommerce
- Repository: https://github.com/camilo180601/camele-ecommerce

## Overview

Tienda Camele is a PHP online store. A shopper browses the catalog and product details, adds items to a session cart, reviews or changes the cart, and proceeds to payment; purchase capture records the order and line items, updates stock, and sends a confirmation email. Separate admin pages support product and purchase management. The graph reflects sampled calls and SOURCE INDEX references; payment-provider callbacks and several unsampled page interactions are not fully visible, so those links are omitted or marked unverified.

Main entry points: [`config/database.php`](https://github.com/camilo180601/camele-ecommerce/blob/main/config/database.php) (MySQL Database), [`index.php`](https://github.com/camilo180601/camele-ecommerce/blob/main/index.php) (Product Catalog), [`phpmailer/src/PHPMailer.php`](https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/PHPMailer.php) (PHPMailer), [`clases/captura.php`](https://github.com/camilo180601/camele-ecommerce/blob/main/clases/captura.php) (Payment Capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shopping["Storefront and Cart"]
  node_catalog["Product Catalog<br/>[index.php]"]
  node_details["Product Details<br/>[details.php]"]
  node_cart["Session Cart<br/>[carrito.php]"]
  node_cart_update["Cart Updates"]
  node_checkout["Checkout<br/>[checkout.php]"]
  node_config["Store Config<br/>[config.php]"]
  node_header["Shared Header<br/>[header.php]"]
  node_footer["Shared Footer<br/>[footer.php]"]
end

subgraph group_orders["Payments and Orders"]
  node_payment_page["Payment Page<br/>[pago.php]"]
  node_capture["Payment Capture<br/>[captura.php]"]
  node_complete["Order Confirmation<br/>[pagocompletado.php]"]
  node_database[("MySQL Database<br/>[database.php]")]
end

subgraph group_admin["Store Administration"]
  node_orders_list["Purchase History<br/>[compras.php]"]
  node_order_detail["Purchase Detail<br/>[detalle-compra.php]"]
  node_admin_login["Admin Login<br/>[loginadmin.php]"]
  node_product_admin["Product Management<br/>[crear-producto.php]"]
  node_product_edit["Edit Product"]
  node_product_save["Save Product"]
  node_product_delete["Delete Product"]
end

subgraph group_mail["Email Delivery"]
  node_email_sender["Purchase Email<br/>[enviar_email.php]"]
  node_phpmailer["PHPMailer<br/>[PHPMailer.php]"]
  node_smtp["SMTP Transport<br/>[SMTP.php]"]
  node_mailer_exception["Mailer Exception<br/>[Exception.php]"]
  node_oauth["OAuth Support<br/>[OAuth.php]"]
  node_oauth_provider["OAuth Interface"]
  node_pop3["POP3 Support<br/>[POP3.php]"]
end

node_shopper(("Shopper"))
node_paypal(("PayPal"))
node_admin_user(("Administrator"))

node_shopper -->|"browses"| node_catalog
node_shopper -->|"opens"| node_details
node_shopper -->|"adds items"| node_cart
node_catalog -->|"queries products"| node_database
node_catalog -->|"includes"| node_header
node_catalog -->|"includes"| node_footer
node_catalog -->|"loads"| node_config
node_cart -->|"queries products"| node_database
node_checkout -->|"queries products"| node_database
node_checkout -->|"posts changes"| node_cart_update
node_checkout -->|"links to"| node_payment_page
node_payment_page -.->|"initiates payment"| node_paypal
node_paypal -.->|"sends payment data"| node_capture
node_capture -->|"records purchase"| node_database
node_capture -->|"includes email"| node_email_sender
node_capture -.->|"confirms purchase"| node_complete
node_admin_user -->|"signs in"| node_admin_login
node_admin_user -->|"manages products"| node_product_admin
node_admin_user -->|"edits products"| node_product_edit
node_admin_user -->|"deletes products"| node_product_delete
node_admin_user -->|"views purchases"| node_orders_list
node_orders_list -.->|"opens detail"| node_order_detail
node_product_admin -->|"accesses"| node_database
node_product_edit -->|"accesses"| node_database
node_product_save -->|"writes products"| node_database
node_product_delete -.->|"accesses"| node_database
node_orders_list -->|"accesses"| node_database
node_order_detail -->|"accesses"| node_database
node_email_sender -->|"uses"| node_phpmailer
node_email_sender -->|"uses"| node_smtp
node_email_sender -->|"uses"| node_mailer_exception
node_phpmailer -->|"transports mail"| node_smtp
node_phpmailer -->|"throws"| node_mailer_exception
node_phpmailer -->|"uses interface"| node_oauth_provider
node_oauth -->|"implements"| node_oauth_provider
node_pop3 -->|"uses"| node_mailer_exception
node_pop3 -->|"references"| node_phpmailer
node_smtp -->|"supports auth"| node_oauth

click node_catalog "https://github.com/camilo180601/camele-ecommerce/blob/main/index.php"
click node_details "https://github.com/camilo180601/camele-ecommerce/blob/main/details.php"
click node_cart "https://github.com/camilo180601/camele-ecommerce/blob/main/clases/carrito.php"
click node_cart_update "https://github.com/camilo180601/camele-ecommerce/blob/main/clases/actualizar_carrito.php"
click node_checkout "https://github.com/camilo180601/camele-ecommerce/blob/main/checkout.php"
click node_payment_page "https://github.com/camilo180601/camele-ecommerce/blob/main/pago.php"
click node_capture "https://github.com/camilo180601/camele-ecommerce/blob/main/clases/captura.php"
click node_complete "https://github.com/camilo180601/camele-ecommerce/blob/main/pagocompletado.php"
click node_orders_list "https://github.com/camilo180601/camele-ecommerce/blob/main/compras.php"
click node_order_detail "https://github.com/camilo180601/camele-ecommerce/blob/main/detalle-compra.php"
click node_admin_login "https://github.com/camilo180601/camele-ecommerce/blob/main/loginadmin.php"
click node_product_admin "https://github.com/camilo180601/camele-ecommerce/blob/main/crear-producto.php"
click node_product_edit "https://github.com/camilo180601/camele-ecommerce/blob/main/editar-producto.php"
click node_product_save "https://github.com/camilo180601/camele-ecommerce/blob/main/guardar-producto.php"
click node_product_delete "https://github.com/camilo180601/camele-ecommerce/blob/main/eliminar-producto.php"
click node_database "https://github.com/camilo180601/camele-ecommerce/blob/main/config/database.php"
click node_config "https://github.com/camilo180601/camele-ecommerce/blob/main/config/config.php"
click node_email_sender "https://github.com/camilo180601/camele-ecommerce/blob/main/clases/enviar_email.php"
click node_phpmailer "https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/PHPMailer.php"
click node_smtp "https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/SMTP.php"
click node_mailer_exception "https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/Exception.php"
click node_oauth "https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/OAuth.php"
click node_oauth_provider "https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/OAuthTokenProvider.php"
click node_pop3 "https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/POP3.php"
click node_header "https://github.com/camilo180601/camele-ecommerce/blob/main/layout/header.php"
click node_footer "https://github.com/camilo180601/camele-ecommerce/blob/main/layout/footer.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,node_details,node_cart,node_cart_update,node_checkout,node_config,node_header,node_footer toneBlue
class node_payment_page,node_capture,node_complete,node_database toneAmber
class node_orders_list,node_order_detail,node_admin_login,node_product_admin,node_product_edit,node_product_save,node_product_delete toneMint
class node_email_sender,node_phpmailer,node_smtp,node_mailer_exception,node_oauth,node_oauth_provider,node_pop3 toneRose
class node_shopper,node_paypal,node_admin_user toneIndigo
```

## Components

### Storefront and Cart

- [Product Catalog](https://github.com/camilo180601/camele-ecommerce/blob/main/index.php): `index.php`
- [Product Details](https://github.com/camilo180601/camele-ecommerce/blob/main/details.php): `details.php`
- [Session Cart](https://github.com/camilo180601/camele-ecommerce/blob/main/clases/carrito.php): `clases/carrito.php`
- [Cart Updates](https://github.com/camilo180601/camele-ecommerce/blob/main/clases/actualizar_carrito.php): `clases/actualizar_carrito.php`
- [Checkout](https://github.com/camilo180601/camele-ecommerce/blob/main/checkout.php): `checkout.php`
- [Store Config](https://github.com/camilo180601/camele-ecommerce/blob/main/config/config.php): `config/config.php`
- [Shared Header](https://github.com/camilo180601/camele-ecommerce/blob/main/layout/header.php): `layout/header.php`
- [Shared Footer](https://github.com/camilo180601/camele-ecommerce/blob/main/layout/footer.php): `layout/footer.php`

### Payments and Orders

- [Payment Page](https://github.com/camilo180601/camele-ecommerce/blob/main/pago.php): `pago.php`
- [Payment Capture](https://github.com/camilo180601/camele-ecommerce/blob/main/clases/captura.php): `clases/captura.php`
- [Order Confirmation](https://github.com/camilo180601/camele-ecommerce/blob/main/pagocompletado.php): `pagocompletado.php`
- [MySQL Database](https://github.com/camilo180601/camele-ecommerce/blob/main/config/database.php): `config/database.php`

### Store Administration

- [Purchase History](https://github.com/camilo180601/camele-ecommerce/blob/main/compras.php): `compras.php`
- [Purchase Detail](https://github.com/camilo180601/camele-ecommerce/blob/main/detalle-compra.php): `detalle-compra.php`
- [Admin Login](https://github.com/camilo180601/camele-ecommerce/blob/main/loginadmin.php): `loginadmin.php`
- [Product Management](https://github.com/camilo180601/camele-ecommerce/blob/main/crear-producto.php): `crear-producto.php`
- [Edit Product](https://github.com/camilo180601/camele-ecommerce/blob/main/editar-producto.php): `editar-producto.php`
- [Save Product](https://github.com/camilo180601/camele-ecommerce/blob/main/guardar-producto.php): `guardar-producto.php`
- [Delete Product](https://github.com/camilo180601/camele-ecommerce/blob/main/eliminar-producto.php): `eliminar-producto.php`

### Email Delivery

- [Purchase Email](https://github.com/camilo180601/camele-ecommerce/blob/main/clases/enviar_email.php): `clases/enviar_email.php`
- [PHPMailer](https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/PHPMailer.php): `phpmailer/src/PHPMailer.php`
- [SMTP Transport](https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/SMTP.php): `phpmailer/src/SMTP.php`
- [Mailer Exception](https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/Exception.php): `phpmailer/src/Exception.php`
- [OAuth Support](https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/OAuth.php): `phpmailer/src/OAuth.php`
- [OAuth Interface](https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/OAuthTokenProvider.php): `phpmailer/src/OAuthTokenProvider.php`
- [POP3 Support](https://github.com/camilo180601/camele-ecommerce/blob/main/phpmailer/src/POP3.php): `phpmailer/src/POP3.php`

### Other components

- **Shopper**
- **PayPal**
- **Administrator**

## Connections

- Shopper → Product Catalog: browses (evidence: `index.php`)
- Shopper → Product Details: opens
- Shopper → Session Cart: adds items
- Product Catalog → MySQL Database: queries products (evidence: `index.php`)
- Product Catalog → Shared Header: includes (evidence: `index.php`)
- Product Catalog → Shared Footer: includes (evidence: `index.php`)
- Product Catalog → Store Config: loads (evidence: `index.php`)
- Session Cart → MySQL Database: queries products (evidence: `clases/carrito.php`)
- Checkout → MySQL Database: queries products (evidence: `checkout.php`)
- Checkout → Cart Updates: posts changes (evidence: `checkout.php`)
- Checkout → Payment Page: links to (evidence: `checkout.php`)
- Payment Page → PayPal: initiates payment
- PayPal → Payment Capture: sends payment data
- Payment Capture → MySQL Database: records purchase (evidence: `clases/captura.php`)
- Payment Capture → Purchase Email: includes email (evidence: `clases/captura.php`)
- Payment Capture → Order Confirmation: confirms purchase
- Administrator → Admin Login: signs in (evidence: `loginadmin.php`)
- Administrator → Product Management: manages products (evidence: `crear-producto.php`)
- Administrator → Edit Product: edits products (evidence: `editar-producto.php`)
- Administrator → Delete Product: deletes products
- Administrator → Purchase History: views purchases (evidence: `compras.php`)
- Purchase History → Purchase Detail: opens detail
- Product Management → MySQL Database: accesses (evidence: `crear-producto.php`)
- Edit Product → MySQL Database: accesses (evidence: `editar-producto.php`)
- Save Product → MySQL Database: writes products (evidence: `guardar-producto.php`)
- Delete Product → MySQL Database: accesses
- Purchase History → MySQL Database: accesses (evidence: `compras.php`)
- Purchase Detail → MySQL Database: accesses (evidence: `detalle-compra.php`)
- Purchase Email → PHPMailer: uses (evidence: `clases/enviar_email.php`)
- Purchase Email → SMTP Transport: uses (evidence: `clases/enviar_email.php`)
- Purchase Email → Mailer Exception: uses (evidence: `clases/enviar_email.php`)
- PHPMailer → SMTP Transport: transports mail (evidence: `phpmailer/src/PHPMailer.php`)
- PHPMailer → Mailer Exception: throws (evidence: `phpmailer/src/PHPMailer.php`)
- PHPMailer → OAuth Interface: uses interface (evidence: `phpmailer/src/PHPMailer.php`)
- OAuth Support → OAuth Interface: implements (evidence: `phpmailer/src/OAuth.php`)
- POP3 Support → Mailer Exception: uses (evidence: `phpmailer/src/POP3.php`)
- POP3 Support → PHPMailer: references (evidence: `phpmailer/src/POP3.php`)
- SMTP Transport → OAuth Support: supports auth (evidence: `phpmailer/src/SMTP.php`)
