# horsicq/detect-it-easy architecture

> Architecture diagram of the GitHub repository horsicq/detect-it-easy, 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/horsicq/detect-it-easy
- Repository: https://github.com/horsicq/detect-it-easy

## Overview

##### Main Components
- Detection Engine Core:
- Signature Database:
- The “db” directory is highly structured, with subdirectories for numerous file types (APK, PE, ELF, MS-DOS, etc.). Represent this as a central repository module or a set of submodules.
- Scripted Detection Module:
- That the engine supports custom scripts (JavaScript-like scripting language) for flexible signature management.
- User Interfaces:
- Three distinct interfaces – “die” (full GUI), “diec” (command-line/batch processing), and “diel” (lightweight GUI). They all interact with the detection engine.
- API/Library:
- Since there’s also a DIE API Library available for developers, include an API component that exposes functionality for external integration.
- Build/Deployment and External Tools:
- Docker container (from the Dockerfile) as part of the deployment strategy. Also note build scripts, CMake/detectiteasy.cmake, and configuration files that enable cross-platform deployment.
- Supporting Documentation:
- Although not part of runtime, the docs, help, and README indicate detailed guidance for building and using DiE. You may include an “Documentation & Help” node that interacts with developers and users.

##### Relationships and Interactions
- Data Flow:
- Engine pulling signature data from the signature database.
- How the scripting module is part of the detection engine layer to modify and extend detection logic.
- API as an access point for external requests feeding into the detection engine.
- Dependency:
- External package managers and OS-specific installations can be listed as environment dependencies.

##### Architectural Patterns and Design Principles
- Modular Architecture:
- The clear separation of the detection engine, signature database, and user interaction layers reflects a modular design that isolates file analysis from presentation and extensibility.
- Cross-Platform Considerations:
- Extensibility and Scripting:
- A distinct scripting module that allows new detection logic – this is a key design principle that makes DiE adaptable.
- Separation of Concerns:
- Each interface version (die, diec, diel) is separated from the engine, demonstrating clear boundaries between presentation and business logic.

##### Relevant Technologies and Frameworks
- Cross-Platform Support:
- That DiE is built to run on multiple platforms.
- Docker:
- Docker as part of the containerization and deployment strategy.
- Script Engine Integration:
- If applicable, include the underlying technology used for interpretting the detection scripts (a JavaScript-like engine) to emphasize its flexibility.
- Development Tools:
- Reference integration with package managers (Chocolatey, AUR, etc.) and use of GitHub workflows.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Layer
    subgraph "User Interface Layer"
        DIE["User Interface - die (GUI)"]:::ui
        DIEC["User Interface - diec (Command-line)"]:::ui
        DIEL["User Interface - diel (Lightweight GUI)"]:::ui
    end

    %% Core Processing Layer
    subgraph "Core Processing"
        DE["Detection Engine Core"]:::engine
        SD["Scripted Detection Module"]:::engine
        DB["Signature Database"]:::database
    end

    %% Integration & Deployment Layer
    subgraph "Integration & Deployment"
        API["API/Library"]:::api
        BD["Build/Deployment & External Tools"]:::build
    end

    %% Documentation & Help (standalone)
    DOC["Documentation & Help"]:::docs

    %% Relationships: UI Layer to Core Engine
    DIE -->|"inputs"| DE
    DIEC -->|"inputs"| DE
    DIEL -->|"inputs"| DE

    %% Relationships: Core Engine interactions
    DE -->|"queries"| DB
    DE -->|"integrates"| SD

    %% Relationships: External Access and Deployment
    API -->|"accesses"| DE
    BD -->|"deploys"| DE
    BD -->|"deploys"| DB

    %% Documentation supports API usage
    DOC -->|"supports"| API

    %% Click Events
    click DE "https://github.com/horsicq/detect-it-easy/blob/master/detectiteasy.cmake"
    click DB "https://github.com/horsicq/detect-it-easy/tree/master/db/"
    click SD "https://github.com/horsicq/detect-it-easy/tree/master/db_custom/"
    click DIEC "https://github.com/horsicq/detect-it-easy/blob/master/docker/diec.sh"
    click BD "https://github.com/horsicq/detect-it-easy/tree/master/Dockerfile"
    click DOC "https://github.com/horsicq/detect-it-easy/tree/master/docs/"
    click API "https://github.com/horsicq/detect-it-easy/blob/master/README.md"

    %% Styles / Classes
    classDef engine fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef database fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef ui fill:#FFDDC1,stroke:#000,stroke-width:2px;
    classDef build fill:#FFC0CB,stroke:#000,stroke-width:2px;
    classDef docs fill:#FFFF99,stroke:#000,stroke-width:2px;
    classDef api fill:#D3D3D3,stroke:#000,stroke-width:2px;
```
