# mellbourn/dotfiles architecture

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

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

## Overview

##### Main Components

a. Configuration Management Layer
- YADM Core (central component)
- Git-crypt (for encryption)
- Bootstrap Scripts
- Platform-specific Configurations

b. Configuration Categories (group these as subsystems)
- Shell Configurations (.zshrc, .bashrc, .profile)
- Development Tools (.gitconfig, .vimrc, VS Code)
- Security (.gnupg, .ssh)
- Package Managers (Homebrew, apt)
- Application Configs (.config directory contents)

**┌─ Platform Layer ─────────────────────┐**
- MacOS │ WSL │ Ubuntu/Debian │
- ┘
- ↑
**┌─ Configuration Management Layer ──────┐**
- ┌─ YADM Core ─┐                   │
- Git Backend │                   │
- Git-crypt   │                   │
- ┘                   │
- ↕                          │
- ┌─ Bootstrap ─┐     ┌─ Config ─┐  │
- Main        │     │ Shell    │  │
- Customer    │ ←→  │ Dev      │  │
- Sudo        │     │ Security │  │
- ┘     └─────────┘   │
- ┘
- ↓
**┌─ File System Layer ──────────────────┐**
- Dotfiles │ Configs │ Scripts │
- ┘

##### Important Relationships

- Platform-specific configuration flow with conditional paths
- Encrypted files with a lock symbol (git-crypt managed files)
- Bootstrap script execution flow

##### Additional Elements

- External dependencies (Homebrew, apt)
- Template/generated files

##### Implementation Details

- Use standardized UML or C4 model notation
- Keep component sizes proportional to their complexity
- Brief annotations for complex interactions

- Cross-platform compatibility
- Security-first approach (git-crypt, SSH, GPG)
- Automated setup (bootstrap scripts)
- Modular configuration management

Remember to maintain a balance between detail and clarity, focusing on the architectural decisions that make this dotfiles management system effective across different platforms while maintaining security and automation capabilities.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Platform Layer
    subgraph PL[Platform Layer]
        direction TB
        MacOS["MacOS"]
        WSL["WSL"]
        Ubuntu["Ubuntu/Debian"]
    end

    %% Configuration Management Layer
    subgraph CML[Configuration Management Layer]
        direction TB
        subgraph YC[YADM Core]
            YADM["YADM"]:::core
            Git["Git Backend"]:::core
            GC["Git-crypt"]:::security
        end

        subgraph BS[Bootstrap System]
            Main["Main Bootstrap"]:::bootstrap
            Customer["Customer Bootstrap"]:::bootstrap
            Sudo["Sudo Bootstrap"]:::bootstrap
        end

        subgraph Configs[Configuration Categories]
            Shell["Shell Configs"]:::config
            Dev["Dev Tools"]:::config
            Security["Security"]:::config
            PM["Package Managers"]:::config
            AppConfig["Application Configs"]:::config
        end
    end

    %% File System Layer
    subgraph FSL[File System Layer]
        Dotfiles["Dotfiles"]:::files
        ConfigFiles["Config Files"]:::files
        Scripts["Scripts"]:::files
    end

    %% Relationships
    PL --> CML
    CML --> FSL
    
    YADM <--> Git
    Git <--> GC
    
    YC --> BS
    BS <--> Configs
    
    Configs --> FSL
    
    %% Click Events
    click YADM "https://github.com/Mellbourn/dotfiles/tree/main/.config/yadm/"
    click GC "https://github.com/Mellbourn/dotfiles/tree/main/.git-crypt/"
    click Main "https://github.com/Mellbourn/dotfiles/tree/main/.config/yadm/bootstrap"
    click Customer "https://github.com/Mellbourn/dotfiles/tree/main/.config/yadm/bootstrap-customer"
    click Sudo "https://github.com/Mellbourn/dotfiles/tree/main/.config/yadm/bootstrap-sudo"
    click Shell "https://github.com/Mellbourn/dotfiles/blob/main/.zshrc"
    click Dev "https://github.com/Mellbourn/dotfiles/blob/main/.gitconfig"
    click Security "https://github.com/Mellbourn/dotfiles/tree/main/.gnupg/"
    click PM "https://github.com/Mellbourn/dotfiles/blob/main/.config/yadm/brew.ini"
    click AppConfig "https://github.com/Mellbourn/dotfiles/tree/main/.config/"
    
    %% Styling
    classDef core fill:#90EE90
    classDef security fill:#FFD700
    classDef bootstrap fill:#FF6B6B
    classDef config fill:#A9A9A9
    classDef files fill:#E0E0E0
    
    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Security Components"]:::security
        L3["Bootstrap Scripts"]:::bootstrap
        L4["Configurations"]:::config
        L5["File System"]:::files
    end
```
