# shaigerbi/israeli-store architecture

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

- Interactive diagram: https://gitdiagram.com/shaigerbi/israeli-store
- Repository: https://github.com/shaigerbi/israeli-store

## Overview

##### Project type and purpose
- This is a Nuxt.js-based Jamstack e-commerce storefront (“Israeli-Store”) that presents collectibles (coins, stamps, lapel pins, tokens).
- It uses Vue/Nuxt for UI, Vuex for state management, and static JSON files under `static/db` as its data source.

##### File structure
- Top-level config files: `.babelrc`, `nuxt.config.js`, `package.json`
- `pages/`: Nuxt routing—each folder (e.g., `pages/coins/index.vue`) defines a route that fetches JSON from `static/db/*.json`.
- `components/`: reusable Vue components (`Products.vue`, `TheHeader.vue`, etc.).
- `layouts/`: global wrappers (`default.vue`, `error.vue`).
- `store/`: Vuex modules for each category (`coins`, `stamps`, `lapel_pins`, `tokens`) with `state.js`, `actions.js`, etc.
- `static/`:
- `/db/*.json`: datastore files for each category
- `/images/...`: folder hierarchy of collectible images
- `assets/`: Sass variables, global styles
- `plugins/`, `middleware/`: custom logic insertion points (likely empty or trivial in this project)

##### README
- Confirms it’s a standard Nuxt project with build/dev/generate scripts.
- No backend other than static JSON; generates a fully static site or runs a Node server for SSR.

##### Components
a. Frontend / Nuxt.js application
- SSR & SSG engine (Node + Nuxt) at build time
- Vue components & layouts
- Vuex store modules
b. Data layer
- Static JSON files (`static/db/*.json`)
- Static images (`static/images`)
c. Build & Deployment
- Developer machine with Node.js & NPM
- Build step (`npm run generate` or `npm run build`) → output to `/dist`
- CDN or static-hosting (Netlify, Vercel, S3) serving generated files
d. Runtime flow
- Browser → HTTP GET → CDN / Server → serves prebuilt HTML/CSS/JS → Browser hydration
- Client-side JS → fetch JSON from `/db/*.json` → populate Vuex store → render components

##### Architectural patterns & design principles
- Jamstack: pre-rendered pages + client-side hydration
- Modular Vuex store per category (separation of concerns)
- Component-based UI (header/footer, product grid)
- Static asset optimization via Nuxt build pipeline

