# hacty/pizzeria_system_pos architecture

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

- Interactive diagram: https://gitdiagram.com/hacty/pizzeria_system_pos
- Repository: https://github.com/hacty/pizzeria_system_pos

## Overview

This is a small Express pizzeria ordering and staff-management web app. Customers can view available products and submit orders; staff-facing routes provide login and dashboard functions for products, categories, employees, customers, and order status. The shown order handler writes active orders to Redis and customer, order, detail, and payment records to SQLite; the order dashboard reads active orders from Redis and history from SQLite. Several route implementations are not excerpted, so their internal behavior and view wiring are not inferred.

Main entry points: [`routes/routes.js`](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/routes.js) (Route mounts), [`db/sqlite.js`](https://github.com/hacty/pizzeria_system_pos/blob/main/db/sqlite.js) (SQLite database), [`routes/pedir.routes.js`](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/pedir.routes.js) (Order entry), [`routes/pedidos.routes.js`](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/pedidos.routes.js) (Order administration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Web routing"]
  node_route_mounts["Route mounts<br/>[routes.js]"]
  node_server["Express server<br/>[express.js]"]
  node_home["Home routes<br/>[start.routes.js]"]
end

subgraph group_orders["Ordering"]
  node_order_entry["Order entry<br/>[pedir.routes.js]"]
  node_order_admin["Order administration<br/>[pedidos.routes.js]"]
end

subgraph group_management["Staff management"]
  node_login["Login and session<br/>[login.routes.js]"]
  node_dashboard["Dashboard routes"]
  node_products["Product management"]
  node_product_create["Product creation"]
  node_categories["Category management"]
  node_employees["Employee management"]
  node_registration["Employee registration<br/>[register.routes.js]"]
  node_customers["Customer management<br/>[clientes.routes.js]"]
end

subgraph group_storage["Persistence"]
  node_sqlite[("SQLite database<br/>[sqlite.js]")]
  node_redis[("Redis client<br/>[redis.js]")]
end

node_visitor(("Visitor"))
node_staff(("Staff user"))

node_server -->|"uses routes"| node_route_mounts
node_route_mounts -->|"mounts"| node_home
node_route_mounts -->|"mounts"| node_login
node_route_mounts -->|"mounts"| node_dashboard
node_route_mounts -->|"mounts"| node_products
node_route_mounts -->|"mounts"| node_product_create
node_route_mounts -->|"mounts"| node_categories
node_route_mounts -->|"mounts"| node_employees
node_route_mounts -->|"mounts"| node_registration
node_route_mounts -->|"mounts"| node_customers
node_route_mounts -->|"mounts"| node_order_entry
node_route_mounts -->|"mounts"| node_order_admin
node_visitor -.->|"requests pages"| node_route_mounts
node_staff -.->|"requests admin"| node_route_mounts
node_login -->|"checks credentials"| node_sqlite
node_products -->|"reads and updates"| node_sqlite
node_product_create -->|"inserts product"| node_sqlite
node_categories -->|"uses database"| node_sqlite
node_employees -->|"manages employees"| node_sqlite
node_registration -->|"inserts employee"| node_sqlite
node_customers -->|"manages customers"| node_sqlite
node_home -->|"uses database"| node_sqlite
node_order_entry -->|"stores order records"| node_sqlite
node_order_entry -->|"stores active order"| node_redis
node_order_admin -->|"reads and updates"| node_redis
node_order_admin -->|"reads history and updates"| node_sqlite

click node_route_mounts "https://github.com/hacty/pizzeria_system_pos/blob/main/routes/routes.js"
click node_server "https://github.com/hacty/pizzeria_system_pos/blob/main/server/express.js"
click node_home "https://github.com/hacty/pizzeria_system_pos/blob/main/routes/start.routes.js"
click node_login "https://github.com/hacty/pizzeria_system_pos/blob/main/routes/login.routes.js"
click node_dashboard "https://github.com/hacty/pizzeria_system_pos/blob/main/routes/dashboard.routes.js"
click node_products "https://github.com/hacty/pizzeria_system_pos/blob/main/routes/productos.routes.js"
click node_product_create "https://github.com/hacty/pizzeria_system_pos/blob/main/routes/agregar_productos.routes.js"
click node_categories "https://github.com/hacty/pizzeria_system_pos/blob/main/routes/categorias.routes.js"
click node_employees "https://github.com/hacty/pizzeria_system_pos/blob/main/routes/empleados.routes.js"
click node_registration "https://github.com/hacty/pizzeria_system_pos/blob/main/routes/register.routes.js"
click node_customers "https://github.com/hacty/pizzeria_system_pos/blob/main/routes/clientes.routes.js"
click node_order_entry "https://github.com/hacty/pizzeria_system_pos/blob/main/routes/pedir.routes.js"
click node_order_admin "https://github.com/hacty/pizzeria_system_pos/blob/main/routes/pedidos.routes.js"
click node_sqlite "https://github.com/hacty/pizzeria_system_pos/blob/main/db/sqlite.js"
click node_redis "https://github.com/hacty/pizzeria_system_pos/blob/main/db/redis.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_route_mounts,node_server,node_home,node_staff toneBlue
class node_order_entry,node_order_admin toneAmber
class node_login,node_dashboard,node_products,node_product_create,node_categories,node_employees,node_registration,node_customers toneMint
class node_sqlite,node_redis toneRose
class node_visitor toneIndigo
```

## Components

### Web routing

- [Route mounts](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/routes.js): `routes/routes.js`
- [Express server](https://github.com/hacty/pizzeria_system_pos/blob/main/server/express.js): `server/express.js`
- [Home routes](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/start.routes.js): `routes/start.routes.js`

### Ordering

- [Order entry](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/pedir.routes.js): `routes/pedir.routes.js`
- [Order administration](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/pedidos.routes.js): `routes/pedidos.routes.js`

### Staff management

- [Login and session](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/login.routes.js): `routes/login.routes.js`
- [Dashboard routes](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/dashboard.routes.js): `routes/dashboard.routes.js`
- [Product management](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/productos.routes.js): `routes/productos.routes.js`
- [Product creation](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/agregar_productos.routes.js): `routes/agregar_productos.routes.js`
- [Category management](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/categorias.routes.js): `routes/categorias.routes.js`
- [Employee management](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/empleados.routes.js): `routes/empleados.routes.js`
- [Employee registration](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/register.routes.js): `routes/register.routes.js`
- [Customer management](https://github.com/hacty/pizzeria_system_pos/blob/main/routes/clientes.routes.js): `routes/clientes.routes.js`

### Persistence

- [SQLite database](https://github.com/hacty/pizzeria_system_pos/blob/main/db/sqlite.js): `db/sqlite.js`
- [Redis client](https://github.com/hacty/pizzeria_system_pos/blob/main/db/redis.js): `db/redis.js`

### Other components

- **Visitor**
- **Staff user**

## Connections

- Express server → Route mounts: uses routes (evidence: `server/express.js`)
- Route mounts → Home routes: mounts (evidence: `routes/routes.js`)
- Route mounts → Login and session: mounts (evidence: `routes/routes.js`)
- Route mounts → Dashboard routes: mounts (evidence: `routes/routes.js`)
- Route mounts → Product management: mounts (evidence: `routes/routes.js`)
- Route mounts → Product creation: mounts (evidence: `routes/routes.js`)
- Route mounts → Category management: mounts (evidence: `routes/routes.js`)
- Route mounts → Employee management: mounts (evidence: `routes/routes.js`)
- Route mounts → Employee registration: mounts (evidence: `routes/routes.js`)
- Route mounts → Customer management: mounts (evidence: `routes/routes.js`)
- Route mounts → Order entry: mounts (evidence: `routes/routes.js`)
- Route mounts → Order administration: mounts (evidence: `routes/routes.js`)
- Visitor → Route mounts: requests pages
- Staff user → Route mounts: requests admin
- Login and session → SQLite database: checks credentials (evidence: `routes/login.routes.js`)
- Product management → SQLite database: reads and updates (evidence: `routes/productos.routes.js`)
- Product creation → SQLite database: inserts product (evidence: `routes/agregar_productos.routes.js`)
- Category management → SQLite database: uses database (evidence: `routes/categorias.routes.js`)
- Employee management → SQLite database: manages employees (evidence: `routes/empleados.routes.js`)
- Employee registration → SQLite database: inserts employee (evidence: `routes/register.routes.js`)
- Customer management → SQLite database: manages customers (evidence: `routes/clientes.routes.js`)
- Home routes → SQLite database: uses database (evidence: `routes/start.routes.js`)
- Order entry → SQLite database: stores order records (evidence: `routes/pedir.routes.js`)
- Order entry → Redis client: stores active order (evidence: `routes/pedir.routes.js`)
- Order administration → Redis client: reads and updates (evidence: `routes/pedidos.routes.js`)
- Order administration → SQLite database: reads history and updates (evidence: `routes/pedidos.routes.js`)
