How aacorreag/sauvageclothes works
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 Home · products.json Products · admin/index.html CMS UI · script.js Storefront JS
Components 16
Public storefront
Customer-facing static pages and browser-side shopping experience.
- Home · Main storefront and catalog entry point.
index.html - Product page · Product detail entry point for a single item.
product.html - About page · Brand story and manifesto page.
about.html - Storefront JS · Drives catalog rendering, data loading, and cart interactions.
js/script.js - Product JS · Renders product details and item-specific interactions.
js/product.js
Content source
Repository-backed product catalog consumed by the storefront and CMS.
- Products · 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 · Browser-based content management entry point.
admin/index.html - CMS config · Configuration for the content editor backend and collections.
admin/config.yml - Preview css · Styling for content previews inside the CMS.
admin/preview.css
Auth backend
Small serverless function boundary used to support CMS authentication.
- Auth api · Authentication endpoint for CMS access.
functions/api/auth.js - Callback api · 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 · Custom styling and visual refinements for the storefront.
css/styles.css - Images · Logos, product images, and brand visuals.
img - Tailwind · CDN-delivered utility styling used by the pages.
- Icons · Phosphor iconography used in the UI.
- Fonts · Typography assets loaded from Google Fonts.
Connections 24
- 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.