# hadi2f244/free-me architecture

> Architecture diagram of the GitHub repository hadi2f244/free-me, 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/hadi2f244/free-me
- Repository: https://github.com/hadi2f244/free-me

## Overview

##### Main Components

a) Core System Components:
- Ansible Collection Controller (Central Component)
- Role Manager
- Configuration Management System
- Template Engine

b) Role Categories (Group these visually):
##### Proxy Connectors
- Environment Proxy
- APT Proxy
- DNS Proxy
- Container Runtime Proxy

##### VPN/Proxy Clients
- V2Ray Client
- Singbox Client
- OpenVPN Client

**Top Layer: User Interface/Entry Points**
- Ansible Playbook Execution
- Galaxy Collection Installation

**Middle Layer: Core Components**
- Role Management
- Template Processing
- Configuration Handling

**Bottom Layer: Target Systems**
- Container Runtimes
- Package Managers
- Network Configurations

##### Key Relationships to Highlight

a) Role Dependencies:
- How V2Ray and Singbox roles can utilize proxy connector roles
- Relationship between container proxy and different container runtimes

b) Configuration Flow:
- Template rendering process
- Variable inheritance paths
- Task execution flow

Create distinct sections for:

##### Implementation Details

- Ansible Collection   |
- Controller        |

- Proxy  |  | Client |
- Roles  |  | Roles  |

- Target Systems      |

##### Additional Elements

- Version information and compatibility notes
- Configuration file locations and formats
- Error handling and fallback paths

Remember to maintain a balance between detail and clarity, focusing on the collection's primary purpose of providing proxy and VPN solutions while showing the modularity and flexibility of the role-based architecture.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Core System"
        AC["Ansible Collection Controller"]:::core
        RM["Role Manager"]:::core
        CM["Configuration Management"]:::core
        TE["Template Engine"]:::core
    end

    subgraph "Proxy Connectors"
        EP["Environment Proxy"]:::proxy
        AP["APT Proxy"]:::proxy
        DP["DNS Proxy"]:::proxy
        CP["Container Runtime Proxy"]:::proxy
    end

    subgraph "VPN/Proxy Clients"
        V2["V2Ray Client"]:::vpn
        SB["Singbox Client"]:::vpn
        OV["OpenVPN Client"]:::vpn
    end

    subgraph "Template Storage"
        V2T["V2Ray Templates"]:::template
        SBT["Singbox Templates"]:::template
        CPT["Container Proxy Templates"]:::template
        OVT["OpenVPN Templates"]:::template
    end

    subgraph "Configuration Storage"
        RM_META["Role Metadata"]:::config
        DOCS["Documentation"]:::config
        VARS["Role Variables"]:::config
        DEFAULTS["Role Defaults"]:::config
    end

    subgraph "Task Management"
        CD["Connect/Disconnect Logic"]:::task
        RT["Role Tasks"]:::task
    end

    AC --> RM
    RM --> CM
    CM --> TE

    RM --> EP
    RM --> AP
    RM --> DP
    RM --> CP
    RM --> V2
    RM --> SB
    RM --> OV

    TE --> V2T
    TE --> SBT
    TE --> CPT
    TE --> OVT

    V2T --> V2
    SBT --> SB
    CPT --> CP
    OVT --> OV

    CM --> RM_META
    CM --> DOCS
    CM --> VARS
    CM --> DEFAULTS

    CD --> EP
    CD --> AP
    CD --> DP
    CD --> CP
    CD --> V2
    CD --> SB
    CD --> OV

    RT --> EP
    RT --> AP
    RT --> DP
    RT --> CP
    RT --> V2
    RT --> SB
    RT --> OV

    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef proxy fill:#2ecc71,stroke:#27ae60,color:white
    classDef vpn fill:#e67e22,stroke:#d35400,color:white
    classDef template fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef config fill:#9b59b6,stroke:#8e44ad,color:white
    classDef task fill:#e74c3c,stroke:#c0392b,color:white

    click AC "https://github.com/hadi2f244/free-me/blob/main/galaxy.yml"
    click RM "https://github.com/hadi2f244/free-me/blob/main/roles/README.md"
    click CM "https://github.com/hadi2f244/free-me/blob/main/ansible.cfg"
    click EP "https://github.com/hadi2f244/free-me/tree/main/roles/env_proxy/"
    click AP "https://github.com/hadi2f244/free-me/tree/main/roles/apt_proxy/"
    click DP "https://github.com/hadi2f244/free-me/tree/main/roles/dns_proxy/"
    click CP "https://github.com/hadi2f244/free-me/tree/main/roles/container_proxy/"
    click V2 "https://github.com/hadi2f244/free-me/tree/main/roles/v2ray/"
    click SB "https://github.com/hadi2f244/free-me/tree/main/roles/singbox/"
    click OV "https://github.com/hadi2f244/free-me/tree/main/roles/ovpn/"
    click V2T "https://github.com/hadi2f244/free-me/tree/main/roles/v2ray/templates/"
    click SBT "https://github.com/hadi2f244/free-me/tree/main/roles/singbox/templates/"
    click CPT "https://github.com/hadi2f244/free-me/tree/main/roles/container_proxy/templates/"
    click OVT "https://github.com/hadi2f244/free-me/tree/main/roles/ovpn/templates/"
    click RM_META "https://github.com/hadi2f244/free-me/blob/main/meta/runtime.yml"
    click DOCS "https://github.com/hadi2f244/free-me/tree/main/docs/"
    click VARS "https://github.com/hadi2f244/free-me/blob/main/roles/*/vars/main.yaml"
    click DEFAULTS "https://github.com/hadi2f244/free-me/blob/main/roles/*/defaults/main.yml"
    click CD "https://github.com/hadi2f244/free-me/blob/main/roles/*/tasks/main.yaml"
    click RT "https://github.com/hadi2f244/free-me/blob/main/roles/*/tasks/*.yaml"
```
