# amsterdam/design-system architecture

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

- Interactive diagram: https://gitdiagram.com/amsterdam/design-system
- Repository: https://github.com/amsterdam/design-system

## Overview

##### Project type and purpose
- This is an **open-source design system** monorepo (Amsterdam Design System).

##### Key areas in the file structure
- Top-level
- packages/css: SCSS entry point, components folder, build config
- packages/react: React component library, tests, Rollup config
- storybook: standalone Storybook site (config, stories, docs)
- documentation: process guides (CI, code reviews, publishing)
- CI/CD workflows under .github/workflows (lint/test, deploy, publish)
- pnpm-workspace.yaml (monorepo coordination)
- Build & deployment
- Rollup and Babel for building React
- SCSS compiler for CSS package
- Storybook/Vite for documentation site
- GitHub Actions for linting, testing, Chromatic visual tests, publishing to npm

- **Clear labels**: “packages/react”, “GitHub Actions → Build & Publish”
- Source code → Build → npm registry
- Consumer app ← npm package
- Storybook site ← built packages
- Rectangles for code modules (CSS, React, tokens)

##### Detailed elements to capture
- Monorepo root and workspace orchestration
- Per-package build steps & outputs
- Storybook documentation pipeline
- Visual testing integration (Chromatic)
- Publishing flow to npm

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Actor
    Dev["Developer"]:::external

    %% Monorepo Workspace
    subgraph "Design System Monorepo"
        direction TB
        Pnpm["pnpm-workspace.yaml"]:::package
        packagesProp["packages-proprietary"]:::package
        packagesCSS["packages/css"]:::package
        packagesReact["packages/react"]:::package
        storybookNode["storybook"]:::package
        documentationNode["documentation"]:::package
        subgraph "CI/CD Workflows (.github/workflows)"
            direction TB
            lintTest["Lint & Test"]:::pipeline
            chromatic["Visual Regression"]:::pipeline
            publish["Publish to npm"]:::pipeline
            featureDeploy["Feature-branch Deploy"]:::pipeline
            featureCleanup["Feature-branch Cleanup"]:::pipeline
            prTitle["PR Title Validation"]:::pipeline
        end
    end

    %% Build & CI/CD Pipeline Tools
    subgraph "Build Tools & CI"
        direction TB
        RollupBabel["Rollup & Babel"]:::pipeline
        SCSSCompiler["SCSS Compiler"]:::pipeline
        Vite["Vite (Storybook)"]:::pipeline
        GitHubActions["GitHub Actions"]:::pipeline
    end

    %% Registry & Hosting Services
    subgraph "Registry & Hosting"
        direction TB
        npmRegistry["npm Registry"]:::service
        chromeService["Chromatic"]:::service
        storybookPortal["Storybook Portal"]:::service
    end

    %% Consumer
    ConsumerApps["Consumer Applications"]:::external

    %% Flows
    Dev -->|"push feature"| lintTest
    lintTest -->|"runs tests on"| packagesCSS
    lintTest -->|"runs tests on"| packagesReact
    lintTest --> chromatic
    chromatic -->|"runs visual tests on"| chromeService
    chromatic --> prTitle
    prTitle --> featureDeploy
    featureDeploy --> featureCleanup
    featureCleanup --> publish
    publish -->|"build CSS"| SCSSCompiler
    publish -->|"build React"| RollupBabel
    publish -->|"build Docs"| Vite
    SCSSCompiler --> npmRegistry
    RollupBabel --> npmRegistry
    Vite --> storybookPortal

    packagesProp --> SCSSCompiler
    packagesProp --> RollupBabel
    packagesCSS --> SCSSCompiler
    packagesReact --> RollupBabel
    storybookNode --> Vite
    documentationNode --> Dev

    ConsumerApps -->|"install packages from"| npmRegistry
    ConsumerApps -->|"view docs on"| storybookPortal

    %% Click Events
    click Pnpm "https://github.com/amsterdam/design-system/blob/develop/pnpm-workspace.yaml"
    click lintTest "https://github.com/amsterdam/design-system/blob/develop/.github/workflows/lint-test.yml"
    click chromatic "https://github.com/amsterdam/design-system/blob/develop/.github/workflows/chromatic.yml"
    click publish "https://github.com/amsterdam/design-system/blob/develop/.github/workflows/publish.yml"
    click featureDeploy "https://github.com/amsterdam/design-system/blob/develop/.github/workflows/feature-branch-deploy.yml"
    click featureCleanup "https://github.com/amsterdam/design-system/blob/develop/.github/workflows/feature-branch-cleanup.yml"
    click prTitle "https://github.com/amsterdam/design-system/blob/develop/.github/workflows/pr-title-validation.yml"
    click documentationNode "https://github.com/amsterdam/design-system/tree/develop/documentation"
    click packagesProp "https://github.com/amsterdam/design-system/tree/develop/packages-proprietary"
    click packagesCSS "https://github.com/amsterdam/design-system/tree/develop/packages/css"
    click packagesReact "https://github.com/amsterdam/design-system/tree/develop/packages/react"
    click storybookNode "https://github.com/amsterdam/design-system/tree/develop/storybook"

    %% Styles
    classDef external fill:#f9f,stroke:#933,stroke-width:1px;
    classDef package fill:#fffae6,stroke:#cc9,stroke-width:1px;
    classDef pipeline fill:#e6f0ff,stroke:#99c,stroke-width:1px;
    classDef service fill:#e6ffe6,stroke:#6c9,stroke-width:1px;
```
