# neko-neko/dotfiles architecture

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

- Interactive diagram: https://gitdiagram.com/neko-neko/dotfiles
- Repository: https://github.com/neko-neko/dotfiles

## Overview

##### Main components
- Setup and Installation Scripts:
- The “setup” directory contains multiple installation scripts (install.zsh, sub-scripts in setup/install/ and the uninstall.zsh). This forms the entry point for setting up a new machine.
- Configuration Files:
- “config” directory holds subdirectories for specific applications:
- helix (editor configuration with config.toml and languages.toml)
- karabiner (keyboard/mouse customization including assets and complex modifications)
- mise, sheldon, and starship are for other specific tools
- Command-Line Utilities and Custom Scripts:
- “bin” directory includes executables (e.g., epoch, various “fzf-” scripts, sha256). These scripts likely extend or automate command-line workflows.
- Shell and Environment Configuration:
- Files such as .gitignore, .zshenv, .zshrc, gitconfig, editorconfig, and others define environment behaviors and developer preferences.
- Additional Resources:
- VSCode settings (in the vscode directory)
- WezTerm configuration (wezterm.lua)
- “functions” directory containing further shell functions (e.g., fzf-history)
- “aliases” file for command shortcuts

##### Relationships and interactions
- The installation scripts (in “setup”) are responsible for deploying the configurations and custom scripts.
- The configuration files control the behavior of separate applications, like the shell (zsh), text editors (Helix), terminal emulators (WezTerm), and other utilities (Karabiner and VSCode).
- The executable scripts (in “bin”) and functions help integrate these configurations with enhanced productivity tools (for example, integration with fzf for fuzzy search in different contexts).

##### Architectural patterns and design principles
- Modular configuration: Each subdirectory in “config” deals with one application or purpose, following a separation of concerns.
- Script-driven automation: The setup/installation scripts are orchestrated in sequentially numbered files (install/01_brew.zsh, install/02_gnu.zsh, etc.), which show a step-by-step bootstrapping process.
- Extensibility: The repository is structured in a way that allows for straightforward extensions (adding more config directories, additional command line scripts, or further environment variables).

##### Relevant technologies and tools
- Shell scripting (zsh)
- JSON and TOML configuration files for applications like Helix, Karabiner, and Sheldon's plugin manager.
- CI integration via GitHub actions (in .github/workflows/ci.yml) for testing the dotfiles setup.
- Editor and terminal customization (VSCode settings, wezterm.lua, etc.)

## Diagram (Mermaid)

