# syfxlin/tiptap-starter-kit architecture

> Architecture diagram of the GitHub repository syfxlin/tiptap-starter-kit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/syfxlin/tiptap-starter-kit
- Repository: https://github.com/syfxlin/tiptap-starter-kit

## Overview

##### Main Components
- Core Library: At the center, have the StarterKit initializer (src/index.ts) which configures Tiptap with the available extensions.
- Extensions: Represent each major group:
- Extensions (src/extensions): This folder includes user-interface extensions like BlockMenu, ClickMenu, Clipboard, FloatMenu, Markdown, Node-View, StarterKit composition, and Uploader.
- Marks (src/marks): Provides text formatting marks such as Bold, Italic, Underline, Code, Link, etc.
- Utilities and Styles:
- Styles (src/styles.less): Styling related to the editor.
- Documentation & Demo:
- Docs (docs folder) include guidelines, detailed extension descriptions, and configuration details.
- Demo (demo/index.ts) shows an example usage and integration scenario.
- Configuration/CI:
- Configuration files (e.g., .github/workflows, package.json, tsconfig.json) show how the project is built, tested, and deployed.

##### Relationships & Interactions
- The StarterKit module (core initializer) integrates all of the extensions, marks, and nodes into Tiptap’s editor instance.
- Each extension (e.g., Markdown, FloatMenu, etc.) works as an independent plugin that can be configured (as shown in the usage example in README).
- The extensions communicate with the core editor and may interact with each other (for example, calculating positions or sharing UI elements).

##### Architectural Patterns and Design Principles
- Modularity: The system is highly modular with separate folders for extensions, nodes, and marks.
- Extensibility: It’s built to be configurable. The README usage example shows that users can enable/disable or configure specific extensions.
- Clean Separation: There is a clear separation between core functionality, UI components (extension views and menus), and configuration/documentation.
- Dependency Injection: The integrations for Tiptap core and its plug-ins are configured at initialization, allowing for great flexibility in usage across projects.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Core["Tiptap StarterKit (Core Configuration)"]:::core

    %% Extensions
    BlockMenu["BlockMenu"]:::ext
    ClickMenu["ClickMenu"]:::ext
    Clipboard["Clipboard"]:::ext
    FloatMenu["FloatMenu"]:::ext
    Markdown["Markdown"]:::ext
    NodeView["Node-View"]:::ext
    StarterKit["StarterKit Composition"]:::ext
    Uploader["Uploader"]:::ext

    %% Nodes and Marks
    Nodes["Nodes (e.g., heading, paragraph, list, table, audio, video, emoji, etc.)"]:::nodes
    Marks["Marks (Bold, Italic, Code, Link, Underline, etc.)"]:::marks

    %% Utilities and Styles
    Utilities["Utilities (Helper Functions)"]:::utils
    Styles["Styles (Theme & Styling)"]:::styles

    %% Documentation & Demo
    Documentation["Documentation"]:::docs
    Demo["Demo App"]:::demo

    %% Configuration/CI
    CI["CI & Configuration"]:::ci
    GitHub["GitHub Workflows"]:::ci

    %% External Dependency
    TiptapCore["Tiptap Core (External Dependency)"]:::external

    %% Core Connections to Main Modules
    Core -->|"configures"| BlockMenu
    Core -->|"configures"| ClickMenu
    Core -->|"configures"| Clipboard
    Core -->|"configures"| FloatMenu
    Core -->|"configures"| Markdown
    Core -->|"configures"| NodeView
    Core -->|"configures"| StarterKit
    Core -->|"configures"| Uploader
    Core -->|"integrates"| Nodes
    Core -->|"integrates"| Marks
    Core -->|"utilizes"| Utilities
    Core -->|"applies"| Styles
    Core -->|"demonstratedIn"| Demo
    Core -->|"documentedIn"| Documentation
    Core -->|"builtBy"| CI
    Core -->|"extends"| TiptapCore

    %% Additional Interactions among Extensions and Components
    BlockMenu -->|"interactsWith"| Nodes
    ClickMenu -->|"interactsWith"| Marks
    FloatMenu -->|"interactsWith"| Nodes
    Markdown -->|"parsesUsing"| Utilities

    %% CI Sub-connections
    CI --> GitHub

    %% Click Events
    click Core "https://github.com/syfxlin/tiptap-starter-kit/blob/master/src/index.ts"
    click BlockMenu "https://github.com/syfxlin/tiptap-starter-kit/tree/master/src/extensions/block-menu"
    click ClickMenu "https://github.com/syfxlin/tiptap-starter-kit/tree/master/src/extensions/click-menu"
    click Clipboard "https://github.com/syfxlin/tiptap-starter-kit/tree/master/src/extensions/clipboard"
    click FloatMenu "https://github.com/syfxlin/tiptap-starter-kit/tree/master/src/extensions/float-menu"
    click Markdown "https://github.com/syfxlin/tiptap-starter-kit/tree/master/src/extensions/markdown"
    click NodeView "https://github.com/syfxlin/tiptap-starter-kit/tree/master/src/extensions/node-view"
    click StarterKit "https://github.com/syfxlin/tiptap-starter-kit/tree/master/src/extensions/starter-kit"
    click Uploader "https://github.com/syfxlin/tiptap-starter-kit/tree/master/src/extensions/uploader"
    click Nodes "https://github.com/syfxlin/tiptap-starter-kit/tree/master/src/nodes"
    click Marks "https://github.com/syfxlin/tiptap-starter-kit/tree/master/src/marks"
    click Utilities "https://github.com/syfxlin/tiptap-starter-kit/tree/master/src/utils"
    click Styles "https://github.com/syfxlin/tiptap-starter-kit/blob/master/src/styles.less"
    click Documentation "https://github.com/syfxlin/tiptap-starter-kit/tree/master/docs"
    click Demo "https://github.com/syfxlin/tiptap-starter-kit/blob/master/demo/index.ts"
    click GitHub "https://github.com/syfxlin/tiptap-starter-kit/blob/master/.github"
    click CI "https://github.com/syfxlin/tiptap-starter-kit/blob/master/package.json"
    click CI "https://github.com/syfxlin/tiptap-starter-kit/blob/master/tsconfig.json"

    %% Styles
    classDef core fill:#ffcccc,stroke:#990000,stroke-width:2px;
    classDef ext fill:#ccffcc,stroke:#006600,stroke-width:2px;
    classDef nodes fill:#ccccff,stroke:#000099,stroke-width:2px;
    classDef marks fill:#ffffcc,stroke:#999900,stroke-width:2px;
    classDef utils fill:#ccffff,stroke:#006666,stroke-width:2px;
    classDef styles fill:#ffccff,stroke:#990099,stroke-width:2px;
    classDef docs fill:#d9ead3,stroke:#38761d,stroke-width:2px;
    classDef demo fill:#ead1dc,stroke:#b45f06,stroke-width:2px;
    classDef ci fill:#f4cccc,stroke:#cc0000,stroke-width:2px;
    classDef external fill:#fff2cc,stroke:#bf9000,stroke-width:2px;
```
