# techniq/layerstack architecture

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

- Interactive diagram: https://gitdiagram.com/techniq/layerstack
- Repository: https://github.com/techniq/layerstack

## Overview

##### Project Type and Purpose
- This is a pnpm‐based monorepo hosting a suite of open‐source Svelte libraries and utilities (“svelte-actions,” “svelte-stores,” “svelte-table,” a Tailwind plugin, generic “utils”) plus a SvelteKit documentation site (“sites/docs”).
- Purpose: provide composable actions/stores/themes for Svelte apps, bundled with automated CI/CD to build, test, publish each package to npm, and deliver a live docs site.

##### File Structure Analysis
- Root
– pnpm-workspace.yaml ties all packages and docs into one workspace
– .github/workflows: CI (lint/test/build), release (npm publish), preview and prod deploy pipelines
– package.json: workspace scripts (build:all, test:all, docs:build)
- packages/*
– Each folder (svelte-actions, svelte-stores, svelte-table, tailwind, utils) follows the same substructure: src/lib → TypeScript sources, tsconfig*.json, vite.config.js, CHANGELOG.md, LICENSE, package.json
– Tests co-located with source (e.g. .test.ts files)
- sites/docs
– SvelteKit app (src/routes for dynamic docs pages, mdsvex + plugins, Vite build, Tailwind, static assets)
– Pulls in the workspace packages as dependencies to render live examples and API docs
- CI/CD config
– build-preview/deploy-preview: preview docs on PRs
– deploy-prod: publish docs site to production host or GitHub Pages
– release.yml: on tag push, build/test each package, bump version, and publish to npm

##### README Insights
- LayerStack umbrella brand for libraries; companion projects (LayerChart, Svelte UX).

## Diagram (Mermaid)

```mermaid
flowchart TD
    Developer("Developer"):::external
    GitHub("GitHub Repo & Actions"):::external
    npm("npm Registry"):::external
    Hosting("Hosting Provider"):::external

    subgraph "Monorepo Root"
        direction TB
        pnpmWorkspace["pnpm-workspace.yaml"]:::code
        packageJSON["package.json"]:::code
        prettier[".prettierrc"]:::code
        editorconfig[".editorconfig"]:::code
    end

    subgraph "CI/CD (GitHub Actions)"
        direction TB
        ciYml["ci.yml"]:::code
        releaseYml["release.yml"]:::code
        buildPreview["build-preview.yml"]:::code
        deployPreview["deploy-preview.yml"]:::code
        deployProd["deploy-prod.yml"]:::code
    end

    subgraph "Packages"
        direction TB
        subgraph "svelte-actions"
            direction TB
            saIndex["index.ts"]:::code
            saVite["vite.config.js"]:::code
            saTs["tsconfig.json"]:::code
            saTsBuild["tsconfig.build.json"]:::code
        end
        subgraph "svelte-stores"
            direction TB
            ssIndex["index.ts"]:::code
            ssVite["vite.config.js"]:::code
            ssTs["tsconfig.json"]:::code
            ssTsBuild["tsconfig.build.json"]:::code
        end
        subgraph "svelte-table"
            direction TB
            stIndex["index.ts"]:::code
            stVite["vite.config.js"]:::code
            stTs["tsconfig.json"]:::code
            stTsBuild["tsconfig.build.json"]:::code
        end
        subgraph "tailwind plugin"
            direction TB
            twPlugin["plugin.cjs"]:::code
            twTheme["theme.ts"]:::code
            twVite["vite.config.js"]:::code
            twTs["tsconfig.json"]:::code
            twTsBuild["tsconfig.build.json"]:::code
        end
        subgraph "utils"
            direction TB
            uIndex["index.ts"]:::code
            uVite["vite.config.js"]:::code
            uTs["tsconfig.json"]:::code
            uTsBuild["tsconfig.build.json"]:::code
        end
    end

    subgraph "Docs Site (SvelteKit)"
        direction TB
        docsSite["Docs Site"]:::code
        dsConfig1["svelte.config.js"]:::code
        dsConfig2["vite.config.js"]:::code
        dsPostcss["postcss.config.cjs"]:::code
        dsTailwind["tailwind.config.cjs"]:::code
        dsMdsvex["mdsvex.config.js"]:::code
        dsLayout["+layout.svelte"]:::code
        dsLayoutComp["Layout.svelte"]:::code
        dsRoutes["src/routes/..."]:::code
        dsStatic["static/..."]:::code
    end

    Developer -->|"pushes code"| GitHub
    GitHub --> ciYml
    GitHub --> releaseYml
    GitHub --> buildPreview
    GitHub --> deployPreview
    GitHub --> deployProd

    pnpmWorkspace --> Packages
    packageJSON --> Packages
    prettier --> Packages
    editorconfig --> Packages

    ciYml -->|"build/test packages"| Packages
    buildPreview -->|"build docs site"| docsSite
    deployPreview -->|"deploy preview"| Hosting
    deployProd -->|"deploy production"| Hosting
    releaseYml -->|"publish packages"| npm

    dsConfig1 --> docsSite
    dsConfig2 --> docsSite
    dsPostcss --> docsSite
    dsTailwind --> docsSite
    dsMdsvex --> docsSite
    dsLayout --> docsSite
    dsLayoutComp --> docsSite
    dsRoutes --> docsSite
    dsStatic --> docsSite

    docsSite -->|"deployed to"| Hosting

    classDef code fill:#E0F7FA,stroke:#006064,color:#006064
    classDef external fill:#FFE0B2,stroke:#E65100,color:#E65100

    click pnpmWorkspace "https://github.com/techniq/layerstack/blob/main/pnpm-workspace.yaml"
    click packageJSON "https://github.com/techniq/layerstack/blob/main/package.json"
    click prettier "https://github.com/techniq/layerstack/blob/main/.prettierrc"
    click editorconfig "https://github.com/techniq/layerstack/blob/main/.editorconfig"
    click ciYml "https://github.com/techniq/layerstack/blob/main/.github/workflows/ci.yml"
    click releaseYml "https://github.com/techniq/layerstack/blob/main/.github/workflows/release.yml"
    click buildPreview "https://github.com/techniq/layerstack/blob/main/.github/workflows/build-preview.yml"
    click deployPreview "https://github.com/techniq/layerstack/blob/main/.github/workflows/deploy-preview.yml"
    click deployProd "https://github.com/techniq/layerstack/blob/main/.github/workflows/deploy-prod.yml"
    click saIndex "https://github.com/techniq/layerstack/blob/main/packages/svelte-actions/src/lib/index.ts"
    click saVite "https://github.com/techniq/layerstack/blob/main/packages/svelte-actions/vite.config.js"
    click saTs "https://github.com/techniq/layerstack/blob/main/packages/svelte-actions/tsconfig.json"
    click saTsBuild "https://github.com/techniq/layerstack/blob/main/packages/svelte-actions/tsconfig.build.json"
    click ssIndex "https://github.com/techniq/layerstack/blob/main/packages/svelte-stores/src/lib/index.ts"
    click ssVite "https://github.com/techniq/layerstack/blob/main/packages/svelte-stores/vite.config.js"
    click ssTs "https://github.com/techniq/layerstack/blob/main/packages/svelte-stores/tsconfig.json"
    click ssTsBuild "https://github.com/techniq/layerstack/blob/main/packages/svelte-stores/tsconfig.build.json"
    click stIndex "https://github.com/techniq/layerstack/blob/main/packages/svelte-table/src/lib/index.ts"
    click stVite "https://github.com/techniq/layerstack/blob/main/packages/svelte-table/vite.config.js"
    click stTs "https://github.com/techniq/layerstack/blob/main/packages/svelte-table/tsconfig.json"
    click stTsBuild "https://github.com/techniq/layerstack/blob/main/packages/svelte-table/tsconfig.build.json"
    click twPlugin "https://github.com/techniq/layerstack/blob/main/packages/tailwind/src/lib/plugin.cjs"
    click twTheme "https://github.com/techniq/layerstack/blob/main/packages/tailwind/src/lib/theme.ts"
    click twVite "https://github.com/techniq/layerstack/blob/main/packages/tailwind/vite.config.js"
    click twTs "https://github.com/techniq/layerstack/blob/main/packages/tailwind/tsconfig.json"
    click twTsBuild "https://github.com/techniq/layerstack/blob/main/packages/tailwind/tsconfig.build.json"
    click uIndex "https://github.com/techniq/layerstack/blob/main/packages/utils/src/lib/index.ts"
    click uVite "https://github.com/techniq/layerstack/blob/main/packages/utils/vite.config.js"
    click uTs "https://github.com/techniq/layerstack/blob/main/packages/utils/tsconfig.json"
    click uTsBuild "https://github.com/techniq/layerstack/blob/main/packages/utils/tsconfig.build.json"
    click dsConfig1 "https://github.com/techniq/layerstack/blob/main/sites/docs/svelte.config.js"
    click dsConfig2 "https://github.com/techniq/layerstack/blob/main/sites/docs/vite.config.js"
    click dsPostcss "https://github.com/techniq/layerstack/blob/main/sites/docs/postcss.config.cjs"
    click dsTailwind "https://github.com/techniq/layerstack/blob/main/sites/docs/tailwind.config.cjs"
    click dsMdsvex "https://github.com/techniq/layerstack/blob/main/sites/docs/mdsvex.config.js"
    click dsLayout "https://github.com/techniq/layerstack/blob/main/sites/docs/src/routes/+layout.svelte"
    click dsLayoutComp "https://github.com/techniq/layerstack/blob/main/sites/docs/src/docs/Layout.svelte"
    click dsRoutes "https://github.com/techniq/layerstack/tree/main/sites/docs/src/routes/"
    click dsStatic "https://github.com/techniq/layerstack/tree/main/sites/docs/static/"
```
