# e-lemongrab/myshell architecture

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

- Interactive diagram: https://gitdiagram.com/e-lemongrab/myshell
- Repository: https://github.com/e-lemongrab/myshell

## Overview

##### Main Components
- Core Component: Represent the initial shell environment setup. This includes configuration files (.bash_profile, .bashrc) along with directories for aliases, functions, jobs, and profiles defined under core/shells. Include the core/scripts (e.g., the password generator) which, although currently implemented in bash, is slated for replacement soon.
- Modules Component: Represent the extensible tools organized into submodules. This includes multiple directories such as:
- Help (providing quick access and documentation)
- Docker – a very rich folder with container setups, Dockerfiles, docker-compose files, and various bash/Powershell scripts for containers (Alpine, Apache, Cockroach, Liferay, Maven, MySQL, MongoDB, NodeJS, and more)
- K8s – several Kubernetes-related configurations, YAML files, menus, and debugging tools
- SSH – for creating SSH users and keys
- Additional modules like bw, John, Utils, and others (yt-dlp, minikube, etc.)

##### Architectural Patterns/Design Principles
- Modularity: Stress that design is built around a core that loads independent modules, increasing extensibility.
- Separation of Concerns: Clearly differentiate between the shell environment (core) and the additional tools (modules) that do not mix code but are merely sourced or invoked as needed.
- Reusability: Many modules are designed as standalone scripts that can be replaced or extended.
- CI/CD Automation: Show the integration of GitHub workflows that handle builds, tests, and deployments for modules (this helps maintain the quality of all these script-based tools).

##### Technologies and Frameworks
- Bash and PowerShell as the scripting languages.
- Docker and Kubernetes are heavily referenced in module scripts and configuration files.
- GitHub Actions (as indicated by the .github/workflows folder) for automation.
- Use of text-based configuration files (YAML, .bash, .ps1, Dockerfiles) exemplifies the configuration-centric design.

##### Elements
- Clear labels for each major block: “Core (Shell Environment)”, “Modules (Extensions)” with sub-blocks for Docker, Kubernetes, SSH, etc.
- Annotations that briefly note the purpose of key components (e.g., “.bash_profile: Loads shell and module configurations”, “modules/docker: Container orchestration scripts”, “modules/k8s: Kubernetes YAML and script-based menus”).

## Diagram (Mermaid)

