# amiruh1/grinserproto architecture

> Architecture diagram of the GitHub repository amiruh1/grinserproto, 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/amiruh1/grinserproto
- Repository: https://github.com/amiruh1/grinserproto

## Overview

Grinser is a static storefront and admin panel for browsing products, managing a cart, and placing orders. The main customer flow runs from the store or product pages through the cart to checkout and Culqi payment; local browser storage supports the experience when Sheets is not configured. Administrators manage catalog, categories, users, and sales. The README documents optional Google Sheets synchronization and Culqi order/payment processing; some of those runtime connections are documented but their implementation was not sampled.

Main entry points: [`google-apps-script/Code.gs`](https://github.com/amiruh1/grinserproto/blob/main/google-apps-script/Code.gs) (Sheets and payment API), [`js/checkout-page.js`](https://github.com/amiruh1/grinserproto/blob/main/js/checkout-page.js) (Checkout), [`js/store.js`](https://github.com/amiruh1/grinserproto/blob/main/js/store.js) (Home store), [`js/auth.js`](https://github.com/amiruh1/grinserproto/blob/main/js/auth.js) (Login and roles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_site["Storefront entry<br/>[index.html]"]
  node_business_pages["Company and service pages"]
  node_shell["Shared site shell<br/>[site-shell.js]"]
  node_home_store["Home store<br/>[store.js]"]
  node_product_list["Product listing and filters<br/>[productos-page.js]"]
  node_product_detail["Product detail<br/>[producto-page.js]"]
  node_product_card["Product cards<br/>[product-card.js]"]
  node_catalog_data["Catalog data<br/>[productos.js]"]
end

subgraph group_commerce["Shopping and checkout"]
  node_cart_page["Cart page<br/>[carrito-page.js]"]
  node_cart_state["Cart operations<br/>[product-card.js]"]
  node_checkout["Checkout<br/>[checkout-page.js]"]
end

subgraph group_management["Accounts and administration"]
  node_accounts["Login and roles<br/>[auth.js]"]
  node_admin["Admin panel<br/>[admin.js]"]
end

subgraph group_services["Shared services"]
  node_common["Shared utilities and storage<br/>[data.js]"]
  node_sheets_config["Sheets configuration<br/>[sheets-config.js]"]
  node_apps_script["Sheets and payment API<br/>[Code.gs]"]
  node_sheets[("Google Sheets")]
  node_culqi["Culqi payments"]
  node_wa_widget["WhatsApp contact widget<br/>[whatsapp-widget.js]"]
  node_whatsapp["WhatsApp"]
end

node_shopper(("Shopper"))

node_shopper -->|"opens"| node_site
node_shopper -->|"visits"| node_business_pages
node_site -->|"presents"| node_home_store
node_business_pages -->|"uses"| node_shell
node_home_store -->|"displays"| node_catalog_data
node_product_list -->|"filters"| node_catalog_data
node_product_detail -->|"reads"| node_catalog_data
node_product_list -->|"renders"| node_product_card
node_product_detail -->|"uses"| node_product_card
node_home_store -->|"adds items"| node_cart_state
node_product_detail -->|"adds items"| node_cart_state
node_cart_page -->|"updates"| node_cart_state
node_cart_page -->|"continues to"| node_checkout
node_checkout -->|"opens payment"| node_culqi
node_checkout -->|"requests order and charge"| node_apps_script
node_checkout -->|"records order"| node_sheets
node_shopper -->|"registers or signs in"| node_accounts
node_admin -->|"manages users"| node_accounts
node_admin -->|"syncs catalog and users"| node_apps_script
node_accounts -->|"validates accounts"| node_apps_script
node_apps_script -->|"reads and writes"| node_sheets
node_apps_script -->|"creates orders and charges"| node_culqi
node_home_store -->|"uses utilities"| node_common
node_accounts -->|"uses storage"| node_common
node_checkout -->|"uses utilities"| node_common
node_sheets_config -->|"configures endpoint"| node_apps_script
node_wa_widget -->|"gets contact link"| node_common
node_wa_widget -->|"opens contact"| node_whatsapp
node_shopper -->|"uses"| node_wa_widget

click node_site "https://github.com/amiruh1/grinserproto/blob/main/index.html"
click node_business_pages "https://github.com/amiruh1/grinserproto/tree/main/paginas_html"
click node_shell "https://github.com/amiruh1/grinserproto/blob/main/js/site-shell.js"
click node_home_store "https://github.com/amiruh1/grinserproto/blob/main/js/store.js"
click node_product_list "https://github.com/amiruh1/grinserproto/blob/main/js/productos-page.js"
click node_product_detail "https://github.com/amiruh1/grinserproto/blob/main/js/producto-page.js"
click node_product_card "https://github.com/amiruh1/grinserproto/blob/main/js/product-card.js"
click node_catalog_data "https://github.com/amiruh1/grinserproto/blob/main/js/productos.js"
click node_cart_page "https://github.com/amiruh1/grinserproto/blob/main/js/carrito-page.js"
click node_cart_state "https://github.com/amiruh1/grinserproto/blob/main/js/product-card.js"
click node_checkout "https://github.com/amiruh1/grinserproto/blob/main/js/checkout-page.js"
click node_accounts "https://github.com/amiruh1/grinserproto/blob/main/js/auth.js"
click node_admin "https://github.com/amiruh1/grinserproto/blob/main/js/admin.js"
click node_common "https://github.com/amiruh1/grinserproto/blob/main/js/data.js"
click node_sheets_config "https://github.com/amiruh1/grinserproto/blob/main/js/sheets-config.js"
click node_apps_script "https://github.com/amiruh1/grinserproto/blob/main/google-apps-script/Code.gs"
click node_wa_widget "https://github.com/amiruh1/grinserproto/blob/main/js/whatsapp-widget.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_site,node_business_pages,node_shell,node_home_store,node_product_list,node_product_detail,node_product_card,node_catalog_data toneBlue
class node_cart_page,node_cart_state,node_checkout toneAmber
class node_accounts,node_admin toneMint
class node_common,node_sheets_config,node_apps_script,node_sheets,node_culqi,node_wa_widget,node_whatsapp toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Storefront entry](https://github.com/amiruh1/grinserproto/blob/main/index.html): `index.html`
- [Company and service pages](https://github.com/amiruh1/grinserproto/tree/main/paginas_html): `paginas_html`
- [Shared site shell](https://github.com/amiruh1/grinserproto/blob/main/js/site-shell.js): `js/site-shell.js`
- [Home store](https://github.com/amiruh1/grinserproto/blob/main/js/store.js): `js/store.js`
- [Product listing and filters](https://github.com/amiruh1/grinserproto/blob/main/js/productos-page.js): `js/productos-page.js`
- [Product detail](https://github.com/amiruh1/grinserproto/blob/main/js/producto-page.js): `js/producto-page.js`
- [Product cards](https://github.com/amiruh1/grinserproto/blob/main/js/product-card.js): `js/product-card.js`
- [Catalog data](https://github.com/amiruh1/grinserproto/blob/main/js/productos.js): `js/productos.js`

### Shopping and checkout

- [Cart page](https://github.com/amiruh1/grinserproto/blob/main/js/carrito-page.js): `js/carrito-page.js`
- [Cart operations](https://github.com/amiruh1/grinserproto/blob/main/js/product-card.js): `js/product-card.js`
- [Checkout](https://github.com/amiruh1/grinserproto/blob/main/js/checkout-page.js): `js/checkout-page.js`

### Accounts and administration

- [Login and roles](https://github.com/amiruh1/grinserproto/blob/main/js/auth.js): `js/auth.js`
- [Admin panel](https://github.com/amiruh1/grinserproto/blob/main/js/admin.js): `js/admin.js`

### Shared services

- [Shared utilities and storage](https://github.com/amiruh1/grinserproto/blob/main/js/data.js): `js/data.js`
- [Sheets configuration](https://github.com/amiruh1/grinserproto/blob/main/js/sheets-config.js): `js/sheets-config.js`
- [Sheets and payment API](https://github.com/amiruh1/grinserproto/blob/main/google-apps-script/Code.gs): `google-apps-script/Code.gs`
- **Google Sheets**
- **Culqi payments**
- [WhatsApp contact widget](https://github.com/amiruh1/grinserproto/blob/main/js/whatsapp-widget.js): `js/whatsapp-widget.js`
- **WhatsApp**

### Other components

- **Shopper**

## Connections

- Shopper → Storefront entry: opens (evidence: `README.md`)
- Shopper → Company and service pages: visits (evidence: `README.md`)
- Storefront entry → Home store: presents (evidence: `README.md`)
- Company and service pages → Shared site shell: uses (evidence: `js/site-shell.js`)
- Home store → Catalog data: displays (evidence: `js/store.js`)
- Product listing and filters → Catalog data: filters (evidence: `README.md`)
- Product detail → Catalog data: reads (evidence: `js/producto-page.js`)
- Product listing and filters → Product cards: renders (evidence: `README.md`)
- Product detail → Product cards: uses (evidence: `js/product-card.js`)
- Home store → Cart operations: adds items (evidence: `js/store.js`)
- Product detail → Cart operations: adds items (evidence: `js/producto-page.js`)
- Cart page → Cart operations: updates (evidence: `js/carrito-page.js`)
- Cart page → Checkout: continues to (evidence: `js/carrito-page.js`)
- Checkout → Culqi payments: opens payment (evidence: `README.md`)
- Checkout → Sheets and payment API: requests order and charge (evidence: `README.md`)
- Checkout → Google Sheets: records order (evidence: `README.md`)
- Shopper → Login and roles: registers or signs in (evidence: `README.md`)
- Admin panel → Login and roles: manages users (evidence: `README.md`)
- Admin panel → Sheets and payment API: syncs catalog and users (evidence: `README.md`)
- Login and roles → Sheets and payment API: validates accounts (evidence: `README.md`)
- Sheets and payment API → Google Sheets: reads and writes (evidence: `README.md`)
- Sheets and payment API → Culqi payments: creates orders and charges (evidence: `README.md`)
- Home store → Shared utilities and storage: uses utilities (evidence: `js/store.js`)
- Login and roles → Shared utilities and storage: uses storage (evidence: `js/auth.js`)
- Checkout → Shared utilities and storage: uses utilities (evidence: `js/checkout-page.js`)
- Sheets configuration → Sheets and payment API: configures endpoint (evidence: `README.md`)
- WhatsApp contact widget → Shared utilities and storage: gets contact link (evidence: `js/whatsapp-widget.js`)
- WhatsApp contact widget → WhatsApp: opens contact (evidence: `js/whatsapp-widget.js`)
- Shopper → WhatsApp contact widget: uses (evidence: `js/whatsapp-widget.js`)
