# matthiashamacher/dotfiles architecture

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

## Overview

##### Project Type and Purpose
This is a configuration management and system automation project specifically designed for MacOS environments, using Ansible as the primary automation tool. The project automates the setup and maintenance of a development environment.

##### Main Components

A. Core Components:
- Ansible Controller (Central orchestrator)
- Vault Management System
- Role Management System
- Task Execution Engine

B. Configuration Groups:
- Development Tools (git, node, php, etc.)
- System Applications (homebrew, mas)
- Security Tools (gpg, ssh)
- Shell Environment (zsh)
- GUI Applications

**[User Input Layer]**

- ▼
**[Control Layer]**
- Dotfiles Script (bin/dotfiles)
- Ansible Controller

**[Configuration Layer]**
- Vault Management
- Group Variables
- Pre-tasks

**[Role Execution Layer]**
- System Roles
- Development Roles
- Security Roles
- Application Roles

**[Target System]**
- MacOS Host

##### Specific Elements

- Blue: Core control components
- Green: Configuration management
- Yellow: Security-related components
- Gray: Application installation roles
- Red: Critical system components

b. Flow Indicators:

##### Key Relationships to Highlight

- How the bin/dotfiles script interfaces with Ansible
- Role dependency chain (meta/main.yml relationships)
- Demonstrate how vault secrets are integrated
- Interaction between group_vars and roles

##### Implementation Details

a. Control Flow:
- Entry point through bin/dotfiles script
- Ansible playbook execution
- Role-based task execution
- Variables application

b. Configuration Management:
- Vault secret management
- Variables hierarchy
- Role-specific configurations

##### Technical Notes

- Use standardized symbols for Ansible components
- Version control integration points
- External dependency management
- Automation touchpoints

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph User["User Input Layer"]
        UI[User Input]
    end

    subgraph Control["Control Layer"]
        DS["Dotfiles Script"]
        AC["Ansible Controller"]
        CB["Callback Plugins"]
    end

    subgraph Config["Configuration Layer"]
        VM["Vault Management"]
        GV["Group Variables"]
        PT["Pre-tasks"]
    end

    subgraph Roles["Role Execution Layer"]
        subgraph System["System Roles"]
            HB["Homebrew"]
            MAS["Mac App Store"]
        end

        subgraph Dev["Development Roles"]
            GIT["Git"]
            NODE["Node"]
            PHP["PHP"]
            COMP["Composer"]
            VSC["VS Code"]
        end

        subgraph Security["Security Roles"]
            GPG["GPG"]
            SSH["SSH"]
        end

        subgraph Shell["Shell Environment"]
            ZSH["ZSH Configuration"]
        end

        subgraph Apps["GUI Applications"]
            SLACK["Slack"]
            SPOT["Spotify"]
            RAY["Raycast"]
            RECT["Rectangle"]
            WARP["Warp"]
        end
    end

    subgraph Target["Target System"]
        MAC["MacOS Host"]
    end

    %% Connections
    UI --> DS
    DS --> AC
    AC --> CB
    AC --> VM
    AC --> GV
    AC --> PT

    VM -.-> System
    VM -.-> Security
    GV --> System
    GV --> Dev
    GV --> Security
    GV --> Shell
    GV --> Apps

    System --> MAC
    Dev --> MAC
    Security --> MAC
    Shell --> MAC
    Apps --> MAC

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef control fill:#b3d9ff,stroke:#333
    classDef config fill:#90EE90,stroke:#333
    classDef security fill:#FFE5B4,stroke:#333
    classDef system fill:#E6E6FA,stroke:#333
    classDef apps fill:#FFB6C1,stroke:#333

    class AC,CB,DS control
    class VM,GV,PT config
    class GPG,SSH security
    class HB,MAS system
    class SLACK,SPOT,RAY,RECT,VSC,WARP apps

    %% Click Events
    click DS "https://github.com/matthiashamacher/dotfiles/tree/main/bin/dotfiles"
    click AC "https://github.com/matthiashamacher/dotfiles/blob/main/ansible.cfg"
    click CB "https://github.com/matthiashamacher/dotfiles/blob/main/callback_plugins/beautiful_output.py"
    click VM "https://github.com/matthiashamacher/dotfiles/blob/main/group_vars/all/vault.yml"
    click PT "https://github.com/matthiashamacher/dotfiles/blob/main/pre_tasks/whoami.yml"
    click HB "https://github.com/matthiashamacher/dotfiles/tree/main/roles/homebrew"
    click MAS "https://github.com/matthiashamacher/dotfiles/tree/main/roles/mac_app_store"
    click GIT "https://github.com/matthiashamacher/dotfiles/tree/main/roles/git"
    click NODE "https://github.com/matthiashamacher/dotfiles/tree/main/roles/node"
    click PHP "https://github.com/matthiashamacher/dotfiles/tree/main/roles/php"
    click COMP "https://github.com/matthiashamacher/dotfiles/tree/main/roles/composer"
    click VSC "https://github.com/matthiashamacher/dotfiles/tree/main/roles/visual_studio_code"
    click GPG "https://github.com/matthiashamacher/dotfiles/tree/main/roles/gnupg"
    click SSH "https://github.com/matthiashamacher/dotfiles/tree/main/roles/ssh"
    click ZSH "https://github.com/matthiashamacher/dotfiles/tree/main/roles/zsh"
    click SLACK "https://github.com/matthiashamacher/dotfiles/tree/main/roles/slack"
    click SPOT "https://github.com/matthiashamacher/dotfiles/tree/main/roles/spotify"
    click RAY "https://github.com/matthiashamacher/dotfiles/tree/main/roles/raycast"
    click RECT "https://github.com/matthiashamacher/dotfiles/tree/main/roles/rectangle"
    click WARP "https://github.com/matthiashamacher/dotfiles/tree/main/roles/warp"
```
