# abodx9/obfuscator-x architecture

> Architecture diagram of the GitHub repository abodx9/obfuscator-x, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abodx9/obfuscator-x
- Repository: https://github.com/abodx9/obfuscator-x

## Overview

##### Project type and purpose
- Obfuscator-X is a Spring Boot–based microservice/tool whose sole responsibility is to take in plain strings (via an HTTP API) and return obfuscated or encoded versions for multiple target languages (C, Java, etc.).

##### File structure
- Top‐level: Maven wrapper files, pom.xml, README, LICENSE
- src/main/java/abod/obf
- ObfxApplication.java – the Spring Boot entry point
- ObfuscatorController.java – REST controller exposing the obfuscation API
- Tricks.java – core business logic (strategy for encoding/obfuscation)
- src/main/resources/application.properties – configuration (port, logging, etc.)
- src/test/java/abod/obf – unit tests for the API/service

##### README
- Describes Obfuscator-X as a multi-language string obfuscation tool

##### Main components and their interactions
a. Client / API Consumer
- Could be curl, Postman, or another service calling the REST endpoint
b. Web/API Layer (Controller)
- ObfuscatorController receives HTTP requests (JSON/XML payload)
c. Business Logic Layer
- Tricks.java implements the actual obfuscation strategies for various languages
d. Configuration Layer
- application.properties drives ports, thresholds, logging levels
e. Build/Deployment
- Maven (pom.xml), Maven Wrapper (.mvn/* + mvnw), Docker (if added later)

Data flow:
Client → HTTP request → ObfuscatorController → Tricks.obfuscate(...) → Response → Client

##### Architectural patterns and design principles
- Layered architecture (Controller → Service/Logic → Config)
- Strategy pattern in Tricks.java to support multiple language modules
- Convention-over-configuration via Spring Boot
- Test-driven development (DemoApplicationTests)

## Diagram (Mermaid)

```mermaid
flowchart TD
    External["External Client\n(e.g., curl, Postman)"]:::external

    subgraph "API Layer"
        Entry["ObfxApplication\n(Spring Boot Entry)"]:::api
        Controller["ObfuscatorController\n(REST API)"]:::api
    end

    subgraph "Business Logic Layer"
        Tricks["Tricks\n(Obfuscation Strategies)"]:::logic
        subgraph "Language Strategy Plugins"
            CPlugin["C Strategy"]:::logic
            JavaPlugin["Java Strategy"]:::logic
        end
    end

    subgraph "Configuration & Build"
        Config["application.properties"]:::config
        Pom["pom.xml"]:::config
        WrapperDir[".mvn (Wrapper)"]:::config
        Mvnw["mvnw"]:::config
        MvnwCmd["mvnw.cmd"]:::config
    end

    subgraph "Tests & Docs"
        Tests["DemoApplicationTests"]:::test
        Readme["README.md"]:::doc
        License["LICENSE"]:::doc
    end

    External -->|"HTTP Request\n(JSON/XML)"| Controller
    Controller -->|"calls obfuscate()"| Tricks
    Tricks -->|"delegates to"| CPlugin
    Tricks -->|"delegates to"| JavaPlugin
    Tricks -->|"returns obfuscated string"| Controller
    Controller -->|"HTTP Response\n(JSON/XML)"| External

    Config --> Controller
    Pom --> Config
    WrapperDir --> Pom
    Mvnw --> Pom
    MvnwCmd --> Pom

    Tests --> Controller
    Tests --> Tricks

    click Entry "https://github.com/abodx9/obfuscator-x/blob/main/src/main/java/abod/obf/ObfxApplication.java"
    click Controller "https://github.com/abodx9/obfuscator-x/blob/main/src/main/java/abod/obf/ObfuscatorController.java"
    click Tricks "https://github.com/abodx9/obfuscator-x/blob/main/src/main/java/abod/obf/Tricks.java"
    click Config "https://github.com/abodx9/obfuscator-x/blob/main/src/main/resources/application.properties"
    click Pom "https://github.com/abodx9/obfuscator-x/blob/main/pom.xml"
    click WrapperDir "https://github.com/abodx9/obfuscator-x/blob/main/.mvn/wrapper/maven-wrapper.properties"
    click Mvnw "https://github.com/abodx9/obfuscator-x/tree/main/mvnw"
    click MvnwCmd "https://github.com/abodx9/obfuscator-x/blob/main/mvnw.cmd"
    click Tests "https://github.com/abodx9/obfuscator-x/blob/main/src/test/java/abod/obf/DemoApplicationTests.java"
    click Readme "https://github.com/abodx9/obfuscator-x/blob/main/README.md"
    click License "https://github.com/abodx9/obfuscator-x/tree/main/LICENSE"

    classDef external fill:#f9f,stroke:#333,stroke-width:1px
    classDef api fill:#bbf,stroke:#333,stroke-width:1px
    classDef logic fill:#bfb,stroke:#333,stroke-width:1px
    classDef config fill:#ddd,stroke:#333,stroke-width:1px
    classDef test fill:#fcc,stroke:#333,stroke-width:1px
    classDef doc fill:#ccf,stroke:#333,stroke-width:1px
```
