# joyco-studio/marquee architecture

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

- Interactive diagram: https://gitdiagram.com/joyco-studio/marquee
- Repository: https://github.com/joyco-studio/marquee

## Overview

##### Project Type and Purpose
- Monorepo JavaScript/TypeScript library (pnpm workspace)
- Provides a core marquee engine (packages/core) and a React wrapper (packages/react)
- Includes project‐scaffolding templates (templates/basic) and CI/CD/versioning tools

##### File Structure
Top‐level:
- `.changeset/`, `CHANGELOG.md` – Changesets version management
- `.github/workflows/` – CI/CD for publishing and releases
- `package.json`, `pnpm-workspace.yaml` – Monorepo configuration
- `tsup.config.ts`, `tsconfig.json`, `eslint.config.mjs` – Build/lint settings
- `static/` – Logo/banner assets
- `templates/basic/` – Starter app for consumers
packages/:
- `packages/core/` – Core WAAPI-based marquee engine (class & helpers)
- `packages/react/` – React integration: `Marquee` component & `useMarquee` hook

##### README for Architecture Clues
- Core vs. React boundaries
- Runtime flow: consumer code → React wrapper → core engine → Web Animations API → browser
- Dev flow: local build → CI workflows → npm registry

##### Main Components & Their Interactions
a. Components:
1. Consumer Application
2. React Package (`@joycostudio/marquee/react`)
3. Core Package (`@joycostudio/marquee`)
4. Browser WAAPI Engine
5. Templates/scaffolding (for new apps)
6. Tooling & CI (Changesets, GitHub Actions, pnpm)
7. npm Registry / CDN
b. Relationships:
- Consumer App imports React package
- React package wraps core package, passing DOM refs & props
- Core package instantiates and controls WAAPI animations
- Build tools compile TS → ESM/CJS → published artifacts
- CI workflows trigger on commits/tags → version bumps & publish
- Consumers can also import core package directly (plain JS use)
c. Architectural Patterns:
- Monorepo with workspace packages
- Layered abstraction: core engine (framework-agnostic) + framework bridge
- Template‐driven project scaffolding
- Automated versioning & release via Changesets
d. Key Technologies:
- TypeScript, TSUP, ESLint, Prettier
- pnpm workspaces
- Web Animations API
- React
- GitHub Actions & Changesets

##### Essential Elements to Capture
- Core-React boundary and runtime invocation
- Build pipeline (TSUP) leading to artifacts
- Version management (Changesets → Changelog → Release)
- CI workflows (publish on commit vs. release)
- Scaffolding templates (consumer bootstrapping)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Runtime Flow
    subgraph "Runtime Flow"
        direction TB
        ConsumerApp["Consumer Application"]:::runtime
        ReactPackage["@joycostudio/marquee/react\n(React Package)"]:::library
        CorePackage["@joycostudio/marquee\n(Core Package)"]:::library
        WAAPI["Browser WAAPI Engine"]:::external
    end

    ConsumerApp -->|"imports React wrapper"| ReactPackage
    ReactPackage -->|"wraps core engine"| CorePackage
    CorePackage -->|"controls animations via"| WAAPI

    %% Scaffolding/Templates
    subgraph "Scaffolding/Templates"
        direction TB
        Templates["templates/basic/\n(Starter App Template)"]:::scaffold
        NewApp["New Consumer App"]:::runtime
    end
    Templates -->|"bootstraps"| NewApp

    %% Build & Release Pipeline
    subgraph "Build & Release Pipeline"
        direction TB
        MonorepoConfig["Monorepo & Build Config\n(package.json, pnpm-workspace.yaml,\nTSUP, TSConfig, ESLint)"]:::tooling
        BuildTools["TSUP & Tooling"]:::tooling
        Artifacts["ESM/CJS Artifacts"]:::tooling
        Changesets[".changeset/\n(Version Management)"]:::tooling
        CIWorkflows[".github/workflows/\n(CI/CD Workflows)"]:::tooling
        NpmRegistry["npm Registry / CDN"]:::external
    end

    MonorepoConfig -->|"configures"| BuildTools
    BuildTools -->|"produces"| Artifacts
    Artifacts -->|"published by"| CIWorkflows
    Changesets -->|"version bumps"| CIWorkflows
    CIWorkflows -->|"publishes to"| NpmRegistry

    %% Click Events
    click CorePackage "https://github.com/joyco-studio/marquee/tree/main/packages/core/"
    click ReactPackage "https://github.com/joyco-studio/marquee/tree/main/packages/react/"
    click Templates "https://github.com/joyco-studio/marquee/tree/main/templates/basic/"
    click CIWorkflows "https://github.com/joyco-studio/marquee/tree/main/.github/workflows/"
    click Changesets "https://github.com/joyco-studio/marquee/tree/main/.changeset/"
    click MonorepoConfig "https://github.com/joyco-studio/marquee/blob/main/pnpm-workspace.yaml"
    click MonorepoConfig "https://github.com/joyco-studio/marquee/blob/main/package.json"
    click MonorepoConfig "https://github.com/joyco-studio/marquee/blob/main/tsup.config.ts"
    click MonorepoConfig "https://github.com/joyco-studio/marquee/blob/main/tsconfig.json"
    click MonorepoConfig "https://github.com/joyco-studio/marquee/blob/main/eslint.config.mjs"

    %% Styles
    classDef runtime fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef library fill:#d4edda,stroke:#333,stroke-width:1px
    classDef tooling fill:#f8d7da,stroke:#333,stroke-width:1px
    classDef scaffold fill:#fff3cd,stroke:#333,stroke-width:1px
    classDef external fill:#e2e3e5,stroke:#333,stroke-width:1px
```
