# yants02/proyecto_final_front-back architecture

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

- Interactive diagram: https://gitdiagram.com/yants02/proyecto_final_front-back
- Repository: https://github.com/yants02/proyecto_final_front-back

## Overview

Front_Back_2026 is a PHP inventory and sales management application with a public landing page, login and registration, and a logged-in administration panel for managing business records. Its main workflow is user authentication, followed by CRUD operations on clients, products, suppliers, purchases, sales, and users; the project also documents PDF and spreadsheet exports. The source index confirms database-backed CRUD and identifies export, PDF, and email components. Several routes and wiring details were not sampled, so their relationships are omitted or marked unverified.

Main entry points: [`index.php`](https://github.com/yants02/proyecto_final_front-back/blob/main/index.php) (Admin dashboard), [`php/config/conexion.php`](https://github.com/yants02/proyecto_final_front-back/blob/main/php/config/conexion.php) (MySQL database), [`php/acciones`](https://github.com/yants02/proyecto_final_front-back/tree/main/php/acciones) (Session actions), [`php/crud/clientes`](https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/clientes) (Client records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Site and access"]
  node_landing["Public landing<br/>[onepage.php]"]
  node_login["Login and registration<br/>[login.php]"]
  node_auth["Session actions"]
  node_dashboard["Admin dashboard<br/>[index.php]"]
end

subgraph group_records["Record management"]
  node_clients["Client records"]
  node_products["Product records"]
  node_suppliers["Supplier records"]
  node_purchases["Purchase records"]
  node_sales["Sales records"]
  node_users["User records"]
end

subgraph group_outputs["Reports and exports"]
  node_pdf["PDF documents"]
  node_excel["Spreadsheet export<br/>[exportar_excel.php]"]
  node_reports["Report generation"]
end

subgraph group_services["Shared services"]
  node_access["Admin access check"]
  node_database[("MySQL database<br/>[conexion.php]")]
  node_contact["Contact mailer"]
  node_mailer["PHPMailer<br/>[PHPMailer.php]"]
  node_tcpdf["TCPDF library<br/>[tcpdf.php]"]
end

node_visitor(("Visitor"))

node_visitor -.->|"visits"| node_landing
node_visitor -.->|"authenticates"| node_login
node_login -.->|"submits credentials"| node_auth
node_auth -.->|"reads or writes"| node_database
node_auth -.->|"opens session"| node_dashboard
node_dashboard -->|"manages records"| node_clients
node_dashboard -->|"manages records"| node_products
node_dashboard -->|"manages records"| node_suppliers
node_dashboard -->|"manages records"| node_purchases
node_dashboard -->|"manages records"| node_sales
node_dashboard -->|"manages records"| node_users
node_clients -->|"queries and updates"| node_database
node_products -.->|"reads and writes"| node_database
node_suppliers -.->|"reads and writes"| node_database
node_purchases -.->|"reads and writes"| node_database
node_sales -.->|"reads and writes"| node_database
node_users -.->|"reads and writes"| node_database
node_dashboard -->|"requests PDF"| node_pdf
node_purchases -.->|"creates documents"| node_pdf
node_pdf -.->|"renders PDF"| node_tcpdf
node_dashboard -->|"exports data"| node_excel
node_clients -->|"offers CSV export"| node_excel
node_dashboard -.->|"requests report"| node_reports
node_visitor -.->|"sends contact form"| node_contact
node_contact -->|"sends email"| node_mailer

click node_landing "https://github.com/yants02/proyecto_final_front-back/blob/main/onepage.php"
click node_login "https://github.com/yants02/proyecto_final_front-back/blob/main/login.php"
click node_auth "https://github.com/yants02/proyecto_final_front-back/tree/main/php/acciones"
click node_dashboard "https://github.com/yants02/proyecto_final_front-back/blob/main/index.php"
click node_access "https://github.com/yants02/proyecto_final_front-back/blob/main/php/config/verificar_administrador.php"
click node_clients "https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/clientes"
click node_products "https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/productos"
click node_suppliers "https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/proveedores"
click node_purchases "https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/compras"
click node_sales "https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/ventas"
click node_users "https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/usuarios"
click node_database "https://github.com/yants02/proyecto_final_front-back/blob/main/php/config/conexion.php"
click node_pdf "https://github.com/yants02/proyecto_final_front-back/blob/main/php/acciones/generar_orden_compra.php"
click node_excel "https://github.com/yants02/proyecto_final_front-back/blob/main/php/acciones/exportar_excel.php"
click node_reports "https://github.com/yants02/proyecto_final_front-back/blob/main/php/acciones/generar_reporte.php"
click node_contact "https://github.com/yants02/proyecto_final_front-back/blob/main/php/acciones/enviar_contacto.php"
click node_mailer "https://github.com/yants02/proyecto_final_front-back/blob/main/php/includes/PHPMailer/PHPMailer.php"
click node_tcpdf "https://github.com/yants02/proyecto_final_front-back/blob/main/php/includes/tcpdf/tcpdf.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_landing,node_login,node_auth,node_dashboard toneBlue
class node_clients,node_products,node_suppliers,node_purchases,node_sales,node_users toneAmber
class node_pdf,node_excel,node_reports toneMint
class node_access,node_database,node_contact,node_mailer,node_tcpdf toneRose
class node_visitor toneIndigo
```

## Components

### Site and access

- [Public landing](https://github.com/yants02/proyecto_final_front-back/blob/main/onepage.php): `onepage.php`
- [Login and registration](https://github.com/yants02/proyecto_final_front-back/blob/main/login.php): `login.php`
- [Session actions](https://github.com/yants02/proyecto_final_front-back/tree/main/php/acciones): `php/acciones`
- [Admin dashboard](https://github.com/yants02/proyecto_final_front-back/blob/main/index.php): `index.php`

### Record management

- [Client records](https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/clientes): `php/crud/clientes`
- [Product records](https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/productos): `php/crud/productos`
- [Supplier records](https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/proveedores): `php/crud/proveedores`
- [Purchase records](https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/compras): `php/crud/compras`
- [Sales records](https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/ventas): `php/crud/ventas`
- [User records](https://github.com/yants02/proyecto_final_front-back/tree/main/php/crud/usuarios): `php/crud/usuarios`

### Reports and exports

- [PDF documents](https://github.com/yants02/proyecto_final_front-back/blob/main/php/acciones/generar_orden_compra.php): `php/acciones/generar_orden_compra.php`
- [Spreadsheet export](https://github.com/yants02/proyecto_final_front-back/blob/main/php/acciones/exportar_excel.php): `php/acciones/exportar_excel.php`
- [Report generation](https://github.com/yants02/proyecto_final_front-back/blob/main/php/acciones/generar_reporte.php): `php/acciones/generar_reporte.php`

### Shared services

- [Admin access check](https://github.com/yants02/proyecto_final_front-back/blob/main/php/config/verificar_administrador.php): `php/config/verificar_administrador.php`
- [MySQL database](https://github.com/yants02/proyecto_final_front-back/blob/main/php/config/conexion.php): `php/config/conexion.php`
- [Contact mailer](https://github.com/yants02/proyecto_final_front-back/blob/main/php/acciones/enviar_contacto.php): `php/acciones/enviar_contacto.php`
- [PHPMailer](https://github.com/yants02/proyecto_final_front-back/blob/main/php/includes/PHPMailer/PHPMailer.php): `php/includes/PHPMailer/PHPMailer.php`
- [TCPDF library](https://github.com/yants02/proyecto_final_front-back/blob/main/php/includes/tcpdf/tcpdf.php): `php/includes/tcpdf/tcpdf.php`

### Other components

- **Visitor**

## Connections

- Visitor → Public landing: visits
- Visitor → Login and registration: authenticates
- Login and registration → Session actions: submits credentials
- Session actions → MySQL database: reads or writes (evidence: `php/acciones/generar_orden_compra.php`)
- Session actions → Admin dashboard: opens session
- Admin dashboard → Client records: manages records
- Admin dashboard → Product records: manages records
- Admin dashboard → Supplier records: manages records
- Admin dashboard → Purchase records: manages records
- Admin dashboard → Sales records: manages records
- Admin dashboard → User records: manages records
- Client records → MySQL database: queries and updates (evidence: `php/crud/clientes/clientes.php`)
- Product records → MySQL database: reads and writes (evidence: `php/crud/productos/productos.php`)
- Supplier records → MySQL database: reads and writes (evidence: `php/crud/proveedores/proveedores.php`)
- Purchase records → MySQL database: reads and writes (evidence: `php/crud/compras/guardar_compra.php`)
- Sales records → MySQL database: reads and writes (evidence: `php/crud/ventas/guardar_venta.php`)
- User records → MySQL database: reads and writes (evidence: `php/crud/usuarios/usuarios.php`)
- Admin dashboard → PDF documents: requests PDF
- Purchase records → PDF documents: creates documents
- PDF documents → TCPDF library: renders PDF (evidence: `php/acciones/generar_orden_compra.php`)
- Admin dashboard → Spreadsheet export: exports data
- Client records → Spreadsheet export: offers CSV export (evidence: `php/crud/clientes/clientes.php`)
- Admin dashboard → Report generation: requests report
- Visitor → Contact mailer: sends contact form
- Contact mailer → PHPMailer: sends email (evidence: `php/acciones/enviar_contacto.php`)
