# sentustudio/dotfiles architecture

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

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

## Overview

##### Main Components (Containers in C4 terminology)
- Installer Container: Represented by the sentu_install.py script.
- Orchestration Container: The Ansible Playbook Engine (the playbook.yml that orchestrates the roles).
- Role Components: Each Ansible role (e.g., add_repositories, base_system_configuration, dotfiles_management, install_core_dependencies, etc.) should be represented as sub-components under the Ansible container.
- Configuration Containers: The “config” and “home” directories which hold the dotfiles and system configuration files.
- External Dependencies: Include any external services or package managers that may be implicitly called (e.g., system package manager installations, external repositories).

##### Architectural Patterns & Design Principles
- The project uses a modular design; each Ansible role is self-contained and responsible for a distinct piece of the setup.
- That the design is “post-install”, meaning it is not responsible for system provisioning but rather for subsequent configuration and environment tuning.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% C4 Context Diagram
    subgraph "C4 Context Diagram"
        ADMIN("System Administrator"):::actor
        DOTFILES_ENGINE("Dotfiles Post-Installation Engine"):::system
        TARGET_OS("Target Operating System"):::system
        GIT_REPO("Git Repository"):::external
        ADMIN -->|"initiates"| DOTFILES_ENGINE
        DOTFILES_ENGINE -->|"deploys to"| TARGET_OS
        DOTFILES_ENGINE -->|"fetches roles from"| GIT_REPO
    end

    %% C4 Container Diagram
    subgraph "C4 Container Diagram"
        INST("sentu_install.py"):::installer
        ORCH("Ansible Playbook Engine"):::orchestration
        CONFIG_DIR("config Deployment"):::config
        HOME_DIR("home Deployment"):::config
        INST -->|"triggers"| ORCH
        ORCH -->|"deploys"| CONFIG_DIR
        ORCH -->|"deploys"| HOME_DIR
    end

    %% C4 Component Diagram: Ansible Roles
    subgraph "C4 Component Diagram: Ansible Roles"
        PLAYBOOK("playbook.yml"):::playbook
        PLAYBOOK -->|"orchestrates"| ADDREP("add_repositories"):::role
        PLAYBOOK -->|"orchestrates"| BASECFG("base_system_configuration"):::role
        PLAYBOOK -->|"orchestrates"| DOTFILES("dotfiles_management"):::role
        PLAYBOOK -->|"orchestrates"| COREDEP("install_core_dependencies"):::role
        PLAYBOOK -->|"orchestrates"| EXTDEP("install_extended_dependencies"):::role
        PLAYBOOK -->|"orchestrates"| FONTS("install_fonts"):::role
        PLAYBOOK -->|"orchestrates"| POSTINST("install_post_install"):::role
        PLAYBOOK -->|"orchestrates"| RYE("install_rye"):::role
        PLAYBOOK -->|"orchestrates"| UV("install_uv"):::role
        PLAYBOOK -->|"orchestrates"| TEST("test"):::role
        PLAYBOOK -->|"loadsVars"| VARS("installer_config.yaml"):::var

        %% dotfiles_management role deploys configuration
        DOTFILES -->|"deploys"| CONFIG_DIR
        DOTFILES -->|"deploys"| HOME_DIR
    end

    %% Click Events
    click INST "https://github.com/sentustudio/dotfiles/blob/main/sentu_install.py"
    click ORCH "https://github.com/sentustudio/dotfiles/blob/main/ansible/playbook.yml"
    click ADDREP "https://github.com/sentustudio/dotfiles/blob/main/ansible/roles/add_repositories/tasks/main.yml"
    click BASECFG "https://github.com/sentustudio/dotfiles/blob/main/ansible/roles/base_system_configuration/tasks/main.yml"
    click DOTFILES "https://github.com/sentustudio/dotfiles/blob/main/ansible/roles/dotfiles_management/tasks/main.yml"
    click COREDEP "https://github.com/sentustudio/dotfiles/blob/main/ansible/roles/install_core_dependencies/tasks/main.yml"
    click EXTDEP "https://github.com/sentustudio/dotfiles/blob/main/ansible/roles/install_extended_dependencies/tasks/main.yml"
    click FONTS "https://github.com/sentustudio/dotfiles/blob/main/ansible/roles/install_fonts/tasks/main.yml"
    click POSTINST "https://github.com/sentustudio/dotfiles/blob/main/ansible/roles/install_post_install/tasks/main.yml"
    click RYE "https://github.com/sentustudio/dotfiles/blob/main/ansible/roles/install_rye/tasks/main.yml"
    click UV "https://github.com/sentustudio/dotfiles/blob/main/ansible/roles/install_uv/tasks/main.yml"
    click TEST "https://github.com/sentustudio/dotfiles/blob/main/ansible/roles/test/tasks/main.yml"
    click VARS "https://github.com/sentustudio/dotfiles/blob/main/ansible/vars/installer_config.yaml"
    click CONFIG_DIR "https://github.com/sentustudio/dotfiles/tree/main/config"
    click HOME_DIR "https://github.com/sentustudio/dotfiles/tree/main/home"

    %% Styles
    classDef actor fill:#f9d5e5,stroke:#d63384,stroke-width:2px;
    classDef system fill:#cfe2f3,stroke:#0d6efd,stroke-width:2px;
    classDef external fill:#e0f7fa,stroke:#00acc1,stroke-width:2px;
    classDef installer fill:#d1e7dd,stroke:#0f5132,stroke-width:2px;
    classDef orchestration fill:#fff3cd,stroke:#daa520,stroke-width:2px;
    classDef playbook fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
    classDef role fill:#ffe5d9,stroke:#ff4500,stroke-width:2px;
    classDef config fill:#e8f5e9,stroke:#43a047,stroke-width:2px;
    classDef var fill:#fce8b2,stroke:#f9a825,stroke-width:2px;
```
