# kevinescobr/growklok architecture

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

- Interactive diagram: https://gitdiagram.com/kevinescobr/growklok
- Repository: https://github.com/kevinescobr/growklok

## Overview

1. **Overall architecture**
   - This is a **static, browser-run e-commerce site**: three HTML pages, shared UI fragments, client-side JavaScript, and local JSON data.
   - There is **no backend service** in the repository; all behavior happens in the browser and via static assets.

2. **Primary user-facing pages**
   - `index.html` is the **landing/home page**.
   - `shop.html` is the **catalog + cart page**.
   - `contact.html` is the **contact page** with form interaction and validation.
   - These pages are the top-level entry points and should be shown as separate presentation surfaces in an architecture diagram.

3. **Shared UI composition**
   - `components/navbar.html` and `components/footer.html` are reusable page fragments.
   - The pages likely assemble a common shell around the main content, giving the site a consistent navigation and footer across pages.
   - This is an important boundary: **shared layout components vs page-specific content**.

4. **Client-side application logic**
   - `assets/js/main.js` holds general site behavior.
   - `assets/js/cart.js` contains shopping-cart logic.
   - `assets/js/validation.js` handles contact-form validation.
   - `assets/js/whatsapp.js` supports message generation or handoff to WhatsApp.
   - These scripts are the main functional layer and run entirely in the browser.

5. **Product data source**
   - `data/products.json` is the catalog source of truth for product listings.
   - The shop page likely reads this JSON to render product cards dynamically rather than hardcoding the catalog into HTML.
   - In the diagram, represent this as a **static data dependency** from `shop.html`/`cart.js` to `products.json`.

6. **Cart state and persistence**
   - `utils/storage.js` provides local storage helpers.
   - `cart.js` uses this utility to persist cart contents between page loads using browser storage.
   - The cart subsystem is therefore split into:
     - **UI interaction/rendering**
     - **persistent client-side state**
   - This is the key stateful boundary in an otherwise static site.

7. **Contact and messaging flow**
   - `contact.html` presents a form.
   - `validation.js` validates user input on the client before any action proceeds.
   - `whatsapp.js` suggests an alternate contact path that formats a message and redirects or opens WhatsApp.
   - There is no evidence of a server-side form submission pipeline; the contact flow is likely **client-only**.

8. **Styling and assets**
   - `assets/css/styles.css` contains custom styling layered on top of **Bootstrap 5**.
   - `assets/img` and `assets/fonts` are supporting static assets for visuals and branding.
   - These are presentation-only dependencies and can be shown as shared resources consumed by all pages.

9. **Runtime and deployment model**
   - The project is a **front-end-only web app** served as static files.
   - It can be opened directly in a browser for local use, and it does not require an application server or database.
   - `package.json` exists, but from the repository contents there is no visible server/runtime architecture beyond client-side tooling metadata.

10. **Main data flow for the shop**
   - Browser loads `shop.html` → JavaScript reads `products.json` → products are rendered into the catalog → user adds items to cart → cart state is saved through `storage.js`/browser storage → cart can be used for checkout-like actions or WhatsApp sharing.
   - This is the most important end-to-end flow to capture in an architecture diagram.

11. **Main data flow for contact**
   - Browser loads `contact.html` → user enters form data → `validation.js` checks the input → `whatsapp.js` may format/send the message path.
   - The contact workflow is client-side and likely intended for lightweight lead capture rather than server persistence.

12. **Suggested architectural boundaries**
   - **Presentation layer:** HTML pages, Bootstrap-based styling, shared navbar/footer.
   - **Interaction layer:** main/cart/validation/whatsapp JavaScript.
   - **Data layer:** products JSON and browser local storage.
   - **Static asset layer:** images, fonts, CSS.
   - These boundaries accurately describe the repo and are the best fit for an architecture diagram.

