# zhdanov/home architecture

> Architecture diagram of the GitHub repository zhdanov/home, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zhdanov/home
- Repository: https://github.com/zhdanov/home

## Overview

##### Main System Components

a) Configuration Management Layer
- Setup Scripts Hub (setup/ directory)
- Configuration Files (.config/ directory)
- Dotfiles (.vimrc, .tmux.conf, etc.)

b) Workspace Management Layer
- Development Environment (workspace/dev)
- Production Environment (workspace/prod)
- QA Environment (workspace/qa)

c) Infrastructure Components
- Kubernetes/Minikube
- Cloud Integration
- Backup Systems

##### Component Relationships

**setup.bash (Main Orchestrator)**
- ↓
**Configuration Modules**
- ↙↓↘
**Workspace → Kubernetes → Cloud Services**
- ↓
**Backup Systems**

##### Specific Implementation Details

a) Setup Flow:
- Initial setup (setup__init.bash)
- System configuration (setup__packages.bash, setup__dotfiles.bash)
- Environment setup (setup__workspace.bash)
- Infrastructure setup (setup__kubernetes.bash, setup__minikube.bash)

b) Workspace Structure:
- Development environment
- Production environment (with specific services like albums, gitlab)
- QA environment

c) Backup and Security:
- Backup scripts (backup-to-cloud.bash, backup-to-drive.bash)
- Encryption utilities (enc.bash, dec.bash)

##### Notes for Implementation

- Keep the main setup flow clear and central
- Relationship between configuration files and their deployment targets
- Optional components (like cloud drive integration)
- Separation between system configuration and application deployment

Remember to include a small section showing the integration with external tools (vim, i3wm, helm, kubernetes) while keeping them visually distinct from the core system components.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Configuration Management"
        Setup["Setup Scripts Hub"]
        DotFiles["Dotfiles Configuration"]
        SysConfig["System Configuration"]
        WinManager["Window Manager (i3)"]
        Terminal["Terminal Config"]
    end

    subgraph "Workspace Environments"
        DevEnv["Development"]
        QAEnv["QA Environment"]
        ProdEnv["Production"]
    end

    subgraph "Application Deployment"
        K8s["Kubernetes/Minikube"]
        Helm["Helm Charts"]
        Werf["Werf Configs"]
    end

    subgraph "Production Applications"
        Albums["Albums App"]
        GitLab["GitLab Instance"]
    end

    subgraph "Backup System"
        BackupScripts["Backup Scripts"]
        DataStore[("Data Store")]
        Cloud["Cloud Storage"]
    end

    Setup --> DotFiles
    Setup --> SysConfig
    Setup --> K8s
    DotFiles --> WinManager
    DotFiles --> Terminal

    K8s --> DevEnv
    K8s --> QAEnv
    K8s --> ProdEnv

    ProdEnv --> Albums
    ProdEnv --> GitLab

    Albums --> Helm
    GitLab --> Helm
    Albums --> Werf
    GitLab --> Werf

    SysConfig --> BackupScripts
    BackupScripts --> DataStore
    BackupScripts --> Cloud

    %% Click Events
    click Setup "https://github.com/zhdanov/home/tree/main/setup"
    click DotFiles "https://github.com/zhdanov/home/blob/main/.config"
    click WinManager "https://github.com/zhdanov/home/tree/main/.config/i3"
    click Terminal "https://github.com/zhdanov/home/tree/main/.config/alacritty"
    click SysConfig "https://github.com/zhdanov/home/tree/main/bin"
    click DevEnv "https://github.com/zhdanov/home/tree/main/workspace/dev"
    click QAEnv "https://github.com/zhdanov/home/tree/main/workspace/qa"
    click ProdEnv "https://github.com/zhdanov/home/tree/main/workspace/prod"
    click Albums "https://github.com/zhdanov/home/tree/main/workspace/prod/albums"
    click GitLab "https://github.com/zhdanov/home/tree/main/workspace/prod/gitlab"
    click K8s "https://github.com/zhdanov/home/blob/main/setup/setup__kubernetes.bash"
    click BackupScripts "https://github.com/zhdanov/home/blob/main/bin/backup-to-cloud.bash"
    click DataStore "https://github.com/zhdanov/home/tree/main/data-store"

    %% Styling
    classDef config fill:#f9f,stroke:#333,stroke-width:2px
    classDef env fill:#bbf,stroke:#333,stroke-width:2px
    classDef deploy fill:#bfb,stroke:#333,stroke-width:2px
    classDef backup fill:#ffb,stroke:#333,stroke-width:2px

    class Setup,DotFiles,SysConfig,WinManager,Terminal config
    class DevEnv,QAEnv,ProdEnv env
    class K8s,Helm,Werf,Albums,GitLab deploy
    class BackupScripts,DataStore,Cloud backup

    %% Legend
    subgraph Legend
        L1["Configuration Components"]:::config
        L2["Environment Components"]:::env
        L3["Deployment Components"]:::deploy
        L4["Backup Components"]:::backup
    end
```
