# shopware/meteor architecture

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

- Interactive diagram: https://gitdiagram.com/shopware/meteor
- Repository: https://github.com/shopware/meteor

## Overview

##### Project type and purpose
- This is a monorepo for an open-source design system (Meteor) used by Shopware.

##### File structure
- Top-level:
- docs/ – static authoring of documentation (built via Docusaurus).
- examples/ – sample apps demonstrating usage (admin-sdk app, nuxt app, plugin).
- packages/ – core libraries:
– admin-sdk: JavaScript/TypeScript SDK for building Shopware administration apps.
– component-library: Vue 3 component collection (with Storybook, Vite, test frameworks).
– tokens: tool to fetch design tokens from Figma and produce deliverables (CSS, JSON).
– stylelint-plugin-meteor: Stylelint ruleset for Meteor token conventions.
– prettier-config: shareable Prettier configuration.
- Configuration files at root:
- pnpm-workspace.yaml & turbo.json – workspace & monorepo build orchestrator.
- GitHub workflows – CI pipelines for testing, releasing, visual regression.
- Each package:
- src/ – source code organized by domain/infrastructure or components.
- tests/, e2e/, play-wright/jest/vitest configs – testing layers.
- build scripts & config (tsconfig, vite.config, babel, webpack for examples).

##### README for additional insights
- README highlights the four primary packages under “packages/” and the examples.
- Contributing and license info.
- No runtime server—most packages are client SDKs or build-time tools.

