# stellarcyber/stellarcyber-scripts-pro architecture

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

- Interactive diagram: https://gitdiagram.com/stellarcyber/stellarcyber-scripts-pro
- Repository: https://github.com/stellarcyber/stellarcyber-scripts-pro

## Overview

##### Main Components Identification

a. Core Components:
- CLI Interface (master_script.sh)
- Configuration Manager (config.json)
- Script Management System
- Remote Script Repository (GitHub Gist)

**User Interface Layer**

**Execution Layer**

**Configuration Layer**

**External Services Layer**

##### Component Relationships

a. User Interface Layer:
- CLI interface as a terminal-like component
- Four main interaction options (Run, Help, Simulate, Back)

b. Execution Layer:
- Script execution engine
- Permission handler
- Navigation controller

c. Configuration Layer:
- Config.json parser (using jq)
- Dynamic menu configuration system
- Script metadata storage

d. External Services Layer:
- GitHub Gist repository
- Script download manager (curl)

##### Technical Details

Annotations for:
- Required system dependencies (jq, curl)
- Operating system requirements (Linux)
- Script execution flow
- Configuration file structure

##### The interaction with external services

Remember to include future expansion points for:
- Automatic environment detection (v2 feature)
- Additional script sources
- Enhanced security features
- New menu options

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef config fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef critical fill:#e74c3c,stroke:#c0392b,color:white

    %% User Interface Layer
    subgraph UI
        CLI[CLI Interface]
        Menu[Menu Navigation System]
        CLI --> Menu
    end

    %% Execution Layer
    subgraph Execution
        ScriptMgr[Script Management System]
        ExecEngine[Script Execution Engine]
        PermHandler[Permission Handler]
        NavCtrl[Navigation Controller]
        ColorFmt[ANSI Color Formatter]
        
        ScriptMgr --> ExecEngine
        ScriptMgr --> PermHandler
        ScriptMgr --> NavCtrl
        ScriptMgr --> ColorFmt
    end

    %% Configuration Layer
    subgraph Config
        ConfigMgr[Configuration Manager]
        Parser[Configuration Parser]
        MetaStore[Script Metadata Storage]
        
        ConfigMgr --> Parser
        Parser --> MetaStore
    end

    %% External Services Layer
    subgraph External
        Gist[GitHub Gist Repository]
        Download[Script Download Manager]
        
        Gist --> Download
    end

    %% Inter-layer Connections
    Menu --> ScriptMgr
    ScriptMgr --> ConfigMgr
    Download --> ScriptMgr
    
    %% Special Components
    EnvDetect[Environment Detection]
    ScriptVerify[Script Verification]
    ErrorHandle[Error Handling]

    ScriptMgr --> EnvDetect
    ScriptMgr --> ScriptVerify
    ScriptMgr --> ErrorHandle

    %% Component Mappings with Click Events
    click CLI "https://github.com/stellarcyber/StellarCyber-Scripts-Pro/blob/main/master_script.sh"
    click ConfigMgr "https://github.com/stellarcyber/StellarCyber-Scripts-Pro/blob/main/config.json"
    click ScriptMgr "https://github.com/stellarcyber/StellarCyber-Scripts-Pro/blob/main/master_script.sh"
    click Menu "https://github.com/stellarcyber/StellarCyber-Scripts-Pro/blob/main/master_script.sh"
    click Parser "https://github.com/stellarcyber/StellarCyber-Scripts-Pro/blob/main/master_script.sh"
    click ExecEngine "https://github.com/stellarcyber/StellarCyber-Scripts-Pro/blob/main/master_script.sh"

    %% Style Applications
    class CLI,Menu ui
    class ScriptMgr,ExecEngine,PermHandler,NavCtrl,ColorFmt core
    class ConfigMgr,Parser,MetaStore config
    class Gist,Download external
    class EnvDetect,ScriptVerify,ErrorHandle critical

    %% Legend
    subgraph Legend
        L1[User Interface]:::ui
        L2[Core Components]:::core
        L3[Configuration]:::config
        L4[External Services]:::external
        L5[Critical Components]:::critical
    end
```