Main entry points: [`shop.html`](https://github.com/kevinescobr/growklok/blob/main/shop.html) (Shop), [`index.html`](https://github.com/kevinescobr/growklok/blob/main/index.html) (Home), [`contact.html`](https://github.com/kevinescobr/growklok/blob/main/contact.html) (Contact), [`assets/css/styles.css`](https://github.com/kevinescobr/growklok/blob/main/assets/css/styles.css) (Site CSS)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_index_html["Home<br/>page<br/>[index.html]"]
  node_shop_html["Shop<br/>page<br/>[shop.html]"]
  node_contact_html["Contact<br/>page<br/>[contact.html]"]
  node_navbar_html["Navbar<br/>fragment<br/>[navbar.html]"]
  node_footer_html["Footer<br/>fragment<br/>[footer.html]"]
  node_styles_css["Site CSS<br/>stylesheet<br/>[styles.css]"]
  node_bootstrap["Bootstrap<br/>ui framework"]
end

subgraph group_interaction["Client Logic"]
  node_main_js["Main JS<br/>site script<br/>[main.js]"]
  node_cart_js["Cart JS<br/>cart logic<br/>[cart.js]"]
  node_validation_js["Validation<br/>form logic<br/>[validation.js]"]
  node_whatsapp_js["WhatsApp<br/>message handoff<br/>[whatsapp.js]"]
end

subgraph group_data["Data"]
  node_products_json["Products<br/>catalog data<br/>[products.json]"]
  node_storage_js["Storage<br/>browser state<br/>[storage.js]"]
end

subgraph group_assets["Assets"]
  node_assets_img["Images<br/>static media"]
  node_assets_fonts["Fonts<br/>static media"]
end

node_index_html -->|"uses"| node_navbar_html
node_index_html -->|"uses"| node_footer_html
node_index_html -->|"styles"| node_styles_css
node_index_html -->|"styles"| node_bootstrap
node_index_html -->|"behavior"| node_main_js
node_index_html -->|"loads"| node_assets_img
node_shop_html -->|"uses"| node_navbar_html
node_shop_html -->|"uses"| node_footer_html
node_shop_html -->|"styles"| node_styles_css
node_shop_html -->|"styles"| node_bootstrap
node_shop_html -->|"behavior"| node_main_js
node_shop_html -->|"behavior"| node_cart_js
node_shop_html -->|"reads"| node_products_json
node_shop_html -->|"loads"| node_assets_img
node_contact_html -->|"uses"| node_navbar_html
node_contact_html -->|"uses"| node_footer_html
node_contact_html -->|"styles"| node_styles_css
node_contact_html -->|"styles"| node_bootstrap
node_contact_html -->|"behavior"| node_validation_js
node_contact_html -->|"behavior"| node_whatsapp_js
node_cart_js -->|"persists"| node_storage_js
node_cart_js -->|"reads"| node_products_json
node_validation_js -->|"hands off"| node_whatsapp_js
node_styles_css -->|"extends"| node_bootstrap
node_styles_css -->|"uses"| node_assets_fonts
node_styles_css -->|"uses"| node_assets_img

click node_index_html "https://github.com/kevinescobr/growklok/blob/main/index.html"
click node_shop_html "https://github.com/kevinescobr/growklok/blob/main/shop.html"
click node_contact_html "https://github.com/kevinescobr/growklok/blob/main/contact.html"
click node_navbar_html "https://github.com/kevinescobr/growklok/blob/main/components/navbar.html"
click node_footer_html "https://github.com/kevinescobr/growklok/blob/main/components/footer.html"
click node_styles_css "https://github.com/kevinescobr/growklok/blob/main/assets/css/styles.css"
click node_main_js "https://github.com/kevinescobr/growklok/blob/main/assets/js/main.js"
click node_cart_js "https://github.com/kevinescobr/growklok/blob/main/assets/js/cart.js"
click node_validation_js "https://github.com/kevinescobr/growklok/blob/main/assets/js/validation.js"
click node_whatsapp_js "https://github.com/kevinescobr/growklok/blob/main/assets/js/whatsapp.js"
click node_products_json "https://github.com/kevinescobr/growklok/blob/main/data/products.json"
click node_storage_js "https://github.com/kevinescobr/growklok/blob/main/utils/storage.js"
click node_assets_img "https://github.com/kevinescobr/growklok/tree/main/assets/img"
click node_assets_fonts "https://github.com/kevinescobr/growklok/tree/main/assets/fonts"

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_index_html,node_shop_html,node_contact_html,node_navbar_html,node_footer_html,node_styles_css,node_bootstrap toneBlue
class node_main_js,node_cart_js,node_validation_js,node_whatsapp_js toneAmber
class node_products_json,node_storage_js toneMint
class node_assets_img,node_assets_fonts toneRose
```

## Components

### Presentation

Pages, shared fragments, and styling consumed by the browser

- [Home](https://github.com/kevinescobr/growklok/blob/main/index.html): page · Landing page · `index.html`
- [Shop](https://github.com/kevinescobr/growklok/blob/main/shop.html): page · Catalog and cart page · `shop.html`
- [Contact](https://github.com/kevinescobr/growklok/blob/main/contact.html): page · Contact form page · `contact.html`
- [Navbar](https://github.com/kevinescobr/growklok/blob/main/components/navbar.html): fragment · Shared navigation shell · `components/navbar.html`
- [Footer](https://github.com/kevinescobr/growklok/blob/main/components/footer.html): fragment · Shared page footer · `components/footer.html`
- [Site CSS](https://github.com/kevinescobr/growklok/blob/main/assets/css/styles.css): stylesheet · Custom styles layered on Bootstrap · `assets/css/styles.css`
- **Bootstrap**: ui framework · External CSS framework dependency

### Client Logic

JavaScript modules handling navigation, cart, validation, and messaging

- [Main JS](https://github.com/kevinescobr/growklok/blob/main/assets/js/main.js): site script · General browser-side behavior · `assets/js/main.js`
- [Cart JS](https://github.com/kevinescobr/growklok/blob/main/assets/js/cart.js): cart logic · Cart interaction and rendering · `assets/js/cart.js`
- [Validation](https://github.com/kevinescobr/growklok/blob/main/assets/js/validation.js): form logic · Client-side contact validation · `assets/js/validation.js`
- [WhatsApp](https://github.com/kevinescobr/growklok/blob/main/assets/js/whatsapp.js): message handoff · Formats or launches WhatsApp contact flow · `assets/js/whatsapp.js`

### Data

Static product data and browser-persisted state

- [Products](https://github.com/kevinescobr/growklok/blob/main/data/products.json): catalog data · Static source of truth for products · `data/products.json`
- [Storage](https://github.com/kevinescobr/growklok/blob/main/utils/storage.js): browser state · Local storage helpers for persisted cart state · `utils/storage.js`

### Assets

Images and fonts used by the site

- [Images](https://github.com/kevinescobr/growklok/tree/main/assets/img): static media · Product and branding imagery · `assets/img`
- [Fonts](https://github.com/kevinescobr/growklok/tree/main/assets/fonts): static media · Custom fonts for branding and typography · `assets/fonts`

## Connections

- Home → Navbar: uses · Shared header shell
- Home → Footer: uses · Shared footer shell
- Home → Site CSS: styles · Site styling
- Home → Bootstrap: styles · Framework styling
- Home → Main JS: behavior · General client-side behavior
- Home → Images: loads · Visual media
- Shop → Navbar: uses · Shared header shell
- Shop → Footer: uses · Shared footer shell
- Shop → Site CSS: styles · Site styling
- Shop → Bootstrap: styles · Framework styling
- Shop → Main JS: behavior · General client-side behavior
- Shop → Cart JS: behavior · Catalog and cart interactions
- Shop → Products: reads · Catalog source data
- Shop → Images: loads · Product imagery
- Contact → Navbar: uses · Shared header shell
- Contact → Footer: uses · Shared footer shell
- Contact → Site CSS: styles · Site styling
- Contact → Bootstrap: styles · Framework styling
- Contact → Validation: behavior · Form validation
- Contact → WhatsApp: behavior · Contact handoff
- Cart JS → Storage: persists · Cart state saved in browser storage
- Cart JS → Products: reads · Product catalog lookup
- Validation → WhatsApp: hands off · Validated contact data may be formatted for WhatsApp
- Site CSS → Bootstrap: extends · Custom styling builds on framework defaults
- Site CSS → Fonts: uses · Typography assets
- Site CSS → Images: uses · Background and branding assets
