# cardozoxr/ticketeo architecture

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

- Interactive diagram: https://gitdiagram.com/cardozoxr/ticketeo
- Repository: https://github.com/cardozoxr/ticketeo

## Overview

Ticketeo is a browser-based point-of-sale interface for opening a cashier session and assembling and charging product orders. The visible sales workflow presents catalog items, lets the cashier build and edit a cart, then offers payment choices and a sale-complete screen; the sampled payment flow is UI-only. Category and product data are queried from MySQL-backed PHP classes. Registration posts to an external API, while login validation is only a placeholder. Edges reflect explicit includes, calls, DOM behavior, or the shown fetch; unsampled wiring is omitted.

Main entry points: [`productos.php`](https://github.com/cardozoxr/ticketeo/blob/main/productos.php) (POS page), [`register.php`](https://github.com/cardozoxr/ticketeo/blob/main/register.php) (Register screen), [`scriptRegister.js`](https://github.com/cardozoxr/ticketeo/blob/main/scriptRegister.js) (Registration logic), [`login.php`](https://github.com/cardozoxr/ticketeo/blob/main/login.php) (Login screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sessions["Cashier sessions"]
  node_registration["Register screen<br/>[register.php]"]
  node_registration_logic["Registration logic<br/>[scriptRegister.js]"]
  node_login["Login screen<br/>[login.php]"]
  node_login_logic["PIN handling<br/>[scriptLogin.js]"]
end

subgraph group_catalog["Product catalog"]
  node_category_ui["Category queries"]
  node_category_store["Category data access<br/>[categorias_sp.php]"]
  node_product_ui["Product queries"]
  node_product_store["Product data access<br/>[productos_sp.php]"]
end

subgraph group_sales["Sales flow"]
  node_sales_page["POS page<br/>[productos.php]"]
  node_cart_logic["Cart and order editor<br/>[scriptProductos.js]"]
  node_checkout_logic["Checkout screens<br/>[scriptSistema.js]"]
end

node_cashier(("Cashier"))
node_session_api["Session API"]
node_mysql[("MySQL database")]

node_cashier -->|"starts session"| node_registration
node_registration -->|"loads script"| node_registration_logic
node_registration_logic -->|"posts session"| node_session_api
node_cashier -->|"enters PIN"| node_login
node_login -->|"loads script"| node_login_logic
node_cashier -->|"uses POS"| node_sales_page
node_sales_page -->|"includes"| node_category_ui
node_sales_page -->|"includes"| node_product_ui
node_category_ui -->|"queries categories"| node_category_store
node_product_ui -->|"queries products"| node_product_store
node_category_store -->|"reads categories"| node_mysql
node_product_store -->|"reads products"| node_mysql
node_sales_page -->|"loads script"| node_cart_logic
node_cart_logic -->|"updates order UI"| node_sales_page
node_checkout_logic -.->|"controls checkout UI"| node_sales_page

click node_registration "https://github.com/cardozoxr/ticketeo/blob/main/register.php"
click node_registration_logic "https://github.com/cardozoxr/ticketeo/blob/main/scriptRegister.js"
click node_login "https://github.com/cardozoxr/ticketeo/blob/main/login.php"
click node_login_logic "https://github.com/cardozoxr/ticketeo/blob/main/scriptLogin.js"
click node_sales_page "https://github.com/cardozoxr/ticketeo/blob/main/productos.php"
click node_category_ui "https://github.com/cardozoxr/ticketeo/blob/main/categorias_interfaz.php"
click node_category_store "https://github.com/cardozoxr/ticketeo/blob/main/categorias_sp.php"
click node_product_ui "https://github.com/cardozoxr/ticketeo/blob/main/productos_interfaz.php"
click node_product_store "https://github.com/cardozoxr/ticketeo/blob/main/productos_sp.php"
click node_cart_logic "https://github.com/cardozoxr/ticketeo/blob/main/scriptProductos.js"
click node_checkout_logic "https://github.com/cardozoxr/ticketeo/blob/main/scriptSistema.js"

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_registration,node_registration_logic,node_login,node_login_logic toneBlue
class node_category_ui,node_category_store,node_product_ui,node_product_store,node_mysql toneAmber
class node_sales_page,node_cart_logic,node_checkout_logic,node_session_api toneMint
class node_cashier toneIndigo
```

## Components

### Cashier sessions

- [Register screen](https://github.com/cardozoxr/ticketeo/blob/main/register.php): `register.php`
- [Registration logic](https://github.com/cardozoxr/ticketeo/blob/main/scriptRegister.js): `scriptRegister.js`
- [Login screen](https://github.com/cardozoxr/ticketeo/blob/main/login.php): `login.php`
- [PIN handling](https://github.com/cardozoxr/ticketeo/blob/main/scriptLogin.js): `scriptLogin.js`

### Product catalog

- [Category queries](https://github.com/cardozoxr/ticketeo/blob/main/categorias_interfaz.php): `categorias_interfaz.php`
- [Category data access](https://github.com/cardozoxr/ticketeo/blob/main/categorias_sp.php): `categorias_sp.php`
- [Product queries](https://github.com/cardozoxr/ticketeo/blob/main/productos_interfaz.php): `productos_interfaz.php`
- [Product data access](https://github.com/cardozoxr/ticketeo/blob/main/productos_sp.php): `productos_sp.php`

### Sales flow

- [POS page](https://github.com/cardozoxr/ticketeo/blob/main/productos.php): `productos.php`
- [Cart and order editor](https://github.com/cardozoxr/ticketeo/blob/main/scriptProductos.js): `scriptProductos.js`
- [Checkout screens](https://github.com/cardozoxr/ticketeo/blob/main/scriptSistema.js): `scriptSistema.js`

### Other components

- **Cashier**
- **Session API**
- **MySQL database**

## Connections

- Cashier → Register screen: starts session (evidence: `register.php`)
- Register screen → Registration logic: loads script (evidence: `register.php`)
- Registration logic → Session API: posts session (evidence: `scriptRegister.js`)
- Cashier → Login screen: enters PIN (evidence: `login.php`)
- Login screen → PIN handling: loads script (evidence: `login.php`)
- Cashier → POS page: uses POS (evidence: `productos.php`)
- POS page → Category queries: includes (evidence: `productos.php`)
- POS page → Product queries: includes (evidence: `productos.php`)
- Category queries → Category data access: queries categories (evidence: `categorias_interfaz.php`)
- Product queries → Product data access: queries products (evidence: `productos_interfaz.php`)
- Category data access → MySQL database: reads categories (evidence: `categorias_sp.php`)
- Product data access → MySQL database: reads products (evidence: `productos_sp.php`)
- POS page → Cart and order editor: loads script (evidence: `productos.php`)
- Cart and order editor → POS page: updates order UI (evidence: `scriptProductos.js`)
- Checkout screens → POS page: controls checkout UI
