# jpmelos/dotfiles architecture

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

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

## Overview

##### Main components
- Dotfiles Repository (Core)
- GNU stow (the deployment/symlink mechanism)
- Shell Configurations (e.g. .bashrc, .bash_profile)
- Git Configurations (.gitconfig, .gitignore, etc.)
- Neovim Configurations
- The .config/nvim directory
- Core directory, plugins, and ftplugin configurations inside “jpmelos” subdirectories that set up the behavior of Neovim as per the user's personal preferences.
- WezTerm Configurations (under .config/wezterm)
- Other Miscellaneous configuration files (e.g., .psqlrc, .ripgreprc, stylua.toml)

##### Establish relationships and interactions
- Each configuration group (shell, git, Neovim, WezTerm, etc.) should be represented as a distinct node that is “deployed” via stow to a particular directory in the system.
- Interactions between different sub-components if applicable (e.g., Neovim’s configuration references plugins and filetype-specific settings might interact with language-specific configurations).

##### Architectural patterns and design principles
- Separation of Concerns: Each group of configurations is kept in its own directory (e.g., .config/nvim for Neovim, .config/wezterm for WezTerm, etc.).
- Modularity: The use of stow allows for modular management and isolated updates by letting you “stow” selected directories separately.
- Extensibility: The repository is structured to easily add or update configurations (notice the detailed structure within the Neovim settings, including a central “jpmelos” theme).

a. Central Node: Dotfiles Repository
c. Configuration Categories:
- Shell (Bash configuration files like .bashrc, .bash_profile)
- Git (gitconfig, gitignore and related reference files)
- Neovim (comprising multiple subcomponents: core config, plugins such as cmp-nvim-lsp, treesitter integrations, etc.)
- WezTerm (keys.lua, appearance.lua, nvim-integration.lua, etc.)
- Others (additional references for iptables, SQL formatting, etc.)

##### Elements
- Clear labels for each major component (e.g., “Shell Configurations”, “Git Configurations”, “Neovim Configurations”, etc.).
- Another for static configuration files and directories.
- Annotations summarizing the function of each component (for example, “Neovim Plugins - Manage editor enhancements” or “WezTerm Config - Terminal appearance and behavior”).

- The central dotfiles repository,
- Its structure into logical configuration domains,
- The role of GNU stow in deploying these settings,
- And the manner these individual components prepare an integrated development environment.

