# plax-00/.dotfiles architecture

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

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

## Overview

##### Project Type & Purpose
- This repository is a “dotfiles” (personal configuration) project.
- Its goal is to bootstrap and orchestrate your development environment: shell (Zsh), terminal multiplexers (tmux, Zellij), and Neovim, along with helper scripts.

##### High‐level Components
a. Host Operating System (macOS/Linux)
b. Terminal Emulator (iTerm2, Alacritty, etc.)
c. Shell Layer
– Zsh with ~/.zprofile, ~/.zshrc, functions & plugins
d. Multiplexer Layer
– tmux (tmux.conf)
– Zellij (config.kdl & layouts)
e. Editor Layer
– Neovim (nvim/init.lua, plugin configs, LSP configs)
f. Utility Scripts
– scripts/zsh/*.sh
g. Version Control
– Git repository (Makefile, .gitignore)
h. External Services
– Git remotes (GitHub) for plugin repos
– LSP Servers (rust-analyzer, pyright, etc.) pulled in by nvim-lspconfig
– Plugin registries (npm for treesitter, GitHub for telescope)

##### Relationships & Data Flows
- The OS launches the Terminal Emulator.
- The Terminal loads Zsh, which in turn sources dotfiles (aliases, completions, functions).
- Zsh invokes either tmux or Zellij sessions (depending on preference/layout).
- Within each pane, Neovim is launched:
- init.lua sets up Lazy.nvim (lazy-lock.json) to fetch and manage plugins.
- Plugins (treesitter, telescope, lsp) are loaded, triggering LSP servers.
- Utility scripts are invoked from Zsh or Neovim (e.g., edit-command-line-history).
- Makefile targets (e.g., install, sync) bootstrap or update the entire configuration.
- Git manages versioning and syncing to remote.

##### Architectural Patterns & Principles
- Layered Architecture: clear separation between Shell, Multiplexer, Editor, and Utilities.
- Declarative Configuration: all settings are code (lua, kdl, zsh scripts).
- Plugin‐driven Extensibility: uses lazy loading (lazy.nvim) to keep startup fast.
- DRY and Reusability: shared functions, centralized LSP server configs.

##### Final Advice
- Keep it detailed but clean: avoid overly granular file lists—focus on directories and their roles.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Local Components
    subgraph "Local Components"
        direction TB
        OS["Host OS (macOS/Linux)"]:::localComp
        Terminal["Terminal Emulator\n(iTerm2, Alacritty)"]:::localComp
        Shell["Shell Layer (Zsh)"]:::localComp
    end

    OS -->|launches| Terminal
    Terminal -->|loads| Shell

    %% Shell details
    Shell -->|"sources dotfiles"| Dotfiles["Dotfiles\n(.zprofile, .zshrc, config/, functions/)"]:::localComp
    click Shell "https://github.com/plax-00/.dotfiles/tree/base/zsh/"

    %% Productivity Tools
    subgraph "Productivity Tools"
        direction TB
        subgraph "Multiplexer"
            direction TB
            Tmux["tmux"]:::prodTools
            Zellij["Zellij"]:::prodTools
        end
        Editor["Neovim\n(init.lua, plugin configs)"]:::prodTools
    end

    Shell -->|invokes| Tmux
    Shell -->|invokes| Zellij
    Tmux -->|pane launches| Editor
    Zellij -->|pane launches| Editor

    click Tmux "https://github.com/plax-00/.dotfiles/blob/base/tmux/tmux.conf"
    click Zellij "https://github.com/plax-00/.dotfiles/tree/base/zellij/"

    %% Data Store for plugins
    LazyLock["lazy-lock.json"]:::dataStore
    Editor -->|"manages plugins via Lazy.nvim"| LazyLock

    %% Scripts
    Scripts["Utility Scripts"]:::localComp
    Shell -->|invokes| Scripts
    Editor -->|invokes| Scripts
    click Scripts "https://github.com/plax-00/.dotfiles/blob/base/scripts/zsh/zshenv.sh"

    %% Version Control & Bootstrapping
    subgraph "Version Control & Bootstrapping"
        direction TB
        MakefileNode["Makefile"]:::localComp
        GitIgnore[".gitignore"]:::localComp
        GitConfig["git/config"]:::localComp
        Readme["README.md"]:::localComp
    end

    MakefileNode -->|bootstraps/syncs| Shell
    MakefileNode -->|bootstraps/syncs| Editor
    MakefileNode -.->|updates| Dotfiles
    click MakefileNode "https://github.com/plax-00/.dotfiles/tree/base/Makefile"
    click GitIgnore "https://github.com/plax-00/.dotfiles/blob/base/.gitignore"
    click GitConfig "https://github.com/plax-00/.dotfiles/tree/base/git/config"
    click Readme "https://github.com/plax-00/.dotfiles/blob/base/README.md"

    %% External Dependencies
    subgraph "External Dependencies"
        direction TB
        GitHub["GitHub (plugin repos)"]:::external
        LSPServers["LSP Servers\n(rust-analyzer, pyright)"]:::external
        PluginRegs["Plugin Registries\n(npm, GitHub)"]:::external
    end

    Dotfiles -->|plugin list| GitHub
    LazyLock -->|fetches plugins| PluginRegs
    Editor -->|starts| LSPServers

    %% Styles
    classDef localComp fill:#AEDFF7,stroke:#036B99,color:#000;
    classDef prodTools fill:#D4F8E8,stroke:#10714A,color:#000;
    classDef external fill:#FDE2E4,stroke:#B71C1C,color:#000;
    classDef dataStore fill:#FFF4C1,stroke:#B8860B,color:#000;
```
