# optimizely-axiom/optiaxiom architecture

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

- Interactive diagram: https://gitdiagram.com/optimizely-axiom/optiaxiom
- Repository: https://github.com/optimizely-axiom/optiaxiom

## Overview

##### High-Level Architecture Overview

**┌─ Axiom Design System ─────────────────────────────────────┐**

- ┌─ Packages ──────────────────────────────────────┐     │

- ┌─ React (@optiaxiom/react) ──────────────┐   │     │
- Components                            │   │     │
- Hooks                                │   │     │
- Utilities                           │   │     │
- ┘   │     │

- ┌─ Web Components ────────────────────┐    │     │
- (@optiaxiom/web-components)        │    │     │
- ┘    │     │

- ┌─ Globals ───────────────────────────┐    │     │
- Theme                             │    │     │
- Tokens                            │    │     │
- Context                           │    │     │
- ┘    │     │

- ┘     │

- ┌─ Apps ────────────────────────────────────────┐   │

- ┌─ Documentation ─┐  ┌─ Storybook ─┐        │   │

- ┘  └─────────────┘        │   │

- ┘   │

- ┘

##### Component Architecture Layer

**┌─ Component Architecture ──────────────────────────────┐**

- ┌─ Core Components ─────┐  ┌─ Complex Components ─┐ │
- Button             │  │ - Dialog             │ │
- Input             │  │ - DropdownMenu       │ │
- Text              │  │ - DataTable          │ │
- ┘  └────────────────────────┘ │

- ┌─ Layout Components ───┐  ┌─ Feedback Components ─┐ │
- Grid              │  │ - Toast              │ │
- Flex              │  │ - Alert             │ │
- ┘  └────────────────────────┘ │

- ┘

**┌─ Styling System ────────────────────────────────────┐**

- ┌─ Design Tokens ────┐  ┌─ Vanilla Extract ─────┐ │
- Typography      │  │ - Recipes             │ │
- Spacing         │  │ - Global Styles       │ │
- Shadows         │  └────────────────────────┘ │
- ┘                              │

- ┘

##### Build & Development Infrastructure

Development tooling:

**┌─ Development Infrastructure ───────────────────────┐**

- ┌─ Build Tools ─────┐  ┌─ Testing ────────────┐ │
- Rollup         │  │ - Vitest             │ │
- TypeScript     │  │ - Testing Library    │ │
- ┘  └────────────────────────┘ │

- ┌─ Documentation ────┐  ┌─ Quality Assurance ─┐ │
- Next.js         │  │ - ESLint            │ │
- MDX             │  │ - Prettier          │ │
- ┘  └────────────────────────┘ │

- ┘

Key Elements to Include:

- Web Components depending on React components
- Documentation and Storybook depending on all packages
- Components depending on design tokens and styling system

##### Labels for
- Package versions
- Technology stack used
- Integration points
- Public APIs

##### Notes on
- Component composition patterns
- Styling methodology
- Build process flow
- Testing strategy

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph AxiomDesignSystem["Axiom Design System"]
        subgraph Packages["Packages Layer"]
            subgraph ReactPackage["React Package"]
                Components["Components"]:::react
                Hooks["Hooks"]:::react
                Utilities["Utilities"]:::react
            end

            subgraph WebComponents["Web Components"]
                WCCore["Core Implementation"]:::webcomp
                WCTests["Tests"]:::webcomp
            end

            subgraph Globals["Globals"]
                Theme["Theme"]:::globals
                Tokens["Tokens"]:::globals
                Context["Context"]:::globals
            end
        end

        subgraph Apps["Apps Layer"]
            subgraph Docs["Documentation"]
                DocsPages["Pages"]:::docs
                DocsComponents["Components"]:::docs
                DocsDemo["Demos"]:::docs
            end

            subgraph Storybook["Storybook"]
                Stories["Stories"]:::storybook
                StorybookConfig["Configuration"]:::storybook
            end
        end

        subgraph DevInfra["Development Infrastructure"]
            BuildTools["Build Configuration"]:::devtools
            TestingSetup["Testing Setup"]:::devtools
            ESLintPlugin["ESLint Plugin"]:::devtools
        end
    end

    %% Relationships
    Components --> Theme
    Components --> Tokens
    Components --> Context
    WCCore --> Components
    DocsPages --> Components
    DocsComponents --> Components
    Stories --> Components
    BuildTools --> Components
    TestingSetup --> Components
    ESLintPlugin --> Components

    %% Click Events
    click Components "https://github.com/optimizely-axiom/optiaxiom/tree/main/packages/react/src/"
    click Hooks "https://github.com/optimizely-axiom/optiaxiom/tree/main/packages/react/src/use-*"
    click Utilities "https://github.com/optimizely-axiom/optiaxiom/tree/main/packages/react/src/utils/"
    click WCCore "https://github.com/optimizely-axiom/optiaxiom/tree/main/packages/web-components/src/"
    click WCTests "https://github.com/optimizely-axiom/optiaxiom/tree/main/packages/web-components/tests/"
    click Theme "https://github.com/optimizely-axiom/optiaxiom/blob/main/packages/globals/src/theme.css.ts"
    click Tokens "https://github.com/optimizely-axiom/optiaxiom/tree/main/packages/globals/src/tokens/"
    click Context "https://github.com/optimizely-axiom/optiaxiom/blob/main/packages/globals/src/context.ts"
    click DocsPages "https://github.com/optimizely-axiom/optiaxiom/tree/main/apps/docs/pages/"
    click DocsComponents "https://github.com/optimizely-axiom/optiaxiom/tree/main/apps/docs/components/"
    click DocsDemo "https://github.com/optimizely-axiom/optiaxiom/tree/main/apps/docs/demos/"
    click Stories "https://github.com/optimizely-axiom/optiaxiom/tree/main/apps/storybook/src/components/"
    click StorybookConfig "https://github.com/optimizely-axiom/optiaxiom/tree/main/apps/storybook/.storybook/"
    click BuildTools "https://github.com/optimizely-axiom/optiaxiom/blob/main/packages/react/rollup.config.mjs"
    click TestingSetup "https://github.com/optimizely-axiom/optiaxiom/blob/main/packages/react/vitest.config.ts"
    click ESLintPlugin "https://github.com/optimizely-axiom/optiaxiom/tree/main/packages/shared/.eslintplugin/"

    %% Styling
    classDef react fill:#4299E1,color:white
    classDef webcomp fill:#48BB78,color:white
    classDef globals fill:#9F7AEA,color:white
    classDef docs fill:#ED8936,color:white
    classDef storybook fill:#F56565,color:white
    classDef devtools fill:#4A5568,color:white

    %% Legend
    subgraph Legend
        React["React Components"]:::react
        WebComp["Web Components"]:::webcomp
        GlobalsLegend["Globals"]:::globals
        DocsLegend["Documentation"]:::docs
        StorybookLegend["Storybook"]:::storybook
        DevToolsLegend["Dev Tools"]:::devtools
    end
```
