# pavanivitor/dotfiles architecture

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

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

## Overview

##### Project type and purpose
- This is a “dotfiles” repository whose sole purpose is to store and manage your shell and editor configuration files.
- You use GNU Stow (installed via Pacman) and an install script to symlink these configs into your home directory.

##### File structure
- Top-level:
- .gitignore, .gitmodules – version control setup
- install.sh – orchestrates the deployment
- Directories named by tool: alacritty, bash, git, nvim, rofi, tmux
- Each tool folder mirrors the structure of your home or ~/.config (e.g., alacritty/.config/alacritty/alacritty.toml, nvim/.config/nvim/init.lua, etc.)
- Stow will treat each of those folders as a “package” and create symlinks in your $HOME, pointing from dotfiles → live config files.

##### README
- Confirms we install stow (`sudo pacman -S stow`), then run `./install.sh`.
- The install script likely:
a. Iterates over each package directory
b. Invokes `stow -v <package>` to create symlinks in the home directory

##### Main components
a. Dotfiles Git repository (source)
b. install.sh script (deployer)
c. GNU Stow tool
d. Package directories (alacritty, bash, git, nvim, rofi, tmux) inside the repo
e. Target locations in the user environment (e.g., ~/.config/alacritty, ~/.bashrc, ~/.gitconfig, ~/.config/nvim, ~/.config/rofi, ~/.tmux.conf)
f. External dependency: Pacman (for stow)

##### Relationships and interactions
- User runs: `pacman → installs stow`
- User runs: `./install.sh` → calls `stow` for each package folder
- Stow reads “package” folder, then creates symlinks pointing from `$HOME` (and subdirectories) to the files in the repo
- The shell, terminal, editor, etc., then read from these symlinked locations at runtime

##### Architectural patterns / design principles
- Single repository pattern with multiple packages
- Declarative configuration: folder structure mirrors deployment targets
- Idempotent deployment via stow (reproducible, reversible)

##### Technologies and tools
- Git (for version control, possible submodules)
- GNU Stow (for symlink-based deployment)
- Bash (install script)
- Pacman (install dependency)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Source Artifacts
    subgraph "Dotfiles Repository"
        direction TB
        GitRepo(("Git Repository")):::source
        GITIGNORE[".gitignore"]:::source
        GITMODULES[".gitmodules"]:::source
        README["README.md"]:::source
    end

    %% Process Entities
    Pacman(["Pacman"]):::external
    InstallScript["install.sh"]:::source
    Stow(("GNU Stow")):::process

    %% Package Directories
    subgraph "Packages" 
        direction TB
        subgraph "alacritty" 
            direction TB
            AlacFile["alacritty.toml"]:::package
        end
        subgraph "bash"
            direction TB
            BashFile[".bashrc"]:::package
        end
        subgraph "git"
            direction TB
            GitConfig[".gitconfig"]:::package
            GitIgnoreLocal[".stow-local-ignore"]:::package
            GitIgnorePkg[".gitignore"]:::package
        end
        subgraph "nvim"
            direction TB
            InitLua["init.lua"]:::package
            LazyLock["lazy-lock.json"]:::package
            LuaUser["lua/user/..."]:::package
        end
        subgraph "rofi"
            direction TB
            RofiConfig["config.rasi"]:::package
        end
        subgraph "tmux"
            direction TB
            TmuxFile[".tmux.conf"]:::package
        end
    end

    %% Target Locations
    subgraph "User Environment"
        direction TB
        Home[/"$HOME"/]:::target
        ConfigAlac["~/.config/alacritty"]:::target
        BashRC["~/.bashrc"]:::target
        GitConfigTarget["~/.gitconfig"]:::target
        NvimConfig["~/.config/nvim"]:::target
        RofiDir["~/.config/rofi"]:::target
        TmuxConf["~/.tmux.conf"]:::target
    end

    %% Connections
    Pacman -->|"installs"| Stow
    InstallScript -->|"executes"| Stow
    GitRepo -->|contains| InstallScript
    GitRepo -->|contains| GITIGNORE
    GitRepo -->|contains| GITMODULES
    GitRepo -->|contains| README

    Stow -->|reads package| AlacFile
    Stow -->|reads package| BashFile
    Stow -->|reads package| GitConfig
    Stow -->|reads package| GitIgnoreLocal
    Stow -->|reads package| GitIgnorePkg
    Stow -->|reads package| InitLua
    Stow -->|reads package| LazyLock
    Stow -->|reads package| LuaUser
    Stow -->|reads package| RofiConfig
    Stow -->|reads package| TmuxFile

    Stow -->|creates symlink| ConfigAlac
    ConfigAlac --> ConfigAlac
    Stow -->|creates symlink| BashRC
    Stow -->|creates symlink| GitConfigTarget
    Stow -->|creates symlink| NvimConfig
    Stow -->|creates symlink| RofiDir
    Stow -->|creates symlink| TmuxConf

    %% Click Events
    click GITIGNORE "https://github.com/pavanivitor/dotfiles/blob/main/.gitignore"
    click GITMODULES "https://github.com/pavanivitor/dotfiles/blob/main/.gitmodules"
    click README "https://github.com/pavanivitor/dotfiles/blob/main/README.md"
    click InstallScript "https://github.com/pavanivitor/dotfiles/blob/main/install.sh"
    click AlacFile "https://github.com/pavanivitor/dotfiles/blob/main/alacritty/.config/alacritty/alacritty.toml"
    click BashFile "https://github.com/pavanivitor/dotfiles/blob/main/bash/.bashrc"
    click GitConfig "https://github.com/pavanivitor/dotfiles/blob/main/git/.gitconfig"
    click GitIgnoreLocal "https://github.com/pavanivitor/dotfiles/blob/main/git/.stow-local-ignore"
    click GitIgnorePkg "https://github.com/pavanivitor/dotfiles/blob/main/git/.gitignore"
    click InitLua "https://github.com/pavanivitor/dotfiles/blob/main/nvim/.config/nvim/init.lua"
    click LazyLock "https://github.com/pavanivitor/dotfiles/blob/main/nvim/.config/nvim/lazy-lock.json"
    click LuaUser "https://github.com/pavanivitor/dotfiles/tree/main/nvim/.config/nvim/lua/user/"
    click RofiConfig "https://github.com/pavanivitor/dotfiles/blob/main/rofi/.config/rofi/config.rasi"
    click TmuxFile "https://github.com/pavanivitor/dotfiles/blob/main/tmux/.tmux.conf"

    %% Styles
    classDef source fill:#cce5ff,stroke:#005cbf,color:#004085
    classDef process fill:#d4edda,stroke:#155724,color:#155724
    classDef package fill:#fff3cd,stroke:#856404,color:#856404
    classDef target fill:#ffe5b4,stroke:#cc7a00,color:#663c00
    classDef external fill:#f8d7da,stroke:#721c24,color:#721c24

    %% Legend
    subgraph "Legend"
        direction TB
        A["Source Artifacts"]:::source
        B["Process/Tools"]:::process
        C["Package Directories"]:::package
        D["Target Locations"]:::target
        E["External Dependency"]:::external
    end
```
