# daksh2k/spicetify-stuff architecture

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

- Interactive diagram: https://gitdiagram.com/daksh2k/spicetify-stuff
- Repository: https://github.com/daksh2k/spicetify-stuff

## Overview

##### Project Type & Purpose
- This repository is a collection of extensions and themes for Spicetify. Its purpose is to enable users to customize and extend the functionality of Spicetify (a tool for Spotify customization) either through automatic updates (using Marketplace or wrappers) or via manual installation.
- The README explains three installation methods and indicates that the project is not a monolithic application but a collection of modular, independent plugins (extensions) along with theme files.

##### File Structure Analysis
- Top-level Directories/Files: Notice directories like “Extensions”, “Extensions/Wrappers”, “Themes”, “shared”, and several configuration files (.eslintrc.js, package.json, etc.). These highlight both the separation of extensions by functionality and the support for development best practices.
- Extensions: Each extension (e.g. “auto-skip”, “full-screen”, “playNext.js”, etc.) is located either as its own subdirectory (complete with its own source files, build configuration, and README) or as single JavaScript files in the “Extensions” folder. This indicates a plugin-based architecture.
- Wrappers: The “Extensions/Wrappers” directory contains wrapper files (e.g. fullScreenWrapper.js) which facilitate automatic updates by fetching the latest version from the repository.
- Themes: Contains theme-related resources (CSS files, INI files) that modify the look and feel of Spicetify.
- Shared: Contains type definitions (for TS and CSS modules) that likely help maintain consistency between extensions.

##### README Insights
- It describes three primary methods for installation: using a Spicetify Marketplace, via Wrappers, and manually copying extension files.
- This means that the interactions in the system are centered on the point where a user requests an extension installation which then flows to either a wrapper or direct file approach.
- Although the README is not a detailed architecture document, it provides a clear picture of how components are deployed and updated.

a. Main Components to Include:
- Repository Entry Point: “Spicetify Extensions and Themes”.
- Extensions Node: This can further branch into individual plugins (auto-skip, full-screen, playNext, savePlaylists, volumePercentage).
- Wrappers Node: Represents the set of “wrapper” files that provide automatic updating capabilities.
- Themes Node: A branch for theme files.
- Shared Module: For common type definitions and any shared code resources.
- Configuration & Build Tools: Represent configuration files (.prettierrc, tsconfig, eslint files) that are part of the development lifecycle.

b. Relationships & Interactions:
- Dependency relationships between high-level components (e.g. the “Themes” node is separate from extensions but part of the same repository and may be applied via Spicetify).

c. Architectural Patterns & Design Principles:
- Modular Architecture: Each extension is largely self-contained allowing for independent development and deployment.
- Separation of Concerns: Clearly separated directories for different purposes (extensions, wrappers, themes, shared types, and configuration).

d. Relevant Technologies & Frameworks:
- JavaScript and TypeScript: Noticeable from the use of both .js and .ts/.tsx files.
- Build and Lint Tools: Tools like ESLint, Prettier, and TypeScript configuration files show a commitment to code quality.
- Spicetify CLI and Marketplace: Essential external tools/interfaces for extension installation and updates.

## Diagram (Mermaid)