```mermaid
flowchart TD
    Repo["Dotfiles Repository"]:::repo

    %% Setup and Installation Scripts Subgraph
    subgraph "Setup & Installation"
        Setup["Installation Scripts (setup/)"]:::setup
    end

    %% Configuration Modules Subgraph
    subgraph "Configuration Modules"
        ConfigGroup["Configuration Files (config/)"]:::config
        Helix["Helix Config (config/helix)"]:::config
        Karabiner["Karabiner Config (config/karabiner)"]:::config
        Mise["Mise Config (config/mise)"]:::config
        Sheldon["Sheldon Config (config/sheldon)"]:::config
        Starship["Starship Config (config/starship.toml)"]:::config
    end

    %% Command-Line Utilities Subgraph
    subgraph "Command-Line Utilities"
        Bin["Executable Scripts (bin/)"]:::cli
        Functions["Shell Functions (functions/)"]:::cli
    end

    %% Shell & Environment Configuration Subgraph
    subgraph "Shell & Environment Configurations"
        Zshenv[".zshenv"]:::shell
        Zshrc[".zshrc"]:::shell
        Aliases["aliases"]:::shell
        Gitignore[".gitignore"]:::shell
        Gitconfig["gitconfig"]:::shell
        Editorconfig["editorconfig"]:::shell
        GlobalGitignore["gitignore_global"]:::shell
        Gemrc["gemrc"]:::shell
    end

    %% Additional Resources Subgraph
    subgraph "Additional Resources"
        VSCode["VSCode Settings (vscode/)"]:::resource
        Wezterm["WezTerm Config (wezterm.lua)"]:::resource
    end

    %% CI Pipeline
    CI["CI Pipeline (.github/workflows/ci.yml)"]:::ci

    %% Relationships from Repo to all main components
    Repo --> Setup
    Repo --> ConfigGroup
    Repo --> Bin
    Repo --> Functions
    Repo --> Zshenv
    Repo --> VSCode
    Repo --> CI

    %% Setup Scripts trigger configurations and utilities
    Setup -->|"deploys"| ConfigGroup
    Setup -->|"deploys"| Bin
    Setup -->|"deploys"| Functions
    Setup -->|"deploys"| Zshenv
    Setup -->|"deploys"| VSCode

    %% Internal relationships within Configuration Modules
    ConfigGroup --> Helix
    ConfigGroup --> Karabiner
    ConfigGroup --> Mise
    ConfigGroup --> Sheldon
    ConfigGroup --> Starship

    %% Connect Shell & Environment files (grouped visually)
    Repo --- Zshrc
    Repo --- Aliases
    Repo --- Gitignore
    Repo --- Gitconfig
    Repo --- Editorconfig
    Repo --- GlobalGitignore
    Repo --- Gemrc

    %% Add Additional Resource details connections
    VSCode --- Wezterm

    %% Styles
    classDef repo fill:#f9f,stroke:#333,stroke-width:2px;
    classDef setup fill:#c2f0c2,stroke:#333,stroke-width:2px;
    classDef config fill:#c2d6f0,stroke:#333,stroke-width:2px;
    classDef cli fill:#f0d6c2,stroke:#333,stroke-width:2px;
    classDef shell fill:#e0c2f0,stroke:#333,stroke-width:2px;
    classDef resource fill:#c2f0e0,stroke:#333,stroke-width:2px;
    classDef ci fill:#f0c2c2,stroke:#333,stroke-width:2px;

    %% Click Events
    click Setup "https://github.com/neko-neko/dotfiles/tree/master/setup/"
    click ConfigGroup "https://github.com/neko-neko/dotfiles/tree/master/config/"
    click Helix "https://github.com/neko-neko/dotfiles/tree/master/config/helix"
    click Karabiner "https://github.com/neko-neko/dotfiles/tree/master/config/karabiner"
    click Mise "https://github.com/neko-neko/dotfiles/tree/master/config/mise"
    click Sheldon "https://github.com/neko-neko/dotfiles/tree/master/config/sheldon"
    click Starship "https://github.com/neko-neko/dotfiles/blob/master/config/starship.toml"
    click Bin "https://github.com/neko-neko/dotfiles/tree/master/bin/"
    click Functions "https://github.com/neko-neko/dotfiles/tree/master/functions/"
    click Zshenv "https://github.com/neko-neko/dotfiles/blob/master/.zshenv"
    click Zshrc "https://github.com/neko-neko/dotfiles/blob/master/.zshrc"
    click Aliases "https://github.com/neko-neko/dotfiles/tree/master/aliases"
    click Gitignore "https://github.com/neko-neko/dotfiles/blob/master/.gitignore"
    click Gitconfig "https://github.com/neko-neko/dotfiles/tree/master/gitconfig"
    click Editorconfig "https://github.com/neko-neko/dotfiles/tree/master/editorconfig"
    click GlobalGitignore "https://github.com/neko-neko/dotfiles/tree/master/gitignore_global"
    click Gemrc "https://github.com/neko-neko/dotfiles/tree/master/gemrc"
    click VSCode "https://github.com/neko-neko/dotfiles/blob/master/vscode/settings.json"
    click Wezterm "https://github.com/neko-neko/dotfiles/blob/master/wezterm.lua"
    click CI "https://github.com/neko-neko/dotfiles/blob/master/.github/workflows/ci.yml"
```
