# sam-hosseini/dotfiles architecture

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

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

## Overview

##### Main Components

a. Core Configuration Manager
- Ansible as the central orchestrator

b. Role Categories (Group these logically):
1. Shell Environment
- Fish shell configuration
- Starship prompt

2. Development Tools
- Git configuration
- VSCode setup
- GitHub configurations

3. System Configuration
- macOS settings
- Hosts file management
- Homebrew package management

4. Application Configuration
- iTerm2 settings
- Rectangle window manager
- Karabiner keyboard customization

##### Relationship Representation

- Initial setup flows (e.g., green)
- Configuration management (e.g., blue)
- Dependencies between components (e.g., gray)

##### Specific Implementation Details

Layer 1 (Core):
- Ansible configuration center
- Bootstrap process

Layer 2 (System Level):
- Homebrew package management
- macOS system settings
- Hosts file configuration

Layer 3 (Development Environment):
- Shell configuration (Fish)
- Git setup
- VSCode configuration

Layer 4 (Applications):
- iTerm2
- Karabiner
- Rectangle

##### Additional Details

- Version control integration
- Backup/restore processes
- Configuration precedence
- Optional vs. required components

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Core Configuration
    subgraph Core
        Ansible[Ansible Orchestrator]
        Bootstrap["Bootstrap Process"]
        Inventory["Inventory Configuration"]
    end
    click Ansible "https://github.com/sam-hosseini/dotfiles/tree/main/roles/ansible/"
    click Bootstrap "https://github.com/sam-hosseini/dotfiles/blob/main/roles/ansible/files/bootstrap.yml"
    click Inventory "https://github.com/sam-hosseini/dotfiles/blob/main/roles/ansible/files/inventory.yaml"

    %% System Level
    subgraph SystemConfig
        direction TB
        MacOS["macOS Settings"]:::system
        Homebrew["Homebrew Packages"]:::system
        Hosts["Hosts Management"]:::system
        
        subgraph MacOSConfig
            SystemTasks["System Tasks"]:::system
            DockConfig["Dock Configuration"]:::system
            FinderConfig["Finder Configuration"]:::system
        end
    end
    click MacOS "https://github.com/sam-hosseini/dotfiles/tree/main/roles/macos/"
    click Homebrew "https://github.com/sam-hosseini/dotfiles/tree/main/roles/homebrew/"
    click Hosts "https://github.com/sam-hosseini/dotfiles/tree/main/roles/hosts/"
    click SystemTasks "https://github.com/sam-hosseini/dotfiles/blob/main/roles/macos/tasks/system.yml"
    click DockConfig "https://github.com/sam-hosseini/dotfiles/blob/main/roles/macos/tasks/dock.yml"
    click FinderConfig "https://github.com/sam-hosseini/dotfiles/blob/main/roles/macos/tasks/finder.yml"

    %% Development Environment
    subgraph DevEnv
        direction TB
        Git["Git Configuration"]:::dev
        VSCode["VSCode Setup"]:::dev
        GitHub["GitHub Configuration"]:::dev
        VSCodeSettings["VSCode Settings"]:::dev
    end
    click Git "https://github.com/sam-hosseini/dotfiles/blob/main/roles/git/files/config.ini"
    click VSCode "https://github.com/sam-hosseini/dotfiles/tree/main/roles/vscode/"
    click GitHub "https://github.com/sam-hosseini/dotfiles/tree/main/roles/github/"
    click VSCodeSettings "https://github.com/sam-hosseini/dotfiles/blob/main/roles/vscode/files/config.json"

    %% Shell Environment
    subgraph ShellEnv
        direction TB
        Fish["Fish Shell"]:::shell
        FishFuncs["Fish Functions"]:::shell
        Starship["Starship Prompt"]:::shell
        EnvSettings["Environment Settings"]:::shell
    end
    click Fish "https://github.com/sam-hosseini/dotfiles/tree/main/roles/fish/"
    click FishFuncs "https://github.com/sam-hosseini/dotfiles/tree/main/roles/fish/files/functions/"
    click Starship "https://github.com/sam-hosseini/dotfiles/tree/main/roles/starship/"
    click EnvSettings "https://github.com/sam-hosseini/dotfiles/blob/main/roles/fish/files/environment.fish"

    %% Applications
    subgraph Apps
        direction TB
        ITerm["iTerm2 Settings"]:::app
        Rectangle["Rectangle Window Manager"]:::app
        Karabiner["Karabiner"]:::app
        
        subgraph KarabinerConfig
            KRules["Karabiner Rules"]:::app
            KTemplate["Configuration Template"]:::app
        end
    end
    click ITerm "https://github.com/sam-hosseini/dotfiles/blob/main/roles/iterm/files/com.googlecode.iterm2.plist"
    click Rectangle "https://github.com/sam-hosseini/dotfiles/blob/main/roles/rectangle/files/config.plist"
    click Karabiner "https://github.com/sam-hosseini/dotfiles/tree/main/roles/karabiner/"
    click KRules "https://github.com/sam-hosseini/dotfiles/tree/main/roles/karabiner/files/rules/"
    click KTemplate "https://github.com/sam-hosseini/dotfiles/blob/main/roles/karabiner/templates/config.json.j2"

    %% Relationships
    Ansible --> Bootstrap
    Ansible --> Inventory
    Bootstrap --> SystemConfig
    Bootstrap --> DevEnv
    Bootstrap --> ShellEnv
    Bootstrap --> Apps

    %% Styles
    classDef system fill:#e6ffe6,stroke:#333,stroke-width:2px
    classDef dev fill:#e6f3ff,stroke:#333,stroke-width:2px
    classDef shell fill:#fff5e6,stroke:#333,stroke-width:2px
    classDef app fill:#ffe6e6,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["System Configuration"]:::system
        L2["Development Tools"]:::dev
        L3["Shell Environment"]:::shell
        L4["Applications"]:::app
    end
```