a. Main components
- Monorepo Root
- Package Modules:
- Admin-SDK
- Component-Library
- Tokens
- Stylelint-Plugin
- Prettier-Config
- Documentation Layer (Docusaurus)
- Example Applications (admin-sdk-app, nuxt-app, plugin)
- External Services:
- NPM Registry (publishing packages)
- GitHub Actions (CI/CD)
b. Relationships & interactions
- Tokens fetch from Figma → produce JSON/CSS → consumed by component-library, stylelint-plugin, admin-sdk.
- Component-library exports Vue components → used by admin-sdk and examples.
- Admin-SDK provides abstractions for Shopware admin apps → examples/admin-sdk-app & plugin depend on it.
- Stylelint-Plugin + Prettier-Config → enforce design and code style across packages and examples.
- CI (GitHub Actions) runs lint, tests (jest, vitest, playwright), visual tests, and publishes to NPM.
c. Architectural patterns & design principles
- Monorepo modularization: logically separated workspaces with shared tooling (pnpm + turborepo).
- Domain-Driven Structure: each package divides code into domain/infrastructure or feature slices.
- Reusability: example apps demonstrate integration and serve as live tests.
d. Key technologies & frameworks
- TypeScript across all packages.
- Vite + Rollup for bundling (libraries & examples).
- Jest, Vitest, Playwright for unit/E2E/visual tests.
- Storybook for component documentation.
- Docusaurus for admin-sdk docs.
- pnpm, turborepo for workspace management.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Services
    FigmaAPI["Figma API"]:::external
    GitHubActions["GitHub Actions"]:::cicd
    NPMRegistry["NPM Registry"]:::external

    %% Monorepo Root
    subgraph "Monorepo Root"
        RootConfig["pnpm-workspace.yaml & turbo.json"]:::root
        Workflows[".github/workflows"]:::root
    end

    %% Documentation Layer
    Docs["Docusaurus Docs"]:::docs

    %% Packages
    subgraph "Packages"
        subgraph "Generators"
            Tokens["Tokens"]:::generator
            IconKit["Icon Kit"]:::generator
        end
        subgraph "UI Libraries"
            ComponentLib["Component Library"]:::ui
            AdminSDK["Admin SDK"]:::ui
        end
        subgraph "Infrastructure"
            Stylelint["Stylelint Plugin"]:::infra
            Prettier["Prettier Config"]:::infra
        end
    end

    %% Example Applications
    subgraph "Examples"
        AdminApp["Admin SDK App"]:::example
        PluginApp["Admin SDK Plugin"]:::example
        NuxtApp["Nuxt App"]:::example
    end

    %% Relationships
    FigmaAPI -->|fetch tokens| Tokens
    FigmaAPI -->|fetch icons| IconKit
    Tokens -->|provides styles| ComponentLib
    Tokens -->|provides tokens| AdminSDK
    IconKit -->|provides icons| ComponentLib
    ComponentLib -->|used by| AdminSDK
    AdminSDK -->|used by| AdminApp
    AdminSDK -->|used by| PluginApp
    ComponentLib -->|used by| NuxtApp
    Stylelint -->|enforces styles| Packages
    Prettier -->|enforces code style| Packages
    GitHubActions -->|runs CI/CD| Packages
    GitHubActions -->|runs CI/CD| Examples
    GitHubActions -->|publishes| NPMRegistry
    RootConfig --> Packages
    Workflows --> GitHubActions
    Docs -->|built via Docusaurus| GitHubActions
    Docs -->|docs for| AdminSDK

    %% Click Events
    click RootConfig "https://github.com/shopware/meteor/blob/main/pnpm-workspace.yaml"
    click Workflows "https://github.com/shopware/meteor/tree/main/.github/workflows/"
    click Docs "https://github.com/shopware/meteor/tree/main/docs/admin-sdk/"
    click Docs "https://github.com/shopware/meteor/blob/main/docs/admin-sdk/docusaurus.config.js"
    click AdminApp "https://github.com/shopware/meteor/tree/main/examples/admin-sdk-app/"
    click PluginApp "https://github.com/shopware/meteor/tree/main/examples/admin-sdk-plugin/"
    click NuxtApp "https://github.com/shopware/meteor/tree/main/examples/nuxt-app/"
    click AdminSDK "https://github.com/shopware/meteor/tree/main/packages/admin-sdk/"
    click AdminSDK "https://github.com/shopware/meteor/tree/main/packages/admin-sdk/src/"
    click AdminSDK "https://github.com/shopware/meteor/tree/main/packages/admin-sdk/e2e/"
    click AdminSDK "https://github.com/shopware/meteor/blob/main/packages/admin-sdk/jest.config.js"
    click AdminSDK "https://github.com/shopware/meteor/blob/main/packages/admin-sdk/playwright.config.ts"
    click AdminSDK "https://github.com/shopware/meteor/blob/main/packages/admin-sdk/package.json"
    click ComponentLib "https://github.com/shopware/meteor/tree/main/packages/component-library/"
    click ComponentLib "https://github.com/shopware/meteor/tree/main/packages/component-library/src/"
    click ComponentLib "https://github.com/shopware/meteor/tree/main/packages/component-library/.storybook/"
    click ComponentLib "https://github.com/shopware/meteor/blob/main/packages/component-library/vite.config.ts"
    click ComponentLib "https://github.com/shopware/meteor/blob/main/packages/component-library/package.json"
    click IconKit "https://github.com/shopware/meteor/tree/main/packages/icon-kit/"
    click IconKit "https://github.com/shopware/meteor/tree/main/packages/icon-kit/src/figma/"
    click IconKit "https://github.com/shopware/meteor/tree/main/packages/icon-kit/src/domain/"
    click IconKit "https://github.com/shopware/meteor/blob/main/packages/icon-kit/package.json"
    click Tokens "https://github.com/shopware/meteor/tree/main/packages/tokens/"
    click Tokens "https://github.com/shopware/meteor/blob/main/packages/tokens/src/scripts/index.ts"
    click Tokens "https://github.com/shopware/meteor/tree/main/packages/tokens/src/common/"
    click Tokens "https://github.com/shopware/meteor/tree/main/packages/tokens/src/deliverable/"
    click Tokens "https://github.com/shopware/meteor/tree/main/packages/tokens/src/dictionary/"
    click Tokens "https://github.com/shopware/meteor/blob/main/packages/tokens/src/figma/infrastructure/FigmaApi.ts"
    click Tokens "https://github.com/shopware/meteor/blob/main/packages/tokens/package.json"
    click Stylelint "https://github.com/shopware/meteor/tree/main/packages/stylelint-plugin-meteor/"
    click Stylelint "https://github.com/shopware/meteor/tree/main/packages/stylelint-plugin-meteor/src/rules/"
    click Stylelint "https://github.com/shopware/meteor/blob/main/packages/stylelint-plugin-meteor/src/index.ts"
    click Stylelint "https://github.com/shopware/meteor/blob/main/packages/stylelint-plugin-meteor/package.json"
    click Prettier "https://github.com/shopware/meteor/tree/main/packages/prettier-config/"
    click Prettier "https://github.com/shopware/meteor/blob/main/packages/prettier-config/index.js"
    click Prettier "https://github.com/shopware/meteor/blob/main/packages/prettier-config/package.json"
    click GitHubActions "https://github.com/shopware/meteor/blob/main/.github/workflows/tests.yml"
    click GitHubActions "https://github.com/shopware/meteor/blob/main/.github/workflows/release.yml"
    click GitHubActions "https://github.com/shopware/meteor/blob/main/.github/workflows/visual-tests.yml"
    click GitHubActions "https://github.com/shopware/meteor/blob/main/.github/workflows/update-icons.yml"
    click GitHubActions "https://github.com/shopware/meteor/blob/main/.github/workflows/update-tokens.yml"
    click GitHubActions "https://github.com/shopware/meteor/blob/main/.github/workflows/npm-preview-release.yml"

    %% Styles
    classDef external fill:#f9c,stroke:#333,stroke-width:1px
    classDef cicd fill:#f96,stroke:#333,stroke-width:1px
    classDef root fill:#ccf,stroke:#333,stroke-width:1px
    classDef docs fill:#cfc,stroke:#333,stroke-width:1px
    classDef generator fill:#ffeb99,stroke:#333,stroke-width:1px
    classDef ui fill:#99ccff,stroke:#333,stroke-width:1px
    classDef infra fill:#ccffcc,stroke:#333,stroke-width:1px
    classDef example fill:#d9b3ff,stroke:#333,stroke-width:1px
```