```mermaid
graph TD
    %% External User Session
    UserSession["User Session"]:::externalStyle

    %% Core (Shell Environment)
    subgraph "Core (Shell Environment)"
        BashProfile[".bash_profile"]:::coreStyle
        BashRC[".bashrc"]:::coreStyle
        Aliases["Aliases (.aliases, .aliases_work)"]:::coreStyle
        Functions["Functions (myshell.bash, shellcheck.bash)"]:::coreStyle
        Jobs["Jobs (online_users.bash, public_ip.bash)"]:::coreStyle
        Profiles["Profiles (*.appearance, *.completion)"]:::coreStyle
        PasswordGenerator["Password Generator Script"]:::coreStyle
    end

    %% Modules (Extensions)
    subgraph "Modules (Extensions)"
        ModulesHub["Modules Hub"]:::moduleStyle

        subgraph "Docker Module"
            DOAlpine["Docker: Alpine"]:::moduleStyle
            DOApache["Docker: Apache"]:::moduleStyle
            DOCockroach["Docker: Cockroach"]:::moduleStyle
            DOHttpd["Docker: httpd"]:::moduleStyle
            DOJira["Docker: jira-software"]:::moduleStyle
            DOK6["Docker: k6"]:::moduleStyle
            DOLiferay["Docker: liferay"]:::moduleStyle
            DOMaven["Docker: maven"]:::moduleStyle
            DOMongoDB["Docker: mongodb"]:::moduleStyle
            DOMysql5["Docker: mysql5"]:::moduleStyle
            DOMysql8["Docker: mysql8"]:::moduleStyle
            DONexus["Docker: nexus"]:::moduleStyle
            DONginx["Docker: nginx"]:::moduleStyle
            DONodejs["Docker: nodejs"]:::moduleStyle
            DORainloop["Docker: rainloop"]:::moduleStyle
            DOSyslog["Docker: syslog"]:::moduleStyle
            DOTomcat9["Docker: tomcat9"]:::moduleStyle
            DOVtiger["Docker: vtiger"]:::moduleStyle
        end

        subgraph "K8s Module"
            K8sEnv["K8s Env Config"]:::moduleStyle
            K8sMenus["K8s Menus"]:::moduleStyle
        end

        subgraph "SSH Module"
            SSHCrea["SSH: crea"]:::moduleStyle
            SSHCreate["SSH: ssh_create"]:::moduleStyle
        end

        HelpModule["Help Module"]:::moduleStyle
        bwModule["bw Module"]:::moduleStyle
        johnModule["john Module"]:::moduleStyle
        minikubeModule["minikube Module"]:::moduleStyle
        utilsModule["utils Module"]:::moduleStyle
        ytdlpModule["yt-dlp Module"]:::moduleStyle
    end

    %% CI/CD Automation
    subgraph "CI/CD Automation"
        GitHubWorkflows["GitHub Workflows"]:::cicdStyle
    end

    %% External Systems
    DockerDaemon["Docker Daemon"]:::externalStyle
    K8sCluster["Kubernetes Cluster"]:::externalStyle

    %% Relationships and Data Flow
    UserSession -->|"initiates"| BashProfile
    UserSession -->|"initiates"| BashRC
    BashProfile -->|"sources"| ModulesHub
    BashRC -->|"sources"| ModulesHub
    GitHubWorkflows -->|"automates"| ModulesHub

    %% Docker Module interacts with External Docker Daemon (using DOApache as a representative)
    DOApache -->|"runs-on"| DockerDaemon

    %% K8s Module interacts with External Kubernetes Cluster
    K8sEnv -->|"deploys-to"| K8sCluster

    %% Class Definitions
    classDef coreStyle fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef moduleStyle fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef cicdStyle fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef externalStyle fill:#f8d7da,stroke:#721c24,stroke-width:2px;

    %% Click Events for Core Component
    click BashProfile "https://github.com/e-lemongrab/myshell/blob/master/core/shells/bash/.bash_profile"
    click BashRC "https://github.com/e-lemongrab/myshell/blob/master/core/shells/bash/.bashrc"
    click Aliases "https://github.com/e-lemongrab/myshell/tree/master/core/shells/bash/aliases"
    click Functions "https://github.com/e-lemongrab/myshell/tree/master/core/shells/bash/functions"
    click Jobs "https://github.com/e-lemongrab/myshell/tree/master/core/shells/bash/jobs"
    click Profiles "https://github.com/e-lemongrab/myshell/tree/master/core/shells/bash/profiles"
    click PasswordGenerator "https://github.com/e-lemongrab/myshell/blob/master/core/scripts/genera_password.bash"

    %% Click Events for Modules Component - Docker Module
    click DOAlpine "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/alpine"
    click DOApache "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/apache"
    click DOCockroach "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/cockroach"
    click DOHttpd "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/httpd"
    click DOJira "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/jira-software"
    click DOK6 "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/k6"
    click DOLiferay "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/liferay"
    click DOMaven "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/maven"
    click DOMongoDB "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/mongodb"
    click DOMysql5 "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/mysql5"
    click DOMysql8 "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/mysql8"
    click DONexus "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/nexus"
    click DONginx "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/nginx"
    click DONodejs "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/nodejs"
    click DORainloop "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/rainloop"
    click DOSyslog "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/syslog"
    click DOTomcat9 "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/tomcat9"
    click DOVtiger "https://github.com/e-lemongrab/myshell/tree/master/modules/docker/vtiger"

    %% Click Events for Modules Component - K8s Module
    click K8sEnv "https://github.com/e-lemongrab/myshell/tree/master/modules/k8s/env"
    click K8sMenus "https://github.com/e-lemongrab/myshell/tree/master/modules/k8s/menus"

    %% Click Events for Modules Component - SSH Module
    click SSHCrea "https://github.com/e-lemongrab/myshell/tree/master/modules/ssh/crea"
    click SSHCreate "https://github.com/e-lemongrab/myshell/tree/master/modules/ssh/ssh_create"

    %% Click Events for Modules Component - Other Modules
    click HelpModule "https://github.com/e-lemongrab/myshell/tree/master/modules/help"
    click bwModule "https://github.com/e-lemongrab/myshell/tree/master/modules/bw"
    click johnModule "https://github.com/e-lemongrab/myshell/tree/master/modules/john"
    click minikubeModule "https://github.com/e-lemongrab/myshell/tree/master/modules/minikube"
    click utilsModule "https://github.com/e-lemongrab/myshell/tree/master/modules/utils"
    click ytdlpModule "https://github.com/e-lemongrab/myshell/tree/master/modules/yt-dlp"

    %% Click Event for CI/CD Component
    click GitHubWorkflows "https://github.com/e-lemongrab/myshell/tree/master/.github/workflows"
```
