# tahadashti-gd/fluxguard architecture

> Architecture diagram of the GitHub repository tahadashti-gd/fluxguard, 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/tahadashti-gd/fluxguard
- Repository: https://github.com/tahadashti-gd/fluxguard

## Overview

##### Main Components
- Core Engine: At the heart of FluxGuard is the FluxGuard.Core module, which contains:
- FLuxModules (e.g., FileExplorerModule, ManageAppsModule, PowerModule, SecurityModule, StatusModule, TelegramFileHandlerModule) that encapsulate discrete functionalities.
- Models (e.g., configuration and settings models) to represent data.
- Services (e.g., CommandHandler, ConfigService, LanguageService, LogService, SettingService, TelegramClientService, TelegramKeyboardService) that provide domain logic, handle communication with Telegram, manage logging, configuration, etc.
- Utilities for common helper functions (such as JSON element conversion and logging).
- Command Line Interface (CLI): Found under FluxGuard/CLI, it functions as the manual control interface to start, stop, and manage bot operations.
- Graphical User Interface (GUI): While somewhat less mature, the GUI project (in folder GUI) handles a more visual interaction (e.g., screenshot capturing) and possibly future advanced functionalities.
- Resources: Configuration files (config.json, setting.json) and language files enable customization (multilingual support) and secure operation.
- External Communication: Interaction with Telegram’s HTTPS API ensures secure command and control messaging.

##### Relationships and Interactions
– The CLI and (upcoming) GUI serve as external interfaces that make calls into the Core services.
– Within FluxGuard.Core, FLuxModules use the Services to execute commands, manage system state, and interact with the operating system.
– Config and Setting models are loaded via their respective services from the JSON files in Resources/Data.
– LanguageService interacts with language files to provide multi-language support for user operations.
– The TelegramClientService manages the secure data exchange between your system and Telegram’s Bot API.
– The CommandHandler orchestrates requests coming from either the Telegram interface (bot commands) or the CLI interface.

##### Architectural Patterns and Design Principles
– Modularity: Each core functionality is organized within its own module (the FLuxModules), which makes the system scalable and easier to maintain.
– Separation of Concerns: Clear boundaries exist between user interfaces (CLI/GUI), business logic (Core modules and Services), and configuration (Resources folder).
– Dependency Injection or Service Locator (likely via .NET conventions): Ensures that service classes (such as LogService and ConfigService) can be reused and replaced as needed without tight coupling.

##### Technologies and Frameworks
– The solution is based on .NET. The command and GUI projects reference and depend on FluxGuard.Core.
– It leverages Telegram’s HTTPS API for secure communications.
– JSON is extensively used for configuration and language resources.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User Interface"
        CLI["Command Line Interface"]:::ui
        GUI["Graphical User Interface"]:::ui
    end

    subgraph "Core Engine"
        CORE["FluxGuard.Core"]:::core
        MODULES["FLuxModules"]:::module
        MODELS["Models"]:::core
        SERVICES["Services"]:::core
        UTILITIES["Utilities"]:::core
    end

    subgraph "Resources"
        CONFIG["Config Files"]:::resource
        LANG["Language Files"]:::resource
    end

    subgraph "External Integrations"
        TELEGRAM["Telegram API"]:::external
    end

    CLI -->|"commands"| SERVICES
    GUI -->|"commands"| SERVICES
    SERVICES -->|"orchestrates"| MODULES
    MODULES -->|"utilizes"| MODELS
    SERVICES -->|"loads"| CONFIG
    SERVICES -->|"loads"| LANG
    SERVICES -.->|"HTTPS"| TELEGRAM
    SERVICES -->|"helpers"| UTILITIES

    click CORE "https://github.com/tahadashti-gd/fluxguard/tree/main/FluxGuard/Core"
    click MODULES "https://github.com/tahadashti-gd/fluxguard/tree/main/FluxGuard/Core/FLuxModules"
    click MODELS "https://github.com/tahadashti-gd/fluxguard/tree/main/FluxGuard/Core/Models"
    click SERVICES "https://github.com/tahadashti-gd/fluxguard/tree/main/FluxGuard/Core/Services"
    click UTILITIES "https://github.com/tahadashti-gd/fluxguard/tree/main/FluxGuard/Core/Utilities"
    click CLI "https://github.com/tahadashti-gd/fluxguard/tree/main/FluxGuard/CLI"
    click GUI "https://github.com/tahadashti-gd/fluxguard/tree/main/GUI"
    click CONFIG "https://github.com/tahadashti-gd/fluxguard/tree/main/FluxGuard/Resources/Data"
    click LANG "https://github.com/tahadashti-gd/fluxguard/tree/main/FluxGuard/Resources/Languages"

    classDef ui fill:#FCE4D6,stroke:#D35400,stroke-width:2px;
    classDef core fill:#D6EAF8,stroke:#2471A3,stroke-width:2px;
    classDef module fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
    classDef resource fill:#FCF3CF,stroke:#B7950B,stroke-width:2px;
    classDef external fill:#FADBD8,stroke:#C0392B,stroke-width:2px;
```