By detailing these connections and modules, you provide a strong visual map that accurately represents the architectural setup of the dotfiles project. This approach ensures clarity, modularity, and precision for understanding how the entire configuration system interacts and is deployed onto a system.

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    repo("Dotfiles Repository"):::repo
    stow("GNU stow (Deployment)"):::deploy

    repo --> stow

    subgraph "Configuration Categories"
        direction TB
        shell("Shell Configurations"):::config
        git("Git Configurations"):::config
        nvim("Neovim Configurations"):::advanced
        wezterm("WezTerm Configurations"):::config
        misc("Other Configurations"):::config
    end

    stow -->|"deploys"| shell
    stow -->|"deploys"| git
    stow -->|"deploys"| nvim
    stow -->|"deploys"| wezterm
    stow -->|"deploys"| misc

    %% Shell Subgraph
    subgraph "Shell Files"
        direction TB
        shell_bashrc(" .bashrc"):::config
        shell_bashprofile(" .bash_profile"):::config
        shell_bashfields(" .bash_fields.sh"):::config
    end
    shell --> shell_bashrc
    shell --> shell_bashprofile
    shell --> shell_bashfields

    %% Git Subgraph
    subgraph "Git Files"
        direction TB
        git_config(" .gitconfig"):::config
        git_funcs(" .gitfunctions"):::config
        git_ignore(" .gitignore"):::config
        git_ignore_global(" .gitignore-global"):::config
    end
    git --> git_config
    git --> git_funcs
    git --> git_ignore
    git --> git_ignore_global

    %% Neovim Subgraph
    subgraph "Neovim Details"
        direction TB
        nvim_main("Main Config (.config/nvim)"):::advanced
        nvim_jpm("jpmelos Settings (.config/nvim/lua/jpmelos)"):::advanced
        nvim_ft("After ftplugin (.config/nvim/after/ftplugin)"):::advanced
    end
    nvim --> nvim_main
    nvim --> nvim_jpm
    nvim --> nvim_ft

    %% WezTerm Subgraph
    subgraph "WezTerm Details"
        direction TB
        wezterm_keys("keys.lua"):::config
        wezterm_appearance("appearance.lua"):::config
        wezterm_integration("nvim-integration.lua"):::config
        wezterm_config("wezterm.lua"):::config
    end
    wezterm --> wezterm_keys
    wezterm --> wezterm_appearance
    wezterm --> wezterm_integration
    wezterm --> wezterm_config

    %% Other Configurations Subgraph
    subgraph "Other Configurations Details"
        direction TB
        other_psql(" .psqlrc"):::config
        other_ripgrep(" .ripgreprc"):::config
        other_stylua("stylua.toml"):::config
        other_refs("References (references/)"):::config
    end
    misc --> other_psql
    misc --> other_ripgrep
    misc --> other_stylua
    misc --> other_refs

    %% Click Events
    click repo "https://github.com/jpmelos/dotfiles/tree/master/Repository root"
    click stow "https://github.com/jpmelos/dotfiles/blob/master/.stowrc"
    click stow "https://github.com/jpmelos/dotfiles/blob/master/.stow-local-ignore"
    click shell_bashrc "https://github.com/jpmelos/dotfiles/blob/master/.bashrc"
    click shell_bashprofile "https://github.com/jpmelos/dotfiles/blob/master/.bash_profile"
    click shell_bashfields "https://github.com/jpmelos/dotfiles/blob/master/.bash_fields.sh"
    click git_config "https://github.com/jpmelos/dotfiles/blob/master/.gitconfig"
    click git_funcs "https://github.com/jpmelos/dotfiles/blob/master/.gitfunctions"
    click git_ignore "https://github.com/jpmelos/dotfiles/blob/master/.gitignore"
    click git_ignore_global "https://github.com/jpmelos/dotfiles/blob/master/.gitignore-global"
    click nvim_main "https://github.com/jpmelos/dotfiles/tree/master/.config/nvim"
    click nvim_jpm "https://github.com/jpmelos/dotfiles/tree/master/.config/nvim/lua/jpmelos"
    click nvim_ft "https://github.com/jpmelos/dotfiles/tree/master/.config/nvim/after/ftplugin"
    click wezterm_keys "https://github.com/jpmelos/dotfiles/blob/master/.config/wezterm/keys.lua"
    click wezterm_appearance "https://github.com/jpmelos/dotfiles/blob/master/.config/wezterm/appearance.lua"
    click wezterm_integration "https://github.com/jpmelos/dotfiles/blob/master/.config/wezterm/nvim-integration.lua"
    click wezterm_config "https://github.com/jpmelos/dotfiles/blob/master/.config/wezterm/wezterm.lua"
    click other_psql "https://github.com/jpmelos/dotfiles/blob/master/.psqlrc"
    click other_ripgrep "https://github.com/jpmelos/dotfiles/blob/master/.ripgreprc"
    click other_stylua "https://github.com/jpmelos/dotfiles/blob/master/stylua.toml"
    click other_refs "https://github.com/jpmelos/dotfiles/tree/master/references/"

    %% Styles
    classDef repo fill:#f9c,stroke:#333,stroke-width:2px
    classDef deploy fill:#bbf,stroke:#333,stroke-width:2px
    classDef config fill:#dfd,stroke:#333,stroke-width:2px
    classDef advanced fill:#fcc,stroke:#333,stroke-width:2px
```
