# aacorreag/sauvageclothes architecture

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

- Interactive diagram: https://gitdiagram.com/aacorreag/sauvageclothes
- Repository: https://github.com/aacorreag/sauvageclothes

## Overview

1. **What this repository is**
   - A **static e-commerce storefront** for Sauvage Clothes, plus a **content-management/admin layer** for editing product data.
   - The runtime is mostly **browser-side JavaScript** and static HTML/CSS, with a small **serverless auth backend** used by the admin CMS.

2. **Public storefront entry points**
   - `index.html` is the main catalog/home page.
   - `product.html` is the product detail view.
   - `about.html` is a brand/manifesto page.
   - These pages share the same visual system and client-side behavior, but serve different user journeys.

3. **Presentation layer**
   - `css/styles.css` contains the site’s custom styling.
   - The README indicates **Tailwind CSS via CDN**, so layout and responsiveness are likely mostly utility-driven, with custom CSS for brand-specific refinements.
   - Assets in `img/` provide logos and product imagery.
   - The site also uses **Phosphor Icons** and **Google Fonts** for the premium fashion-brand look.

4. **Client-side application logic**
   - `js/script.js` appears to drive the main storefront experience: loading product data, rendering catalog content, and handling shopping-cart interactions.
   - `js/product.js` is the product-detail-specific script, likely responsible for showing one item’s data, variants, and add-to-cart actions.
   - This means the storefront is not server-rendered; it is assembled in the browser from static pages plus JSON data.

5. **Product data as the core content source**
   - `data/products.json` is the key structured data file.
   - It acts as the product catalog source of truth for titles, pricing, descriptions, images, and any other fields the UI needs.
   - The storefront reads from this file rather than from a traditional database or API.

6. **Shopping-cart and checkout flow**
   - Cart state is managed on the client side in JavaScript.
   - The README says checkout is completed via **WhatsApp**, so the purchase flow is not a hosted payment gateway.
   - The likely flow is: browse products → add to cart in the browser → generate an order summary → hand off to WhatsApp for final contact-based checkout.

7. **Admin/CMS subsystem**
   - The `admin/` directory contains a CMS entry point: `admin/index.html`, plus `admin/config.yml` and `admin/preview.css`.
   - This suggests a browser-based content editor for maintaining products/collections, with preview styling inside the admin UI.
   - The CMS is responsible for editing the content that ultimately lands in `data/products.json`.

8. **Serverless backend boundary**
   - `functions/api/auth.js` and `functions/api/callback.js` indicate a small **API/function layer** used for CMS authentication.
   - This is a separate boundary from the storefront: it supports admin sign-in or OAuth-style callbacks rather than the shopping experience itself.
   - In architectural terms, the repo has a lightweight backend only for admin access, not for product serving.

9. **Primary data flow for customers**
   - Browser loads the static page.
   - Frontend JS reads `data/products.json`.
   - The page renders catalog/detail content dynamically.
   - Cart interactions stay local to the browser.
   - Checkout transitions to WhatsApp, which is the external ordering channel.

10. **Primary data flow for admins**
   - Admin opens `/admin`.
   - The CMS uses the auth functions to establish access.
   - Product content is edited through the CMS.
   - Updates are written back to the repository-backed content source, which then feeds the storefront on the next deployment/build.

11. **Deployment/runtime model**
   - The README shows the site is deployed at a `pages.dev` URL, so the project is designed for a **static hosting platform with optional serverless functions**.
   - That matches the file layout: static assets for the storefront, CMS assets under `/admin`, and function handlers under `/functions`.

12. **Architecture boundaries to draw**
   - **Public customer experience**: static HTML + CSS + browser JS.
   - **Content source**: `data/products.json`.
   - **Admin experience**: `/admin` CMS UI.
   - **Auth/support backend**: `functions/api/*`.
   - There is **no separate application server or database** in this repo; content is file-based and the business logic is client-centric.

