# nick-halt/fudo architecture

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

- Interactive diagram: https://gitdiagram.com/nick-halt/fudo
- Repository: https://github.com/nick-halt/fudo

## Overview

##### Project type and purpose
- From the file tree and README, this is a Rust-based command-line utility (“fudo”) whose purpose is to:
- Encrypt/decrypt binary distributions
- Launch encrypted binaries in memory without writing plaintext to disk
- Scrub files from disk
- It ships as a single CLI executable (`src/main.rs`), with a `playground/` folder containing C demo code.

##### File structure
- Top level:
- `.rustfmt.toml`, `Cargo.toml` – Rust project configuration
- `src/main.rs` – application entry point
- `playground/` – example code and README
- No separate frontend/backend or microservices—this is a monolithic CLI tool.
- No external config or deployment manifests beyond Cargo.

##### README for additional insights
- Describes core features (encrypt, decrypt, launch, scrub)
- Mentions Rust build and run instructions, plus future TODOs (debug flags, Windows support)

##### Detail
- For each module, note inputs/outputs (e.g., Encryption Module: plaintext in → ciphertext out)
- Which module calls which external crate or syscall
- Do not oversimplify—capture all four core features as separate modules

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Demo Client invokes CLI
    DemoClient["Demo Client"]:::external
    click DemoClient "https://github.com/nick-halt/fudo/blob/main/playground/main.c"
    DemoClient -->|invokes| CLI

    %% User-facing CLI Interface
    CLI["CLI Interface\n(argument parser)"]:::user
    click CLI "https://github.com/nick-halt/fudo/blob/main/src/main.rs"

    %% Core Engine Modules
    subgraph "Core Engine"
        direction TB
        Enc["Encryption Module\n(plaintext→ciphertext)"]:::core
        click Enc "https://github.com/nick-halt/fudo/blob/main/src/main.rs"
        Dec["Decryption Module\n(ciphertext→plaintext)"]:::core
        click Dec "https://github.com/nick-halt/fudo/blob/main/src/main.rs"
        Lau["Launcher Module\n(in-memory exec)"]:::core
        click Lau "https://github.com/nick-halt/fudo/blob/main/src/main.rs"
        Scr["Scrubber Module\n(secure wipe)"]:::core
        click Scr "https://github.com/nick-halt/fudo/blob/main/src/main.rs"
    end

    %% External Systems
    FS["File System"]:::external
    OS["Operating System\n(process management)"]:::external
    Crypto["Crypto Library\n(e.g., ring)"]:::external

    %% Project Files & Docs
    subgraph "Project Files"
        direction TB
        Config["Cargo.toml"]:::docs
        click Config "https://github.com/nick-halt/fudo/blob/main/Cargo.toml"
        README["README.md"]:::docs
        click README "https://github.com/nick-halt/fudo/blob/main/README.md"
        PlaygroundDocs["playground/README.md"]:::docs
        click PlaygroundDocs "https://github.com/nick-halt/fudo/blob/main/playground/README.md"
        Rustfmt[".rustfmt.toml"]:::docs
        click Rustfmt "https://github.com/nick-halt/fudo/blob/main/.rustfmt.toml"
    end

    %% Data Flows & Relationships
    CLI -->|"encrypt command"| Enc
    CLI -->|"decrypt command"| Dec
    CLI -->|"launch command"| Lau
    CLI -->|"scrub command"| Scr

    Enc -->|"write ciphertext"| FS
    Dec -->|"read ciphertext"| FS
    Scr -->|"secure delete files"| FS

    Lau -->|"map & decrypt"| OS
    Lau -->|"uses crypto"| Crypto

    Enc -->|"calls crypto"| Crypto
    Dec -->|"calls crypto"| Crypto
    Scr -->|"calls OS syscalls"| OS

    %% Styles
    classDef user fill:#b3e6b3,stroke:#2d862d,color:#000;
    classDef core fill:#cce0ff,stroke:#3366cc,color:#000;
    classDef external fill:#e0e0e0,stroke:#666,color:#000,stroke-dasharray: 2 2;
    classDef docs fill:#fff3cc,stroke:#cc9900,color:#000;
    class DemoClient,FS,OS,Crypto external
    class CLI user
    class Enc,Dec,Lau,Scr core
    class Config,README,PlaygroundDocs,Rustfmt docs
```
