# spicetify/spicetify-themes architecture

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

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

## Overview

##### Project type and purpose
- This repository is a collection of _themes_ for an open-source CLI tool called **spicetify-cli**, which customizes the Spotify desktop client.

##### File structure
- Top-level directories: one folder per theme (e.g., **Dribbblish**, **Blackout**, **Flow**, …), plus special folders like **_Extra** for additional tweaks.
- Each theme directory typically contains:
- user.css (theme overrides)
- optional assets/images/theme.js/install.ps1/uninstall.ps1 for advanced themes
- Root‐level manifest.json and THEMES.md serve to list available themes and provide previews.
- There are GitHub meta‐files (LICENSE, CONTRIBUTING.md, CODE_OF_CONDUCT.md) but no build scripts or backend code.

##### Key insights from the README
- Some themes require special install/uninstall scripts.

##### Main components
a. **GitHub Repository (spicetify-themes)**
- Hosts theme directories, README, manifest.json, THEMES.md.
b. **Developer/User Local Environment**
- Git client, local clone folder.
- File system path: `~/.config/spicetify/Themes` (Linux/Mac) or the Spicetify config path on Windows.
c. **spicetify-cli**
- Reads theme folders, config commands, copies files, patches Spotify.
d. **Spotify Desktop Client**
- Receives CSS/JS injections from spicetify, renders the customized UI.
e. **External Services (optional)**
- GitHub (for PRs), Reddit/Discord (support), AUR (Arch package).

##### Relationships and data flows
1. User runs `git clone` → local theme repository.
2. User executes copy command → themes copied into spicetify config folder.
4. spicetify patches Spotify’s resource files or injects CSS/JS at runtime.
5. Spotify restarts or reloads → UI reflects the chosen theme.

##### Architectural patterns & design principles
- **Plug-in architecture**: Each theme is a self-contained plugin.
- **Separation of concerns**: Themes are purely static assets; CLI logic is in spicetify-cli, and Spotify is unmodified.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% GitHub Repository
    subgraph "GitHub Repository"
        direction TB
        GitHubRepo["spicetify-themes\n(Repository Root)"]:::external
        Manifest["manifest.json\nTHEMES.md\nREADME.md"]:::static
        Metadata[".github/ISSUE_TEMPLATE/\nCONTRIBUTING.md\nCODE_OF_CONDUCT.md"]:::static
        subgraph "Theme Plugins"
            direction TB
            Blackout["Blackout/"]:::static
            Flow["Flow/"]:::static
            Default["Default/"]:::static
        end
        Extra["_Extra/"]:::directory
        DribbblishScripts["Dribbblish Scripts\n(install.ps1, uninstall.ps1, theme.js)"]:::exec
    end

    %% Local Environment
    LocalFS["Local Clone\n~/spicetify-themes"]:::directory

    %% spicetify-cli
    SpicetifyCLI["spicetify-cli\n(CLI Tool)"]:::exec

    %% Spotify
    Spotify["Spotify Desktop Client"]:::application

    %% External Services
    External["GitHub PRs / Reddit / Discord / AUR"]:::cloud

    %% Flows
    GitHubRepo -->|"git clone"| LocalFS
    LocalFS -->|"cp -r Themes → ~/.config/spicetify/Themes"| SpicetifyCLI
    SpicetifyCLI -->|"spicetify config current_theme"| SpicetifyCLI
    SpicetifyCLI -->|"inject CSS/JS\npatch UI"| Spotify
    Spotify -->|"render UI"| Spotify

    LocalFS -.->|"updates via git pull"| GitHubRepo
    User(["User"]):::external -->|"issues & PRs"| External
    User -->|"config commands"| SpicetifyCLI
    User -->|"copy themes"| SpicetifyCLI

    %% Click Events
    click GitHubRepo "https://github.com/spicetify/spicetify-themes/tree/master//"
    click Manifest "https://github.com/spicetify/spicetify-themes/blob/master//manifest.json"
    click Metadata "https://github.com/spicetify/spicetify-themes/blob/master//.github/ISSUE_TEMPLATE/bug_report.md"
    click Blackout "https://github.com/spicetify/spicetify-themes/tree/master//Blackout/"
    click Flow "https://github.com/spicetify/spicetify-themes/tree/master//Flow/"
    click Default "https://github.com/spicetify/spicetify-themes/tree/master//Default/"
    click Extra "https://github.com/spicetify/spicetify-themes/blob/master//_Extra/SpotifyNoControl/SpotifyNoControl.exe"
    click DribbblishScripts "https://github.com/spicetify/spicetify-themes/blob/master//Dribbblish/install.ps1"

    %% Styles
    classDef static fill:#D0E6FF,stroke:#0366D6
    classDef exec fill:#DFFFE0,stroke:#28A745
    classDef directory fill:#FFF5D0,stroke:#E36209
    classDef external fill:#E0F2FF,stroke:#0366D6
    classDef application fill:#FFE0B2,stroke:#FF9800
    classDef cloud fill:#EDEDED,stroke:#666666,stroke-dasharray: 2 2
```
