# duckhoa-uit/nf-shopify architecture

> Architecture diagram of the GitHub repository duckhoa-uit/nf-shopify, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/duckhoa-uit/nf-shopify
- Repository: https://github.com/duckhoa-uit/nf-shopify

## Overview

##### Project type and purpose
- Dawn (and this Northfinder Shopify theme) is a Shopify Online Store 2.0 theme.
- It’s essentially a front‑end theme project: Liquid templates rendered server‑side by Shopify, with progressive enhancement via CSS and JavaScript.
- Purpose: Provide merchants with a fast, maintainable, extensible storefront that follows Shopify’s HTML‑first and JS‑only‑as‑needed philosophy.

##### File structure
- Top‑level dirs
- assets/ – CSS, JS, images, fonts, constants, modules, tests
- layout/ – Liquid layout wrappers (theme.liquid, password.liquid)
- locales/ – translation JSON files and schemas
- sections/ – JSON/Liquid files for customizable theme sections
- snippets/ – small Liquid fragments included in templates/sections
- templates/ – page templates (JSON for Online Store 2.0, Liquid for gift_card)
- config/ – settings_data.json & schema.json defining Theme Editor controls
- docs/architecture – markdown docs including project_diagram.md
- Config & tooling
- shopify.theme.toml, tailwind.config.js, vitest.config.js, pnpm‐lock.yaml
- GitHub Actions workflows (.github/workflows/ci.yml,test.yml)
- VSCode settings, theme‑check rules, Prettier, .npmrc

##### Readme insights
- Emphasizes server‑rendered Liquid, progressive enhancement, no unnecessary polyfills
- Developer tools: Shopify CLI, Theme Check, Lighthouse CI via GitHub Actions
- CI checks: linting, tests, Lighthouse audits, theme validation

##### Key reminders
- Both build‑time (pnpm install, CLI dev, tests) and run‑time (Liquid render, CDN serve, JS enhancements).
- Don’t overthink—map each part of the file tree to a visual component, connect them logically, and annotate interactions clearly.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Machine
    subgraph "Developer Machine"
        CodeEditor["VS Code"]:::dev
        LocalFS["Local File System"]:::dev
        ShopifyCLI["Shopify CLI & pnpm"]:::dev
        subgraph "Project Structure"
            Assets["assets/"]:::dev
            Layout["layout/"]:::dev
            Locales["locales/"]:::dev
            Sections["sections/"]:::dev
            Snippets["snippets/"]:::dev
            Templates["templates/"]:::dev
            Config["config/"]:::dev
            Docs["docs/architecture/"]:::dev
            Pages["pages/"]:::dev
        end
    end

    %% CI/CD & Version Control
    subgraph "CI/CD & Version Control"
        GitHub["GitHub Repository"]:::ci
        Actions["GitHub Actions"]:::ci
        Lint["Theme Check & Lint"]:::ci
        Tests["Vitest Tests"]:::ci
        Lighthouse["Lighthouse CI"]:::ci
    end

    %% Shopify Platform
    subgraph "Shopify Platform"
        AdminAPI["Shopify Admin API"]:::shop
        LiquidEngine["Shopify Liquid Engine"]:::shop
        CDN["Shopify CDN"]:::shop
    end

    %% End User
    EndUser["End User Browser"]:::browser

    %% Connections
    CodeEditor -->|"edits code"| LocalFS
    LocalFS -->|"project files"| ShopifyCLI
    ShopifyCLI -->|"theme dev preview"| LiquidEngine
    EndUser -->|"requests page"| LiquidEngine
    LiquidEngine -->|"renders HTML"| EndUser

    LocalFS -->|"push commit"| GitHub
    GitHub -->|"triggers"| Actions
    Actions -->|runs| Lint
    Actions -->|runs| Tests
    Actions -->|runs| Lighthouse
    Actions -->|"on success"| AdminAPI

    ShopifyCLI -->|"theme push"| AdminAPI
    AdminAPI -->|"stores assets & templates"| LiquidEngine
    LiquidEngine -->|"serves assets"| CDN
    CDN -->|"delivers CSS/JS"| EndUser

    %% Click Events
    click Assets "https://github.com/duckhoa-uit/nf-shopify/tree/main/assets/"
    click Layout "https://github.com/duckhoa-uit/nf-shopify/tree/main/layout/"
    click Locales "https://github.com/duckhoa-uit/nf-shopify/tree/main/locales/"
    click Sections "https://github.com/duckhoa-uit/nf-shopify/tree/main/sections/"
    click Snippets "https://github.com/duckhoa-uit/nf-shopify/tree/main/snippets/"
    click Templates "https://github.com/duckhoa-uit/nf-shopify/tree/main/templates/"
    click Config "https://github.com/duckhoa-uit/nf-shopify/blob/main/config/settings_schema.json"
    click Docs "https://github.com/duckhoa-uit/nf-shopify/blob/main/docs/architecture/project_diagram.md"
    click ShopifyCLI "https://github.com/duckhoa-uit/nf-shopify/blob/main/shopify.theme.toml"
    click ShopifyCLI "https://github.com/duckhoa-uit/nf-shopify/blob/main/tailwind.config.js"
    click ShopifyCLI "https://github.com/duckhoa-uit/nf-shopify/blob/main/vitest.config.js"
    click ShopifyCLI "https://github.com/duckhoa-uit/nf-shopify/blob/main/pnpm-lock.yaml"
    click Lint "https://github.com/duckhoa-uit/nf-shopify/blob/main/.theme-check.yml"
    click Lint "https://github.com/duckhoa-uit/nf-shopify/tree/main/.cursor/rules/"
    click Actions "https://github.com/duckhoa-uit/nf-shopify/blob/main/.github/workflows/ci.yml"
    click Actions "https://github.com/duckhoa-uit/nf-shopify/blob/main/.github/workflows/test.yml"
    click CodeEditor "https://github.com/duckhoa-uit/nf-shopify/tree/main/.vscode/"
    click CodeEditor "https://github.com/duckhoa-uit/nf-shopify/blob/main/.npmrc"
    click Pages "https://github.com/duckhoa-uit/nf-shopify/tree/main/pages/"

    %% Styles
    classDef dev fill:#ADD8E6,stroke:#000
    classDef ci fill:#90EE90,stroke:#000
    classDef shop fill:#D8BFD8,stroke:#000
    classDef browser fill:#FFA500,stroke:#000
```