##### Technologies & frameworks
- Nuxt.js (Vue SSR/SSG), Vue.js, Vuex
- Webpack/Babel build chain
- Sass (`assets/variables.scss`)
- JSON files as headless “DB”
- Static hosting/CDN

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Deployment
    subgraph "Build & Deployment" 
        direction TB
        Git["Git Repository"]:::orange
        CI["CI Pipeline"]:::orange
        BuildServer["Build Server (Node.js + Nuxt)"]:::orange
        Dist["/dist Output"]:::orange
        CDN["CDN / Static Hosting"]:::orange

        Git -->|push| CI
        CI -->|run build| BuildServer
        BuildServer -->|generate static site| Dist
        Dist -->|deploy| CDN
    end

    %% Runtime Flow
    subgraph "Runtime (Browser)" 
        direction TB
        Browser["User's Browser"]:::blue
        NuxtEngine["Nuxt SSR/SSG Engine"]:::blue
        Pages["Pages (Routes)"]:::blue
        Layouts["Layouts"]:::blue
        Components["Vue Components"]:::blue
        VuexStore["Vuex Store Modules"]:::blue
        Styles["Global Styles (Sass)"]:::blue

        Browser -->|GET HTML/CSS/JS| CDN
        CDN -->|serve static files| Browser
        Browser -->|hydrate| NuxtEngine
        NuxtEngine --> Pages
        Pages --> Layouts
        Layouts --> Components
        Components --> VuexStore
        Components --> Styles
        VuexStore -->|fetch JSON| JSONDB
        Components -->|load images| ImageStore
    end

    %% Data Layer
    subgraph "Data Layer" 
        direction TB
        JSONDB["Static JSON DB"]:::green
        ImageStore["Static Image Store"]:::green

        JSONDB -->|files| Browser
        ImageStore -->|assets| Browser
    end

    %% Config & Tools
    subgraph "Config & Tooling"
        direction TB
        Babel[".babelrc"]:::orange
        NuxtConfig["nuxt.config.js"]:::orange
        PackageJSON["package.json"]:::orange
        JestConfig["jest.config.js"]:::orange
        ESLint[".eslintrc.js"]:::orange
        EditorConfig[".editorconfig"]:::orange
        Plugins["plugins/"]:::orange
        Middleware["middleware/"]:::orange

        Babel --> BuildServer
        NuxtConfig --> BuildServer
        PackageJSON --> BuildServer
        JestConfig --> BuildServer
        ESLint --> BuildServer
        EditorConfig --> BuildServer
        Plugins --> NuxtEngine
        Middleware --> NuxtEngine
    end

    %% Click Events
    click NuxtConfig "https://github.com/shaigerbi/israeli-store/blob/master/nuxt.config.js"
    click PackageJSON "https://github.com/shaigerbi/israeli-store/blob/master/package.json"
    click Babel "https://github.com/shaigerbi/israeli-store/blob/master/.babelrc"
    click Pages "https://github.com/shaigerbi/israeli-store/blob/master/pages/index.vue"
    click Pages "https://github.com/shaigerbi/israeli-store/blob/master/pages/coins/index.vue"
    click Pages "https://github.com/shaigerbi/israeli-store/blob/master/pages/stamps/index.vue"
    click Pages "https://github.com/shaigerbi/israeli-store/blob/master/pages/lapel_pins/index.vue"
    click Pages "https://github.com/shaigerbi/israeli-store/blob/master/pages/tokens/index.vue"
    click Components "https://github.com/shaigerbi/israeli-store/blob/master/components/TheHeader.vue"
    click Components "https://github.com/shaigerbi/israeli-store/blob/master/components/TheFooter.vue"
    click Components "https://github.com/shaigerbi/israeli-store/blob/master/components/Products.vue"
    click Layouts "https://github.com/shaigerbi/israeli-store/blob/master/layouts/default.vue"
    click Layouts "https://github.com/shaigerbi/israeli-store/blob/master/layouts/error.vue"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/coins/state.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/coins/actions.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/coins/mutations.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/coins/getters.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/stamps/state.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/stamps/actions.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/stamps/mutations.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/stamps/getters.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/lapel_pins/state.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/lapel_pins/actions.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/lapel_pins/mutations.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/lapel_pins/getters.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/tokens/state.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/tokens/actions.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/tokens/mutations.js"
    click VuexStore "https://github.com/shaigerbi/israeli-store/blob/master/store/tokens/getters.js"
    click JSONDB "https://github.com/shaigerbi/israeli-store/blob/master/static/db/coins.json"
    click JSONDB "https://github.com/shaigerbi/israeli-store/blob/master/static/db/stamps.json"
    click JSONDB "https://github.com/shaigerbi/israeli-store/blob/master/static/db/lapel_pins.json"
    click JSONDB "https://github.com/shaigerbi/israeli-store/blob/master/static/db/tokens.json"
    click ImageStore "https://github.com/shaigerbi/israeli-store/tree/master/static/images/coins/"
    click ImageStore "https://github.com/shaigerbi/israeli-store/tree/master/static/images/stamps/"
    click ImageStore "https://github.com/shaigerbi/israeli-store/tree/master/static/images/lapel_pins/"
    click ImageStore "https://github.com/shaigerbi/israeli-store/tree/master/static/images/tokens/"
    click Styles "https://github.com/shaigerbi/israeli-store/blob/master/assets/variables.scss"

    %% Styles
    classDef blue fill:#D0E8FF,stroke:#0366d6,color:#0366d6;
    classDef green fill:#E6FFED,stroke:#28A745,color:#22863A,stroke-width:2px;
    classDef orange fill:#FFF5B1,stroke:#DBAB09,color:#735C0F;
```
