# rdxfgxy1/nullhooks-releases architecture

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

- Interactive diagram: https://gitdiagram.com/rdxfgxy1/nullhooks-releases
- Repository: https://github.com/rdxfgxy1/nullhooks-releases

## Overview

##### Project Type and Purpose
- NullHooks is a modular, command-line interface (CLI) application written in Lua (5.3+).
- Its core purpose is secure, cross-platform management of Discord webhooks, featuring encrypted credential storage, activation/licensing via MySQL/MariaDB, retry logic, diagnostics, and logging.

##### File Structure
- According to the README, the repo should contain:
- data/            – encrypted storage for credentials and backups
- src/             – Lua modules implementing business logic (encryption, networking, CLI UI, activation, logging, scheduling, health checks)
- nullhooks        – the main executable shell script or Lua CLI entrypoint
- db_config.json   – JSON file holding database connection parameters
- The “releases/” directory holds prebuilt binaries, encrypted assets, version metadata, and checksums – these are outputs, not part of the runtime architecture per se.

##### Key Architectural Patterns
- Modular Monolith: all functionality lives in a single deployable CLI, but is logically separated into modules/packages under src/.
- Layered Approach:
- Presentation Layer (CLI interface)
- Application/Business Layer (webhook management, encryption, activation, scheduling, diagnostics, logging)
- Data Layer (encrypted file storage + relational DB for activation/licensing)
- Integration Layer (Discord API calls via HTTP, database driver via LuaSQL)

##### Main Components and Their Interactions
a. CLI Interface (“nullhooks” executable)
- Parses user commands (sendtemp, register, activate, etc.) and invokes corresponding modules.
b. Core Modules (in src/)
- Encryption Module (AES-256 storage/retrieval in data/)
- Activation Module (reads/writes activation records to MySQL/MariaDB via luasql-mysql)
- Network Module (connectivity checks, HTTP calls to Discord webhook endpoints via luasocket)
- Retry/Scheduler Module (manages retries and scheduled deliveries)
- Health Monitoring Module (checks status of endpoints, diagnostics)
c. Data Stores
- Encrypted File Store (data/ folder with AES-256 encrypted blobs and backups)
- Relational Database (MySQL/MariaDB for activation/licensing records)
d. External Services
- Discord Webhook API (HTTPS endpoints)
- Optional: remote license/signature verification service (if activation involves an external license server)

##### Final Checklist
- [ ] Notes on key technologies (Lua, AES-256, MySQL)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% System Boundary
    subgraph "NullHooks CLI Application"
        direction TB

        %% CLI Interface
        CLI["CLI Interface\n(nullhooks)"]:::cli

        %% Internal Modules
        subgraph "Core Modules"
            direction TB
            Enc["Encryption Module"]:::internal
            Act["Activation Module"]:::internal
            Net["Network Module"]:::internal
            Sch["Scheduler Module"]:::internal
            Log["Logging Module"]:::internal
            Health["Health Monitoring Module"]:::internal
        end

        %% Data Layer
        subgraph "Data Stores"
            direction TB
            FileStore["Encrypted File Store\n(data/)"]:::data
            DB["Relational Database\n(MySQL/MariaDB)"]:::data
        end
    end

    %% External Services
    Discord["Discord Webhook API"]:::external
    LicenseSvc["License Verification Service"]:::external
    Releases["Releases (Prebuilt Binaries & Assets)"]:::external

    %% Relationships
    CLI -->|"invokes"| Enc
    CLI -->|"invokes"| Act
    CLI -->|"invokes"| Net
    CLI -->|"invokes"| Sch
    CLI -->|"invokes"| Log
    CLI -->|"invokes"| Health

    Enc <-->|"read/write encrypted data"| FileStore
    Act <-->|"query/update records"| DB
    Net -->|"HTTP calls"| Discord
    Sch -.->|"schedule/retry delivery"| Net
    Enc -->|"emit logs"| Log
    Act -->|"emit logs"| Log
    Net -->|"emit logs"| Log
    Sch -->|"emit logs"| Log
    Health -->|"emit logs"| Log

    %% Outputs
    Releases

    %% Click Events
    click Releases "https://github.com/rdxfgxy1/nullhooks-releases/tree/main/releases/"

    %% Styles
    classDef internal fill:#cce5ff,stroke:#1f78b4,color:#000
    classDef data fill:#d4edda,stroke:#28a745,color:#000
    classDef external fill:#fff3cd,stroke:#fd7e14,color:#000
    classDef cli fill:#e2e3e5,stroke:#6c757d,color:#000
```
