# senasaintkofs/sk_pos architecture

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

- Interactive diagram: https://gitdiagram.com/senasaintkofs/sk_pos
- Repository: https://github.com/senasaintkofs/sk_pos

## Overview

SKPOS is a web POS for microcommerce, with an Angular client and PHP API backed by MySQL. The main workflow is staff authentication, then sales entry: select products and a customer, build a cart, take payment, and record the sale; inventory and dashboard reporting are supporting capabilities. The application also manages products, categories, customers/users, and supplier orders. The README documents these product capabilities, but many controller and service implementations were not excerpted, so uncertain client-to-endpoint links are shown as unverified rather than asserted.

Main entry points: [`frontend/src/app/app.routes.ts`](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/app.routes.ts) (App routes), [`frontend/src/app/servicios`](https://github.com/senasaintkofs/sk_pos/tree/deploy/frontend/src/app/servicios) (Angular API services), [`backend/controlador`](https://github.com/senasaintkofs/sk_pos/tree/deploy/backend/controlador) (PHP controllers), [`backend/modelo/conexion.php`](https://github.com/senasaintkofs/sk_pos/blob/deploy/backend/modelo/conexion.php) (MySQL connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
end

subgraph group_access["Access and navigation"]
  node_app["Angular app<br/>[app.ts]"]
  node_routes["App routes<br/>[app.routes.ts]"]
  node_login_view["Login screen<br/>[login.ts]"]
  node_auth_guard["User guard"]
  node_shell["Main shell<br/>[main.ts]"]
end

subgraph group_operations["POS operations"]
  node_dashboard_ui["Dashboard<br/>[dashboard.ts]"]
  node_sales_ui["Sales checkout<br/>[ventas.ts]"]
  node_products_ui["Product catalog<br/>[productos.ts]"]
  node_categories_ui["Categories<br/>[categorias.ts]"]
  node_orders_ui["Supplier orders<br/>[pedidos.ts]"]
  node_customers_ui["Customer records<br/>[clientes.ts]"]
  node_users_ui["User management<br/>[usuarios.ts]"]
end

subgraph group_server["PHP API and data"]
  node_api_config["API configuration<br/>[api.ts]"]
  node_services["Angular API services"]
  node_php_api["PHP controllers"]
  node_cors["CORS policy<br/>[cors.php]"]
  node_models["Domain models"]
  node_sales_model["Sales and detail models<br/>[venta.php]"]
  node_product_model["Product model<br/>[producto.php]"]
  node_user_model["User model<br/>[usuario.php]"]
  node_db_connection[("MySQL connection<br/>[conexion.php]")]
end

node_operator(("POS user"))
node_mysql[("MySQL database")]

node_operator -->|"signs in"| node_login_view
node_app -->|"provides routes"| node_routes
node_routes -->|"routes to"| node_login_view
node_routes -->|"routes to"| node_shell
node_routes -->|"routes to"| node_dashboard_ui
node_routes -->|"routes to"| node_sales_ui
node_routes -->|"routes to"| node_products_ui
node_routes -->|"routes to"| node_categories_ui
node_routes -->|"routes to"| node_orders_ui
node_routes -->|"routes to"| node_customers_ui
node_routes -->|"routes to"| node_users_ui
node_routes -->|"guards pages"| node_auth_guard
node_sales_ui -->|"uses services"| node_services
node_dashboard_ui -->|"uses services"| node_services
node_customers_ui -->|"uses service"| node_services
node_products_ui -->|"uses services"| node_services
node_orders_ui -->|"uses service"| node_services
node_users_ui -->|"uses service"| node_services
node_services -->|"reads base URL"| node_api_config
node_services -.->|"calls API"| node_php_api
node_php_api -->|"includes policy"| node_cors
node_php_api -->|"dispatches actions"| node_product_model
node_php_api -->|"dispatches actions"| node_user_model
node_php_api -.->|"dispatches actions"| node_sales_model
node_php_api -.->|"uses domain models"| node_models
node_php_api -->|"loads connection"| node_db_connection
node_product_model -.->|"queries through"| node_db_connection
node_user_model -.->|"queries through"| node_db_connection
node_sales_model -.->|"queries through"| node_db_connection
node_db_connection -->|"connects to"| node_mysql

click node_app "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/app.ts"
click node_routes "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/app.routes.ts"
click node_login_view "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/estructura/login/login.ts"
click node_auth_guard "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/guardian/validar-usuario-guard.ts"
click node_shell "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/estructura/main.ts"
click node_dashboard_ui "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/dashboard/dashboard.ts"
click node_sales_ui "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/ventas/ventas.ts"
click node_products_ui "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/productos/productos.ts"
click node_categories_ui "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/categorias/categorias.ts"
click node_orders_ui "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/pedidos/pedidos.ts"
click node_customers_ui "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/clientes/clientes.ts"
click node_users_ui "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/usuarios/usuarios.ts"
click node_api_config "https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/config/api.ts"
click node_services "https://github.com/senasaintkofs/sk_pos/tree/deploy/frontend/src/app/servicios"
click node_php_api "https://github.com/senasaintkofs/sk_pos/tree/deploy/backend/controlador"
click node_cors "https://github.com/senasaintkofs/sk_pos/blob/deploy/backend/controlador/config/cors.php"
click node_models "https://github.com/senasaintkofs/sk_pos/tree/deploy/backend/modelo"
click node_sales_model "https://github.com/senasaintkofs/sk_pos/blob/deploy/backend/modelo/venta.php"
click node_product_model "https://github.com/senasaintkofs/sk_pos/blob/deploy/backend/modelo/producto.php"
click node_user_model "https://github.com/senasaintkofs/sk_pos/blob/deploy/backend/modelo/usuario.php"
click node_db_connection "https://github.com/senasaintkofs/sk_pos/blob/deploy/backend/modelo/conexion.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_app,node_routes,node_login_view,node_auth_guard,node_shell,node_mysql toneAmber
class node_dashboard_ui,node_sales_ui,node_products_ui,node_categories_ui,node_orders_ui,node_customers_ui,node_users_ui toneMint
class node_api_config,node_services,node_php_api,node_cors,node_models,node_sales_model,node_product_model,node_user_model,node_db_connection toneRose
class node_operator toneBlue
```

## Components

### Access and navigation

- [Angular app](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/app.ts): `frontend/src/app/app.ts`
- [App routes](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/app.routes.ts): `frontend/src/app/app.routes.ts`
- [Login screen](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/estructura/login/login.ts): `frontend/src/app/estructura/login/login.ts`
- [User guard](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/guardian/validar-usuario-guard.ts): `frontend/src/app/guardian/validar-usuario-guard.ts`
- [Main shell](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/estructura/main.ts): `frontend/src/app/estructura/main.ts`

### POS operations

- [Dashboard](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/dashboard/dashboard.ts): `frontend/src/app/modulos/dashboard/dashboard.ts`
- [Sales checkout](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/ventas/ventas.ts): `frontend/src/app/modulos/ventas/ventas.ts`
- [Product catalog](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/productos/productos.ts): `frontend/src/app/modulos/productos/productos.ts`
- [Categories](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/categorias/categorias.ts): `frontend/src/app/modulos/categorias/categorias.ts`
- [Supplier orders](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/pedidos/pedidos.ts): `frontend/src/app/modulos/pedidos/pedidos.ts`
- [Customer records](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/clientes/clientes.ts): `frontend/src/app/modulos/clientes/clientes.ts`
- [User management](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/modulos/usuarios/usuarios.ts): `frontend/src/app/modulos/usuarios/usuarios.ts`

### PHP API and data

- [API configuration](https://github.com/senasaintkofs/sk_pos/blob/deploy/frontend/src/app/config/api.ts): `frontend/src/app/config/api.ts`
- [Angular API services](https://github.com/senasaintkofs/sk_pos/tree/deploy/frontend/src/app/servicios): `frontend/src/app/servicios`
- [PHP controllers](https://github.com/senasaintkofs/sk_pos/tree/deploy/backend/controlador): `backend/controlador`
- [CORS policy](https://github.com/senasaintkofs/sk_pos/blob/deploy/backend/controlador/config/cors.php): `backend/controlador/config/cors.php`
- [Domain models](https://github.com/senasaintkofs/sk_pos/tree/deploy/backend/modelo): `backend/modelo`
- [Sales and detail models](https://github.com/senasaintkofs/sk_pos/blob/deploy/backend/modelo/venta.php): `backend/modelo/venta.php`
- [Product model](https://github.com/senasaintkofs/sk_pos/blob/deploy/backend/modelo/producto.php): `backend/modelo/producto.php`
- [User model](https://github.com/senasaintkofs/sk_pos/blob/deploy/backend/modelo/usuario.php): `backend/modelo/usuario.php`
- [MySQL connection](https://github.com/senasaintkofs/sk_pos/blob/deploy/backend/modelo/conexion.php): `backend/modelo/conexion.php`

### Other components

- **POS user**
- **MySQL database**

## Connections

- POS user → Login screen: signs in (evidence: `README.md`)
- Angular app → App routes: provides routes
- App routes → Login screen: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Main shell: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Dashboard: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Sales checkout: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Product catalog: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Categories: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Supplier orders: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Customer records: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → User management: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → User guard: guards pages (evidence: `frontend/src/app/app.routes.ts`)
- Sales checkout → Angular API services: uses services (evidence: `frontend/src/app/modulos/ventas/ventas.ts`)
- Dashboard → Angular API services: uses services (evidence: `frontend/src/app/modulos/dashboard/dashboard.ts`)
- Customer records → Angular API services: uses service (evidence: `frontend/src/app/modulos/clientes/clientes.ts`)
- Product catalog → Angular API services: uses services (evidence: `frontend/src/app/modulos/productos/productos.ts`)
- Supplier orders → Angular API services: uses service (evidence: `frontend/src/app/modulos/pedidos/pedidos.ts`)
- User management → Angular API services: uses service (evidence: `frontend/src/app/modulos/usuarios/usuarios.ts`)
- Angular API services → API configuration: reads base URL (evidence: `frontend/src/app/servicios/producto.ts`)
- Angular API services → PHP controllers: calls API
- PHP controllers → CORS policy: includes policy (evidence: `backend/controlador/detalleVenta.php`)
- PHP controllers → Product model: dispatches actions (evidence: `backend/controlador/producto.php`)
- PHP controllers → User model: dispatches actions (evidence: `backend/controlador/usuario.php`)
- PHP controllers → Sales and detail models: dispatches actions
- PHP controllers → Domain models: uses domain models (evidence: `backend/controlador/detalleVenta.php`)
- PHP controllers → MySQL connection: loads connection (evidence: `backend/controlador/producto.php`)
- Product model → MySQL connection: queries through
- User model → MySQL connection: queries through
- Sales and detail models → MySQL connection: queries through
- MySQL connection → MySQL database: connects to (evidence: `backend/modelo/conexion.php`)
