# tanisukegoro/dotfiles architecture

> Architecture diagram of the GitHub repository tanisukegoro/dotfiles, 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/tanisukegoro/dotfiles
- Repository: https://github.com/tanisukegoro/dotfiles

## Overview

##### Main Components
- Core Build/Installation Engine: Represent the top-level Makefile and scripts (in src/make) that drive the installation and cleaning routines.
- Modules Directory: Each subdirectory under “modules” (aerospace, bottom, code, editline, editorconfig, fish, gem, git, nvim, readline, starship, tig, tmux, vim, vimium) is a discrete configuration unit or “module”. They contain configuration files, tool-specific Makefiles, and sometimes additional metadata (like .toml files or JSON settings) that specify custom setups.
- Tool-Specific Components:
– Neovim: “modules/nvim” with init.vim and plugins.
– Fish Shell: “modules/fish” with its configuration (functions, completions, conf.d, etc.).
– Tmux: “modules/tmux” containing tmux configuration and README.
– Homebrew Backup: “config/homebrew” holds the Brewfile and other details.
– Others: git, vim, and additional tools with their respective configurations.
- External Dependencies/Services:
– Homebrew is used for package management with backup scripts.
– Plugin managers like coc.nvim for nvim are triggered post-installation.

##### Relationships and Data Flow
- The central Makefile (and its subsidiary scripts) functions as the controller that triggers installation, update, and cleanup processes.
- Each tool-specific module is invoked via its associated Makefile (e.g., “make nvim-install”, “make fish-install”, “make tmux-install”) which encapsulates the commands to deploy configurations.
- There is an “installation pipeline”: when a make command is executed, it reads from the module’s configuration files (such as keybindings, shell functions, and plugin settings) and applies them to the user’s environment.
- Homebrew commands (like “brew bundle” and “brew bundle dump”) interact with external package management, ensuring that dependencies are installed or backed up.

##### Important Architectural Patterns and Design Principles
- Modularity: The repository is broken down into small, self-contained modules, each responsible for a particular tool or configuration.
- Separation of Concerns: The configuration for each tool (nvim, fish, tmux, etc.) is neatly segregated into its own directory, making updates and extensions straightforward.
- Automation: The use of Makefiles across modules emphasizes automation of repetitive tasks like install, clean, and update.
- Declarative Configurations: Using files like .toml, JSON, and plain text configuration allows declarative management of settings.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["User Command"]:::userCommand --> B["Makefile/Controller \n(Makefile & Scripts)"]:::controller
    click B "https://github.com/tanisukegoro/dotfiles/blob/master/src/make/dot.mk"
    
    B --> C["Modules Directory"]:::modulesDir
    click C "https://github.com/tanisukegoro/dotfiles/tree/master/modules/"
    
    subgraph "Configuration Modules"
        D["Neovim Module"]:::module
        click D "https://github.com/tanisukegoro/dotfiles/tree/master/modules/nvim/"
        E["Fish Shell Module"]:::module
        click E "https://github.com/tanisukegoro/dotfiles/tree/master/modules/fish/"
        F["Tmux Module"]:::module
        click F "https://github.com/tanisukegoro/dotfiles/tree/master/modules/tmux/"
        G["Git Module"]:::module
        click G "https://github.com/tanisukegoro/dotfiles/tree/master/modules/git/"
        H["Vim Module"]:::module
        click H "https://github.com/tanisukegoro/dotfiles/tree/master/modules/vim/"
        I["Vimium Module"]:::module
        click I "https://github.com/tanisukegoro/dotfiles/tree/master/modules/vimium/"
    end
    
    C --> D
    C --> E
    C --> F
    C --> G
    C --> H
    C --> I

    B --> J["Homebrew Backup"]:::external
    click J "https://github.com/tanisukegoro/dotfiles/tree/master/config/homebrew/"

    %% Controller triggers installation routines for each module
    B -->|"install"| D
    B -->|"install"| E
    B -->|"install"| F
    B -->|"install"| G
    B -->|"install"| H
    B -->|"install"| I

    %% Neovim module integrates with external plugin manager
    D --> K["coc.nvim (Plugin Manager)"]:::external

    %% External dependency interaction for package management
    J -->|"brew_bundle"| B

    %% Note on automation lifecycle
    L["Install/Clean/Update Lifecycle"]:::note
    B --- L

    %% Styles
    classDef userCommand fill:#FDF6E3,stroke:#657B83,stroke-width:2px;
    classDef controller fill:#B3CDE0,stroke:#03396C,stroke-width:2px;
    classDef modulesDir fill:#CDEBB0,stroke:#277F00,stroke-width:2px;
    classDef module fill:#CCEBC5,stroke:#2B8CBE,stroke-width:2px;
    classDef external fill:#FEE0D2,stroke:#D95F02,stroke-dasharray: 5,5,stroke-width:2px;
    classDef note fill:#EEE8AA,stroke:#999,stroke-dasharray: 5,5,stroke-width:2px;
```
