# scandiweb/satoshi-hyva architecture

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

- Interactive diagram: https://gitdiagram.com/scandiweb/satoshi-hyva
- Repository: https://github.com/scandiweb/satoshi-hyva

## Overview

##### Project type and purpose
- This is a Magento 2 full-stack extension plus frontend theme (“Satoshi” for Hyvä).
- On the backend it provides dozens of Magento modules (under app/code/Satoshi/*) that hook into Magento’s MVC, GraphQL, DI, and area-specific (frontend/adminhtml) systems.
- On the frontend it delivers a Hyvä theme (under app/design/frontend/Satoshi/Hyva) plus a modern TypeScript/Vite-powered SPA-style UI layer (under …/web/satoshi) that consumes Magento’s GraphQL/REST APIs for a fast, app-like UX.

##### File structure
- Top‐level “app/code/Satoshi” holds many Magento modules (Bundle, Catalog, CatalogGraphQl, Search, Checkout, Customer, Theme, UI, etc.). Each has its own etc/module.xml, di.xml, registration.php, plus controllers, blocks, models, viewmodels, GraphQL resolvers, patches, migrations, fixtures, etc.
- “app/design/frontend/Satoshi/Hyva” is the Hyvä theme: Magento layouts, PHTML templates, UI components, adminhtml pagebuilder definitions, static assets (CSS, JS, images), and a subfolder “web/satoshi” containing a full TypeScript/SPX app built with Vite.
- Configuration files: composer.json, package.json, readymage.yaml, plus Magento’s app/etc/config.php.
- Build tool configs: Vite, tailwind, postcss, pnpm/npm.
- The structure follows Magento’s modular MVC and DI pattern, and a decoupled frontend that talks to the backend over GraphQL/REST.

##### README for additional insights
- Satoshi is public-beta, extends Hyvä performance with Satoshi UX features (transitions, animations, dynamic rendering, instant add to cart, filtering/search, endless pagination).
- It integrates deeply with Magento’s checkout, cart, catalog, layered navigation, wishlist, etc., and provides GraphQL resolvers to feed the SPA layer.
- Developer guide and documentation link to deeper architectural details (pagebuilder integration, dynamic template mapping, GraphQL endpoints).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Backend Layer
    subgraph "Backend (Magento Server)" 
        direction TB
        MagentoCore["Magento Core<br/>(Router, Controllers, Blocks, Models)"]:::backend
        subgraph "Satoshi Modules" 
            direction TB
            Bundle["Bundle"]:::backend
            Catalog["Catalog"]:::backend
            CatalogGraphQl["CatalogGraphQl"]:::backend
            CatalogSearch["CatalogSearch"]:::backend
            Checkout["Checkout"]:::backend
            Customer["Customer"]:::backend
            Framework["Framework"]:::backend
            LayeredNavigation["LayeredNavigation"]:::backend
            Migration["Migration"]:::backend
            Newsletter["Newsletter"]:::backend
            ReviewSampleData["ReviewSampleData"]:::backend
            Sales["Sales"]:::backend
            SatoshiUi["SatoshiUi"]:::backend
            Swatches["Swatches"]:::backend
            ThemeModule["Theme"]:::backend
            Wishlist["Wishlist"]:::backend
        end
        DI["Dependency Injection<br/>Container & Services"]:::backend
        GraphQLAPI["GraphQL API Layer"]:::backend
        AdminPageBuilder["Adminhtml PageBuilder<br/>Integration"]:::backend
    end

    %% Database
    MySQL["MySQL Database"]:::db

    %% Frontend PHTML/Hyvä Theme
    subgraph "Hyvä Theme (PHTML Layer)"
        direction TB
        LayoutXML["Layout XML"]:::frontend
        TemplatesPHTML["PHTML Templates"]:::frontend
        ThemeConfig["theme.xml & view.xml"]:::frontend
    end

    %% Frontend SPA
    subgraph "Frontend SPA (TypeScript/Vite)" 
        direction TB
        AppTS["src/app.ts"]:::spa
        DataConnectors["src/data/*.ts"]:::spa
        GraphQLQueries["src/graphql/searchQuery.ts"]:::spa
        Store["src/store/*.ts"]:::spa
        Plugins["src/plugins/*.ts"]:::spa
        Utils["src/utils/magento-api.ts"]:::spa
        TailwindConfig["tailwind.config.js"]:::spa
        PostCSSConfig["postcss.config.js"]:::spa
        ViteConfig["vite.config.js"]:::spa
        PackageSPA["package.json & lock files"]:::spa
    end

    %% Project Config
    subgraph "Project Configuration"
        direction TB
        Composer["composer.json & composer.lock"]:::external
        NpmRoot["package.json (root)"]:::external
        Readymage["readymage.yaml"]:::external
        MagentoConfig["app/etc/config.php"]:::external
    end

    %% External
    CDN["CDN<br/>Static Assets"]:::external
    Browser["Browser"]:::external

    %% Relationships
    Browser -->|HTTP Request| MagentoCore
    MagentoCore -->|loads| Bundle
    MagentoCore -->|loads| Catalog
    MagentoCore -->|loads| CatalogGraphQl
    MagentoCore -->|loads| CatalogSearch
    MagentoCore -->|loads| Checkout
    MagentoCore -->|loads| Customer
    MagentoCore -->|loads| Framework
    MagentoCore -->|loads| LayeredNavigation
    MagentoCore -->|loads| Migration
    MagentoCore -->|loads| Newsletter
    MagentoCore -->|loads| ReviewSampleData
    MagentoCore -->|loads| Sales
    MagentoCore -->|loads| SatoshiUi
    MagentoCore -->|loads| Swatches
    MagentoCore -->|loads| ThemeModule
    MagentoCore -->|loads| Wishlist
    MagentoCore -->|uses| DI
    DI -->|injects| SatoshiUi
    DI -->|injects| GraphQLAPI
    GraphQLAPI -->|reads/writes| MySQL
    MagentoCore -->|reads/writes| MySQL
    MagentoCore -->|renders via PHTML| LayoutXML
    LayoutXML --> TemplatesPHTML
    TemplatesPHTML -->|includes SPA bundle| CDN
    Browser -->|loads JS/CSS| CDN
    Browser -->|initializes| AppTS
    AppTS -->|calls| GraphQLAPI
    AppTS -->|calls| MagentoCore
    AppTS --> DataConnectors
    AppTS --> GraphQLQueries
    AppTS --> Store
    AppTS --> Plugins
    AppTS --> Utils
    AppTS --> TailwindConfig
    AppTS --> PostCSSConfig
    AppTS --> ViteConfig
    AppTS --> PackageSPA
    Browser -->|admin access| AdminPageBuilder
    AdminPageBuilder -->|stores configs| MySQL

    %% Config relations
    Composer --> MagentoCore
    NpmRoot --> AppTS
    Readymage --> MagentoCore
    MagentoConfig --> MagentoCore

    %% Click events for component mapping
    click Bundle "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/Bundle"
    click Catalog "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/Catalog"
    click CatalogGraphQl "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/CatalogGraphQl"
    click CatalogSearch "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/CatalogSearch"
    click Checkout "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/Checkout"
    click Customer "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/Customer"
    click Framework "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/Framework"
    click LayeredNavigation "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/LayeredNavigation"
    click Migration "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/Migration"
    click Newsletter "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/Newsletter"
    click ReviewSampleData "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/ReviewSampleData"
    click Sales "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/Sales"
    click SatoshiUi "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/SatoshiUi"
    click Swatches "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/Swatches"
    click ThemeModule "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/Theme"
    click Wishlist "https://github.com/scandiweb/satoshi-hyva/tree/production/app/code/Satoshi/Wishlist"
    click LayoutXML "https://github.com/scandiweb/satoshi-hyva/tree/production/app/design/frontend/Satoshi/Hyva/Hyva_Theme/layout"
    click TemplatesPHTML "https://github.com/scandiweb/satoshi-hyva/tree/production/app/design/frontend/Satoshi/Hyva/Hyva_Theme/templates"
    click ThemeConfig "https://github.com/scandiweb/satoshi-hyva/blob/production/app/design/frontend/Satoshi/Hyva/etc/view.xml"
    click AppTS "https://github.com/scandiweb/satoshi-hyva/blob/production/app/design/frontend/Satoshi/Hyva/web/satoshi/src/app.ts"
    click DataConnectors "https://github.com/scandiweb/satoshi-hyva/tree/production/app/design/frontend/Satoshi/Hyva/web/satoshi/src/data"
    click GraphQLQueries "https://github.com/scandiweb/satoshi-hyva/blob/production/app/design/frontend/Satoshi/Hyva/web/satoshi/src/graphql/searchQuery.ts"
    click Store "https://github.com/scandiweb/satoshi-hyva/tree/production/app/design/frontend/Satoshi/Hyva/web/satoshi/src/store"
    click Plugins "https://github.com/scandiweb/satoshi-hyva/tree/production/app/design/frontend/Satoshi/Hyva/web/satoshi/src/plugins"
    click Utils "https://github.com/scandiweb/satoshi-hyva/blob/production/app/design/frontend/Satoshi/Hyva/web/satoshi/src/utils/magento-api.ts"
    click TailwindConfig "https://github.com/scandiweb/satoshi-hyva/blob/production/app/design/frontend/Satoshi/Hyva/web/satoshi/tailwind.config.js"
    click PostCSSConfig "https://github.com/scandiweb/satoshi-hyva/blob/production/app/design/frontend/Satoshi/Hyva/web/satoshi/postcss.config.js"
    click ViteConfig "https://github.com/scandiweb/satoshi-hyva/blob/production/app/design/frontend/Satoshi/Hyva/web/satoshi/vite.config.js"
    click PackageSPA "https://github.com/scandiweb/satoshi-hyva/blob/production/app/design/frontend/Satoshi/Hyva/web/satoshi/package.json"
    click Composer "https://github.com/scandiweb/satoshi-hyva/blob/production/composer.json"
    click NpmRoot "https://github.com/scandiweb/satoshi-hyva/blob/production/package.json"
    click Readymage "https://github.com/scandiweb/satoshi-hyva/blob/production/readymage.yaml"
    click MagentoConfig "https://github.com/scandiweb/satoshi-hyva/blob/production/app/etc/config.php"

    %% Styles
    classDef backend fill:#FFD6D6,stroke:#D9534F,stroke-width:1px;
    classDef frontend fill:#D6E4FF,stroke:#1F77B4,stroke-width:1px;
    classDef spa fill:#D6FFD6,stroke:#2CA02C,stroke-width:1px;
    classDef db fill:#FFF5D6,stroke:#FF7F0E,stroke-width:1px;
    classDef external fill:#E0E0E0,stroke:#A8A8A8,stroke-width:1px;
```
