# diegoestebanperezmejia/soniweb architecture

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

- Interactive diagram: https://gitdiagram.com/diegoestebanperezmejia/soniweb
- Repository: https://github.com/diegoestebanperezmejia/soniweb

## Overview

SoniClothes is a multi-role clothing storefront and point-of-sale application for customers, suppliers, and administrators. The customer flow covers account access, browsing and cart changes, payment requests, and purchase history; supplier and administrator workflows include product proposals, review, access decisions, and sales reporting. The graph includes the documented UI areas and the server-side modules that implement those capabilities. Evidence is limited to the supplied excerpts and source index; connections from browser scripts to API routes are therefore not asserted.

Main entry points: [`servidor.js`](https://github.com/diegoestebanperezmejia/soniweb/blob/main/servidor.js) (Express application), [`netlify/server/index.mjs`](https://github.com/diegoestebanperezmejia/soniweb/blob/main/netlify/server/index.mjs) (Netlify runtime adapter), [`tienda.js`](https://github.com/diegoestebanperezmejia/soniweb/blob/main/tienda.js) (Catalog and checkout), [`base.js`](https://github.com/diegoestebanperezmejia/soniweb/blob/main/base.js) (Database access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Storefront and portals"]
  node_customer["Customer storefront<br/>[tienda.js]"]
  node_catalog_ui["Product catalog UI"]
  node_login_ui["Login and registration UI<br/>[login.js]"]
  node_customer_portal["Customer portal<br/>[portal.js]"]
  node_supplier_portal["Supplier portal<br/>[proveedor.html]"]
  node_admin_ui["Admin console<br/>[administracion.js]"]
end

subgraph group_server["Application services"]
  node_http_server["Express application<br/>[servidor.js]"]
  node_auth["Authentication policies<br/>[acceso.js]"]
  node_registration["Account registration<br/>[registro.js]"]
  node_store["Catalog and checkout<br/>[tienda.js]"]
  node_catalog_doc["Word catalog export<br/>[catalogo-word.js]"]
  node_photos["Product photos<br/>[fotos.js]"]
end

subgraph group_data["Data and sessions"]
  node_database[("Database access<br/>[base.js]")]
  node_session_store[("Persistent sessions<br/>[sesiones.mjs]")]
  node_session_schema["Session table schema<br/>[schema.ts]"]
  node_netlify_runtime["Netlify runtime adapter<br/>[index.mjs]"]
end

subgraph group_ops["Supplier and admin operations"]
  node_review["Product review<br/>[revision.js]"]
  node_permissions["Supplier permissions<br/>[permisos.js]"]
  node_reporting["Sales reports<br/>[reportes.js]"]
  node_demo["Demo support<br/>[demo.js]"]
end

node_customer_actor(("Customer"))
node_supplier_actor(("Supplier"))
node_admin_actor(("Administrator"))

node_customer_actor -.->|"shops through"| node_customer
node_supplier_actor -.->|"manages products"| node_supplier_portal
node_admin_actor -.->|"manages operations"| node_admin_ui
node_http_server -->|"queries"| node_database
node_http_server -->|"uses policies"| node_auth
node_http_server -->|"installs routes"| node_registration
node_http_server -->|"installs routes"| node_store
node_http_server -->|"installs routes"| node_photos
node_http_server -->|"installs routes"| node_review
node_http_server -->|"installs routes"| node_permissions
node_http_server -->|"installs routes"| node_reporting
node_http_server -->|"uses support"| node_demo
node_registration -->|"hashes passwords"| node_auth
node_store -->|"groups garments"| node_catalog_ui
node_store -->|"creates export"| node_catalog_doc
node_database -->|"Netlify session setup"| node_session_store
node_netlify_runtime -->|"adapts runtime"| node_http_server
node_netlify_runtime -->|"sets pool"| node_database
node_netlify_runtime -->|"creates store"| node_session_store
node_session_store -->|"uses table"| node_session_schema

click node_customer "https://github.com/diegoestebanperezmejia/soniweb/blob/main/public/tienda.js"
click node_catalog_ui "https://github.com/diegoestebanperezmejia/soniweb/blob/main/public/catalogo-prendas.js"
click node_login_ui "https://github.com/diegoestebanperezmejia/soniweb/blob/main/public/login.js"
click node_customer_portal "https://github.com/diegoestebanperezmejia/soniweb/blob/main/public/portal.js"
click node_supplier_portal "https://github.com/diegoestebanperezmejia/soniweb/blob/main/public/proveedor.html"
click node_admin_ui "https://github.com/diegoestebanperezmejia/soniweb/blob/main/public/administracion.js"
click node_http_server "https://github.com/diegoestebanperezmejia/soniweb/blob/main/servidor.js"
click node_auth "https://github.com/diegoestebanperezmejia/soniweb/blob/main/acceso.js"
click node_registration "https://github.com/diegoestebanperezmejia/soniweb/blob/main/registro.js"
click node_store "https://github.com/diegoestebanperezmejia/soniweb/blob/main/tienda.js"
click node_catalog_doc "https://github.com/diegoestebanperezmejia/soniweb/blob/main/catalogo-word.js"
click node_photos "https://github.com/diegoestebanperezmejia/soniweb/blob/main/fotos.js"
click node_review "https://github.com/diegoestebanperezmejia/soniweb/blob/main/revision.js"
click node_permissions "https://github.com/diegoestebanperezmejia/soniweb/blob/main/permisos.js"
click node_reporting "https://github.com/diegoestebanperezmejia/soniweb/blob/main/reportes.js"
click node_demo "https://github.com/diegoestebanperezmejia/soniweb/blob/main/demo.js"
click node_database "https://github.com/diegoestebanperezmejia/soniweb/blob/main/base.js"
click node_session_store "https://github.com/diegoestebanperezmejia/soniweb/blob/main/db/sesiones.mjs"
click node_session_schema "https://github.com/diegoestebanperezmejia/soniweb/blob/main/db/schema.ts"
click node_netlify_runtime "https://github.com/diegoestebanperezmejia/soniweb/blob/main/netlify/server/index.mjs"

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_customer,node_catalog_ui,node_login_ui,node_customer_portal,node_supplier_portal,node_admin_ui toneBlue
class node_http_server,node_auth,node_registration,node_store,node_catalog_doc,node_photos toneAmber
class node_database,node_session_store,node_session_schema,node_netlify_runtime toneMint
class node_review,node_permissions,node_reporting,node_demo toneRose
class node_customer_actor,node_supplier_actor,node_admin_actor toneIndigo
```

## Components

### Storefront and portals

- [Customer storefront](https://github.com/diegoestebanperezmejia/soniweb/blob/main/public/tienda.js): `public/tienda.js`
- [Product catalog UI](https://github.com/diegoestebanperezmejia/soniweb/blob/main/public/catalogo-prendas.js): `public/catalogo-prendas.js`
- [Login and registration UI](https://github.com/diegoestebanperezmejia/soniweb/blob/main/public/login.js): `public/login.js`
- [Customer portal](https://github.com/diegoestebanperezmejia/soniweb/blob/main/public/portal.js): `public/portal.js`
- [Supplier portal](https://github.com/diegoestebanperezmejia/soniweb/blob/main/public/proveedor.html): `public/proveedor.html`
- [Admin console](https://github.com/diegoestebanperezmejia/soniweb/blob/main/public/administracion.js): `public/administracion.js`

### Application services

- [Express application](https://github.com/diegoestebanperezmejia/soniweb/blob/main/servidor.js): `servidor.js`
- [Authentication policies](https://github.com/diegoestebanperezmejia/soniweb/blob/main/acceso.js): `acceso.js`
- [Account registration](https://github.com/diegoestebanperezmejia/soniweb/blob/main/registro.js): `registro.js`
- [Catalog and checkout](https://github.com/diegoestebanperezmejia/soniweb/blob/main/tienda.js): `tienda.js`
- [Word catalog export](https://github.com/diegoestebanperezmejia/soniweb/blob/main/catalogo-word.js): `catalogo-word.js`
- [Product photos](https://github.com/diegoestebanperezmejia/soniweb/blob/main/fotos.js): `fotos.js`

### Data and sessions

- [Database access](https://github.com/diegoestebanperezmejia/soniweb/blob/main/base.js): `base.js`
- [Persistent sessions](https://github.com/diegoestebanperezmejia/soniweb/blob/main/db/sesiones.mjs): `db/sesiones.mjs`
- [Session table schema](https://github.com/diegoestebanperezmejia/soniweb/blob/main/db/schema.ts): `db/schema.ts`
- [Netlify runtime adapter](https://github.com/diegoestebanperezmejia/soniweb/blob/main/netlify/server/index.mjs): `netlify/server/index.mjs`

### Supplier and admin operations

- [Product review](https://github.com/diegoestebanperezmejia/soniweb/blob/main/revision.js): `revision.js`
- [Supplier permissions](https://github.com/diegoestebanperezmejia/soniweb/blob/main/permisos.js): `permisos.js`
- [Sales reports](https://github.com/diegoestebanperezmejia/soniweb/blob/main/reportes.js): `reportes.js`
- [Demo support](https://github.com/diegoestebanperezmejia/soniweb/blob/main/demo.js): `demo.js`

### Other components

- **Customer**
- **Supplier**
- **Administrator**

## Connections

- Customer → Customer storefront: shops through
- Supplier → Supplier portal: manages products
- Administrator → Admin console: manages operations
- Express application → Database access: queries (evidence: `servidor.js`)
- Express application → Authentication policies: uses policies (evidence: `servidor.js`)
- Express application → Account registration: installs routes (evidence: `servidor.js`)
- Express application → Catalog and checkout: installs routes (evidence: `servidor.js`)
- Express application → Product photos: installs routes (evidence: `servidor.js`)
- Express application → Product review: installs routes (evidence: `servidor.js`)
- Express application → Supplier permissions: installs routes (evidence: `servidor.js`)
- Express application → Sales reports: installs routes (evidence: `servidor.js`)
- Express application → Demo support: uses support (evidence: `servidor.js`)
- Account registration → Authentication policies: hashes passwords (evidence: `registro.js`)
- Catalog and checkout → Product catalog UI: groups garments (evidence: `tienda.js`)
- Catalog and checkout → Word catalog export: creates export (evidence: `tienda.js`)
- Database access → Persistent sessions: Netlify session setup (evidence: `netlify/server/index.mjs`)
- Netlify runtime adapter → Express application: adapts runtime (evidence: `netlify/server/index.mjs`)
- Netlify runtime adapter → Database access: sets pool (evidence: `netlify/server/index.mjs`)
- Netlify runtime adapter → Persistent sessions: creates store (evidence: `netlify/server/index.mjs`)
- Persistent sessions → Session table schema: uses table (evidence: `db/sesiones.mjs`)