```mermaid
flowchart TD
    CLI["Spicetify CLI / User"]:::external
    Marketplace["Marketplace"]:::external

    Repo["Spicetify Extensions and Themes"]:::repo

    %% Repository Components
    Repo --> ES["Extensions"]:::extension
    Repo --> WS["Wrappers"]:::wrapper
    Repo --> T["Themes"]:::theme
    Repo --> SH["Shared Module"]:::shared
    Repo --> CT["Configuration & Build Tools"]:::config

    %% External interactions
    CLI -->|"manual_install"| ES
    CLI -->|"auto_update"| WS
    CLI --> Marketplace

    %% Extensions Subgraph
    subgraph "Extension Plugins"
        ASDir["Auto-skip (directory)"]:::extension
        ASDir -->|contains| ASFile["autoSkip.js"]:::extension
        FS["Full-screen"]:::extension
        KS["KeyboardShortcut (My)"]:::extension
        PN["PlayNext"]:::extension
        SP["SavePlaylists"]:::extension
        VP["VolumePercentage"]:::extension
    end

    %% Connect Extensions node to individual extension plugins
    ES --> ASDir
    ES --> FS
    ES --> KS
    ES --> PN
    ES --> SP
    ES --> VP

    %% Wrappers Subgraph
    subgraph "Wrapper Files"
        ASW["autoSkipWrapper.js"]:::wrapper
        FSW["fullScreenWrapper.js"]:::wrapper
        PNW["playNextWrapper.js"]:::wrapper
        SPW["savePlaylistsWrapper.js"]:::wrapper
        VPW["volumePercentageWrapper.js"]:::wrapper
    end

    %% Connect Wrappers node to its files
    WS --> ASW
    WS --> FSW
    WS --> PNW
    WS --> SPW
    WS --> VPW

    %% Themes Subgraph
    subgraph "Theme Files"
        Better["Better Theme"]:::theme
        Drib["drib-custom.css"]:::theme
    end

    T --> Better
    T --> Drib

    %% Dependency arrows: Wrappers update corresponding Extensions
    ASW ---|updates| ASFile
    FSW ---|updates| FS
    PNW ---|updates| PN
    SPW ---|updates| SP
    VPW ---|updates| VP

    %% Shared dependency for extensions
    SH ---|provides_types| ES

    %% Style definitions
    classDef external fill:#FAD4D4,stroke:#333,stroke-width:2px;
    classDef repo fill:#D0E6A5,stroke:#333,stroke-width:2px;
    classDef extension fill:#C9E4C5,stroke:#333,stroke-width:2px;
    classDef wrapper fill:#FFE5AD,stroke:#333,stroke-width:2px;
    classDef theme fill:#FFDFD4,stroke:#333,stroke-width:2px;
    classDef shared fill:#D6E5FA,stroke:#333,stroke-width:2px;
    classDef config fill:#F3E1F3,stroke:#333,stroke-width:2px;

    %% Click Events
    click Repo "https://github.com/daksh2k/spicetify-stuff/tree/master/root directory"
    click ES "https://github.com/daksh2k/spicetify-stuff/tree/master/Extensions"
    click ASDir "https://github.com/daksh2k/spicetify-stuff/tree/master/Extensions/auto-skip"
    click ASFile "https://github.com/daksh2k/spicetify-stuff/blob/master/Extensions/auto-skip/dist/autoSkip.js"
    click FS "https://github.com/daksh2k/spicetify-stuff/tree/master/Extensions/full-screen"
    click KS "https://github.com/daksh2k/spicetify-stuff/blob/master/Extensions/keyboardShortcutMy.js"
    click PN "https://github.com/daksh2k/spicetify-stuff/blob/master/Extensions/playNext.js"
    click SP "https://github.com/daksh2k/spicetify-stuff/blob/master/Extensions/savePlaylists.js"
    click VP "https://github.com/daksh2k/spicetify-stuff/blob/master/Extensions/volumePercentage.js"
    click WS "https://github.com/daksh2k/spicetify-stuff/tree/master/Extensions/Wrappers"
    click ASW "https://github.com/daksh2k/spicetify-stuff/blob/master/Extensions/Wrappers/autoSkipWrapper.js"
    click FSW "https://github.com/daksh2k/spicetify-stuff/blob/master/Extensions/Wrappers/fullScreenWrapper.js"
    click PNW "https://github.com/daksh2k/spicetify-stuff/blob/master/Extensions/Wrappers/playNextWrapper.js"
    click SPW "https://github.com/daksh2k/spicetify-stuff/blob/master/Extensions/Wrappers/savePlaylistsWrapper.js"
    click VPW "https://github.com/daksh2k/spicetify-stuff/blob/master/Extensions/Wrappers/volumePercentageWrapper.js"
    click T "https://github.com/daksh2k/spicetify-stuff/tree/master/Themes"
    click Better "https://github.com/daksh2k/spicetify-stuff/tree/master/Themes/Better"
    click Drib "https://github.com/daksh2k/spicetify-stuff/blob/master/Themes/drib-custom.css"
    click SH "https://github.com/daksh2k/spicetify-stuff/tree/master/shared"
    click CT "https://github.com/daksh2k/spicetify-stuff/blob/master/package.json"
```
