# ascriscorp/scl-sauco architecture

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

- Interactive diagram: https://gitdiagram.com/ascriscorp/scl-sauco
- Repository: https://github.com/ascriscorp/scl-sauco

## Overview

SCL-SAUCO is a PHP business-management application with login-gated pages for users, suppliers, companies, and purchase orders. Requests enter through the page router or module-specific AJAX endpoints; controllers handle domain operations and models persist data through a shared database layer. The interface also exposes purchase-order reporting capabilities, including invoice generation. Source evidence is incomplete: several modules and views were not sampled, and the README is empty, so undocumented connections are omitted.

Main entry points: [`views/plantilla.php`](https://github.com/ascriscorp/scl-sauco/blob/main/views/plantilla.php) (Page template), [`models/mainModel.php`](https://github.com/ascriscorp/scl-sauco/blob/main/models/mainModel.php) (Shared data layer), [`controller/ordenCompraControlador.php`](https://github.com/ascriscorp/scl-sauco/blob/main/controller/ordenCompraControlador.php) (Purchase-order operations), [`index.php`](https://github.com/ascriscorp/scl-sauco/blob/main/index.php) (Front controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Web interface"]
  node_template["Page template<br/>[plantilla.php]"]
  node_navigation["Navigation<br/>[NavLateral.php]"]
  node_domain_views["Domain pages"]
end

subgraph group_requests["Request handling"]
  node_entry["Front controller<br/>[index.php]"]
  node_router["View router"]
  node_ajax_search["Search endpoint<br/>[buscadorAjax.php]"]
  node_ajax_company["Company endpoint<br/>[empresaAjax.php]"]
  node_ajax_orders["Purchase-order endpoint"]
  node_ajax_suppliers["Supplier endpoint<br/>[proveedorAjax.php]"]
  node_ajax_users["User endpoint<br/>[usuarioAjax.php]"]
end

subgraph group_domain["Business operations"]
  node_login["Login handling"]
  node_company["Company operations"]
  node_orders["Purchase-order operations"]
  node_suppliers["Supplier operations"]
  node_users["User operations"]
end

subgraph group_data["Persistence and reports"]
  node_login_model["Login model<br/>[loginModelo.php]"]
  node_company_model["Company model<br/>[empresaModelo.php]"]
  node_orders_model["Purchase-order model"]
  node_supplier_model["Supplier model"]
  node_user_model["User model<br/>[usuarioModelo.php]"]
  node_shared_model["Shared data layer<br/>[mainModel.php]"]
  node_database_config["Database configuration<br/>[SERVER.php]"]
  node_invoice["Invoice generator<br/>[invoice.php]"]
  node_pdf["PDF engine<br/>[fpdf.php]"]
end

node_user(("Staff user"))
node_database[("MySQL database")]

node_user -->|"opens application"| node_entry
node_entry -->|"loads router"| node_router
node_router -->|"loads template"| node_template
node_template -->|"checks session"| node_login
node_template -->|"includes navigation"| node_navigation
node_template -->|"includes selected page"| node_domain_views
node_template -.->|"uses login controller"| node_login_model
node_ajax_company -->|"dispatches to"| node_company
node_ajax_orders -->|"dispatches to"| node_orders
node_ajax_suppliers -->|"dispatches to"| node_suppliers
node_ajax_users -->|"dispatches to"| node_users
node_company -->|"uses model"| node_company_model
node_orders -->|"uses model"| node_orders_model
node_suppliers -->|"uses model"| node_supplier_model
node_users -->|"uses model"| node_user_model
node_company_model -->|"extends shared layer"| node_shared_model
node_supplier_model -->|"extends shared layer"| node_shared_model
node_user_model -->|"extends shared layer"| node_shared_model
node_shared_model -->|"loads configuration"| node_database_config
node_shared_model -->|"opens PDO connection"| node_database
node_invoice -->|"uses PDF engine"| node_pdf
node_orders -.->|"may generate invoice"| node_invoice
node_ajax_search -->|"stores search filters"| node_user

click node_entry "https://github.com/ascriscorp/scl-sauco/blob/main/index.php"
click node_router "https://github.com/ascriscorp/scl-sauco/blob/main/controller/viewsControllers.php"
click node_template "https://github.com/ascriscorp/scl-sauco/blob/main/views/plantilla.php"
click node_navigation "https://github.com/ascriscorp/scl-sauco/blob/main/views/inc/NavLateral.php"
click node_domain_views "https://github.com/ascriscorp/scl-sauco/tree/main/views/contenidos"
click node_login "https://github.com/ascriscorp/scl-sauco/blob/main/controller/loginControlador.php"
click node_login_model "https://github.com/ascriscorp/scl-sauco/blob/main/models/loginModelo.php"
click node_ajax_search "https://github.com/ascriscorp/scl-sauco/blob/main/ajax/buscadorAjax.php"
click node_ajax_company "https://github.com/ascriscorp/scl-sauco/blob/main/ajax/empresaAjax.php"
click node_ajax_orders "https://github.com/ascriscorp/scl-sauco/blob/main/ajax/orndeCompraAjax.php"
click node_ajax_suppliers "https://github.com/ascriscorp/scl-sauco/blob/main/ajax/proveedorAjax.php"
click node_ajax_users "https://github.com/ascriscorp/scl-sauco/blob/main/ajax/usuarioAjax.php"
click node_company "https://github.com/ascriscorp/scl-sauco/blob/main/controller/empresaControlador.php"
click node_orders "https://github.com/ascriscorp/scl-sauco/blob/main/controller/ordenCompraControlador.php"
click node_suppliers "https://github.com/ascriscorp/scl-sauco/blob/main/controller/proveedorControlador.php"
click node_users "https://github.com/ascriscorp/scl-sauco/blob/main/controller/usuarioControlador.php"
click node_company_model "https://github.com/ascriscorp/scl-sauco/blob/main/models/empresaModelo.php"
click node_orders_model "https://github.com/ascriscorp/scl-sauco/blob/main/models/ordenCompraModelo.php"
click node_supplier_model "https://github.com/ascriscorp/scl-sauco/blob/main/models/proveedorModelo.php"
click node_user_model "https://github.com/ascriscorp/scl-sauco/blob/main/models/usuarioModelo.php"
click node_shared_model "https://github.com/ascriscorp/scl-sauco/blob/main/models/mainModel.php"
click node_database_config "https://github.com/ascriscorp/scl-sauco/blob/main/config/SERVER.php"
click node_invoice "https://github.com/ascriscorp/scl-sauco/blob/main/reportes/invoice.php"
click node_pdf "https://github.com/ascriscorp/scl-sauco/blob/main/reportes/fpdf.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_template,node_navigation,node_domain_views,node_user toneBlue
class node_entry,node_router,node_ajax_search,node_ajax_company,node_ajax_orders,node_ajax_suppliers,node_ajax_users,node_database toneAmber
class node_login,node_company,node_orders,node_suppliers,node_users toneMint
class node_login_model,node_company_model,node_orders_model,node_supplier_model,node_user_model,node_shared_model,node_database_config,node_invoice,node_pdf toneRose
```

## Components

### Web interface

- [Page template](https://github.com/ascriscorp/scl-sauco/blob/main/views/plantilla.php): `views/plantilla.php`
- [Navigation](https://github.com/ascriscorp/scl-sauco/blob/main/views/inc/NavLateral.php): `views/inc/NavLateral.php`
- [Domain pages](https://github.com/ascriscorp/scl-sauco/tree/main/views/contenidos): `views/contenidos`

### Request handling

- [Front controller](https://github.com/ascriscorp/scl-sauco/blob/main/index.php): `index.php`
- [View router](https://github.com/ascriscorp/scl-sauco/blob/main/controller/viewsControllers.php): `controller/viewsControllers.php`
- [Search endpoint](https://github.com/ascriscorp/scl-sauco/blob/main/ajax/buscadorAjax.php): `ajax/buscadorAjax.php`
- [Company endpoint](https://github.com/ascriscorp/scl-sauco/blob/main/ajax/empresaAjax.php): `ajax/empresaAjax.php`
- [Purchase-order endpoint](https://github.com/ascriscorp/scl-sauco/blob/main/ajax/orndeCompraAjax.php): `ajax/orndeCompraAjax.php`
- [Supplier endpoint](https://github.com/ascriscorp/scl-sauco/blob/main/ajax/proveedorAjax.php): `ajax/proveedorAjax.php`
- [User endpoint](https://github.com/ascriscorp/scl-sauco/blob/main/ajax/usuarioAjax.php): `ajax/usuarioAjax.php`

### Business operations

- [Login handling](https://github.com/ascriscorp/scl-sauco/blob/main/controller/loginControlador.php): `controller/loginControlador.php`
- [Company operations](https://github.com/ascriscorp/scl-sauco/blob/main/controller/empresaControlador.php): `controller/empresaControlador.php`
- [Purchase-order operations](https://github.com/ascriscorp/scl-sauco/blob/main/controller/ordenCompraControlador.php): `controller/ordenCompraControlador.php`
- [Supplier operations](https://github.com/ascriscorp/scl-sauco/blob/main/controller/proveedorControlador.php): `controller/proveedorControlador.php`
- [User operations](https://github.com/ascriscorp/scl-sauco/blob/main/controller/usuarioControlador.php): `controller/usuarioControlador.php`

### Persistence and reports

- [Login model](https://github.com/ascriscorp/scl-sauco/blob/main/models/loginModelo.php): `models/loginModelo.php`
- [Company model](https://github.com/ascriscorp/scl-sauco/blob/main/models/empresaModelo.php): `models/empresaModelo.php`
- [Purchase-order model](https://github.com/ascriscorp/scl-sauco/blob/main/models/ordenCompraModelo.php): `models/ordenCompraModelo.php`
- [Supplier model](https://github.com/ascriscorp/scl-sauco/blob/main/models/proveedorModelo.php): `models/proveedorModelo.php`
- [User model](https://github.com/ascriscorp/scl-sauco/blob/main/models/usuarioModelo.php): `models/usuarioModelo.php`
- [Shared data layer](https://github.com/ascriscorp/scl-sauco/blob/main/models/mainModel.php): `models/mainModel.php`
- [Database configuration](https://github.com/ascriscorp/scl-sauco/blob/main/config/SERVER.php): `config/SERVER.php`
- [Invoice generator](https://github.com/ascriscorp/scl-sauco/blob/main/reportes/invoice.php): `reportes/invoice.php`
- [PDF engine](https://github.com/ascriscorp/scl-sauco/blob/main/reportes/fpdf.php): `reportes/fpdf.php`

### Other components

- **Staff user**
- **MySQL database**

## Connections

- Staff user → Front controller: opens application (evidence: `index.php`)
- Front controller → View router: loads router (evidence: `index.php`)
- View router → Page template: loads template (evidence: `controller/viewsControllers.php`)
- Page template → Login handling: checks session (evidence: `views/plantilla.php`)
- Page template → Navigation: includes navigation (evidence: `views/plantilla.php`)
- Page template → Domain pages: includes selected page (evidence: `views/plantilla.php`)
- Page template → Login model: uses login controller
- Company endpoint → Company operations: dispatches to (evidence: `ajax/empresaAjax.php`)
- Purchase-order endpoint → Purchase-order operations: dispatches to (evidence: `ajax/orndeCompraAjax.php`)
- Supplier endpoint → Supplier operations: dispatches to (evidence: `ajax/proveedorAjax.php`)
- User endpoint → User operations: dispatches to (evidence: `ajax/usuarioAjax.php`)
- Company operations → Company model: uses model (evidence: `controller/empresaControlador.php`)
- Purchase-order operations → Purchase-order model: uses model (evidence: `controller/ordenCompraControlador.php`)
- Supplier operations → Supplier model: uses model (evidence: `controller/proveedorControlador.php`)
- User operations → User model: uses model (evidence: `controller/usuarioControlador.php`)
- Company model → Shared data layer: extends shared layer (evidence: `models/empresaModelo.php`)
- Supplier model → Shared data layer: extends shared layer (evidence: `models/proveedorModelo.php`)
- User model → Shared data layer: extends shared layer (evidence: `models/usuarioModelo.php`)
- Shared data layer → Database configuration: loads configuration (evidence: `models/mainModel.php`)
- Shared data layer → MySQL database: opens PDO connection (evidence: `models/mainModel.php`)
- Invoice generator → PDF engine: uses PDF engine (evidence: `reportes/invoice.php`)
- Purchase-order operations → Invoice generator: may generate invoice
- Search endpoint → Staff user: stores search filters (evidence: `ajax/buscadorAjax.php`)