Main entry points: [`index.html`](https://github.com/aacorreag/sauvageclothes/blob/main/index.html) (Home), [`data/products.json`](https://github.com/aacorreag/sauvageclothes/blob/main/data/products.json) (Products), [`admin/index.html`](https://github.com/aacorreag/sauvageclothes/blob/main/admin/index.html) (CMS UI), [`js/script.js`](https://github.com/aacorreag/sauvageclothes/blob/main/js/script.js) (Storefront JS)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public storefront"]
  node_index_html["Home<br/>static page<br/>[index.html]"]
  node_product_html["Product page<br/>static page<br/>[product.html]"]
  node_about_html["About page<br/>static page<br/>[about.html]"]
  node_script_js["Storefront JS<br/>browser logic<br/>[script.js]"]
  node_product_js["Product JS<br/>browser logic<br/>[product.js]"]
end

subgraph group_content["Content source"]
  node_products_json[("Products<br/>catalog data<br/>[products.json]")]
end

subgraph group_admin["Admin CMS"]
  node_admin_index["CMS UI<br/>admin page<br/>[index.html]"]
  node_admin_config["CMS config<br/>[config.yml]"]
  node_admin_preview["Preview css<br/>admin styling<br/>[preview.css]"]
end

subgraph group_backend["Auth backend"]
  node_auth_js["Auth api<br/>serverless function<br/>[auth.js]"]
  node_callback_js["Callback api<br/>serverless function<br/>[callback.js]"]
end

subgraph group_presentation["Presentation assets"]
  node_styles_css["Site styles<br/>css<br/>[styles.css]"]
  node_img_assets[("Images<br/>media assets")]
  node_tailwind_cdn{{"Tailwind<br/>utility css"}}
  node_phosphor_icons{{"Icons<br/>icon set"}}
  node_google_fonts{{"Fonts"}}
end

node_index_html -->|"loads"| node_script_js
node_index_html -->|"styles"| node_styles_css
node_index_html -->|"uses"| node_tailwind_cdn
node_index_html -->|"uses"| node_phosphor_icons
node_index_html -->|"uses"| node_google_fonts
node_index_html -->|"reads"| node_products_json
node_index_html -->|"renders"| node_img_assets
node_product_html -->|"loads"| node_product_js
node_product_html -->|"styles"| node_styles_css
node_product_html -->|"reads"| node_products_json
node_about_html -->|"styles"| node_styles_css
node_about_html -->|"uses"| node_tailwind_cdn
node_script_js -->|"loads"| node_products_json
node_script_js -->|"uses"| node_img_assets
node_script_js -->|"uses"| node_phosphor_icons
node_product_js -->|"loads"| node_products_json
node_product_js -->|"uses"| node_img_assets
node_admin_index -->|"uses"| node_admin_config
node_admin_index -->|"styles"| node_admin_preview
node_admin_index -->|"auths via"| node_auth_js
node_admin_index -->|"auths via"| node_callback_js
node_admin_index -->|"edits"| node_products_json
node_auth_js -.->|"supports"| node_callback_js
node_admin_config -->|"targets"| node_products_json

click node_index_html "https://github.com/aacorreag/sauvageclothes/blob/main/index.html"
click node_product_html "https://github.com/aacorreag/sauvageclothes/blob/main/product.html"
click node_about_html "https://github.com/aacorreag/sauvageclothes/blob/main/about.html"
click node_script_js "https://github.com/aacorreag/sauvageclothes/blob/main/js/script.js"
click node_product_js "https://github.com/aacorreag/sauvageclothes/blob/main/js/product.js"
click node_styles_css "https://github.com/aacorreag/sauvageclothes/blob/main/css/styles.css"
click node_img_assets "https://github.com/aacorreag/sauvageclothes/tree/main/img"
click node_products_json "https://github.com/aacorreag/sauvageclothes/blob/main/data/products.json"
click node_admin_index "https://github.com/aacorreag/sauvageclothes/blob/main/admin/index.html"
click node_admin_config "https://github.com/aacorreag/sauvageclothes/blob/main/admin/config.yml"
click node_admin_preview "https://github.com/aacorreag/sauvageclothes/blob/main/admin/preview.css"
click node_auth_js "https://github.com/aacorreag/sauvageclothes/blob/main/functions/api/auth.js"
click node_callback_js "https://github.com/aacorreag/sauvageclothes/blob/main/functions/api/callback.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_index_html,node_product_html,node_about_html,node_script_js,node_product_js toneBlue
class node_products_json toneAmber
class node_admin_index,node_admin_config,node_admin_preview toneMint
class node_auth_js,node_callback_js toneRose
class node_styles_css,node_img_assets,node_tailwind_cdn,node_phosphor_icons,node_google_fonts toneIndigo
```

## Components

### Public storefront

Customer-facing static pages and browser-side shopping experience.

- [Home](https://github.com/aacorreag/sauvageclothes/blob/main/index.html): static page · Main storefront and catalog entry point. · `index.html`
- [Product page](https://github.com/aacorreag/sauvageclothes/blob/main/product.html): static page · Product detail entry point for a single item. · `product.html`
- [About page](https://github.com/aacorreag/sauvageclothes/blob/main/about.html): static page · Brand story and manifesto page. · `about.html`
- [Storefront JS](https://github.com/aacorreag/sauvageclothes/blob/main/js/script.js): browser logic · Drives catalog rendering, data loading, and cart interactions. · `js/script.js`
- [Product JS](https://github.com/aacorreag/sauvageclothes/blob/main/js/product.js): browser logic · Renders product details and item-specific interactions. · `js/product.js`

### Content source

Repository-backed product catalog consumed by the storefront and CMS.

- [Products](https://github.com/aacorreag/sauvageclothes/blob/main/data/products.json): catalog data · Source of truth for product titles, pricing, descriptions, and images. · `data/products.json`

### Admin CMS

Browser-based content editing interface for maintaining product data.

- [CMS UI](https://github.com/aacorreag/sauvageclothes/blob/main/admin/index.html): admin page · Browser-based content management entry point. · `admin/index.html`
- [CMS config](https://github.com/aacorreag/sauvageclothes/blob/main/admin/config.yml): cms config · Configuration for the content editor backend and collections. · `admin/config.yml`
- [Preview css](https://github.com/aacorreag/sauvageclothes/blob/main/admin/preview.css): admin styling · Styling for content previews inside the CMS. · `admin/preview.css`

### Auth backend

Small serverless function boundary used to support CMS authentication.

- [Auth api](https://github.com/aacorreag/sauvageclothes/blob/main/functions/api/auth.js): serverless function · Authentication endpoint for CMS access. · `functions/api/auth.js`
- [Callback api](https://github.com/aacorreag/sauvageclothes/blob/main/functions/api/callback.js): serverless function · Callback handler used by the CMS auth flow. · `functions/api/callback.js`

### Presentation assets

Shared styling, icons, fonts, and imagery used across the site.

- [Site styles](https://github.com/aacorreag/sauvageclothes/blob/main/css/styles.css): css · Custom styling and visual refinements for the storefront. · `css/styles.css`
- [Images](https://github.com/aacorreag/sauvageclothes/tree/main/img): media assets · Logos, product images, and brand visuals. · `img`
- **Tailwind**: utility css · CDN-delivered utility styling used by the pages.
- **Icons**: icon set · Phosphor iconography used in the UI.
- **Fonts**: web fonts · Typography assets loaded from Google Fonts.

## Connections

- Home → Storefront JS: loads · Home page bootstraps the main storefront behavior.
- Home → Site styles: styles · Home page uses the shared custom stylesheet.
- Home → Tailwind: uses · Utility styling is provided via CDN.
- Home → Icons: uses · UI icons are pulled from Phosphor Icons.
- Home → Fonts: uses · Typography is loaded from Google Fonts.
- Home → Products: reads · Catalog content is sourced from the product data file.
- Home → Images: renders · Page displays brand and product imagery.
- Product page → Product JS: loads · Product detail page bootstraps item-specific behavior.
- Product page → Site styles: styles · Product page uses the shared custom stylesheet.
- Product page → Products: reads · Product detail content comes from the catalog data file.
- About page → Site styles: styles · About page uses the shared custom stylesheet.
- About page → Tailwind: uses · Utility styling is provided via CDN.
- Storefront JS → Products: loads · Main storefront logic reads product catalog data.
- Storefront JS → Images: uses · Catalog rendering references product imagery.
- Storefront JS → Icons: uses · Cart and UI affordances use iconography.
- Product JS → Products: loads · Detail view script resolves the selected product from the catalog.
- Product JS → Images: uses · Detail view displays product images.
- CMS UI → CMS config: uses · CMS UI is driven by the editor configuration.
- CMS UI → Preview css: styles · Admin preview uses dedicated styling.
- CMS UI → Auth api: auths via · CMS authentication depends on the auth function.
- CMS UI → Callback api: auths via · CMS callback flow returns through the callback function.
- CMS UI → Products: edits · CMS updates the repository-backed product content.
- Auth api → Callback api: supports · Auth flow completes through the callback handler.
- CMS config → Products: targets · The editor manages product content stored in the data file.
