# joblinours/workzint architecture

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

- Interactive diagram: https://gitdiagram.com/joblinours/workzint
- Repository: https://github.com/joblinours/workzint

## Overview

##### Identifying the Project Type and Purpose
- The project is a workflow automation tool for OSINT analyses.
- Its purpose is to streamline data collection using tools (Holehe, SpiderFoot, Sherlock), merge the outputs, generate comprehensive reports (in Markdown/PDF), capture screenshots of identified links, and provide an interface via a web API for further interaction.

##### Breaking Down the Main Components
a. Data Input & Management:
- API & Database: An external API (site_web/api.php) is used, along with configuration files in the .env folder, to retrieve emails/noms d'utilisateur from a database.
- Environment & Credentials: Configuration files (.web_creds.conf and .db_connect_osint) store database and API credentials.

b. Data Collection Module:
- Scripts for OSINT data collection:
- holeheson.py: Executes Holehe for email data.
- spiderfood.py: Executes SpiderFoot for additional email-based data.
- cherchlock.py: Executes Sherlock for username analyses.
- These tools are typically containerized using Docker, emphasizing a separation where each tool might run in its isolated environment.

c. Data Aggregation and Processing:
- merge.py: Merges data collected from the different OSINT tools, deduplicates information, and organizes it for subsequent use.
- This module acts as the intermediary that ensures data consistency.

d. Report Generation:
- rapport.py: Uses merged data to produce detailed reports in Markdown and optionally converts them to PDF via Pandoc.
- Reports and logs are stored in the /rapport directory for easy access.

e. Screenshot Capture Module:
- Integrated within data processing (or possibly as part of merge.py), it automatically visits detected links to capture screenshots, saving them in the /screen directory.

f. Orchestration:
- god.py: The central orchestrator that sequences the entire workflow—from triggering collection scripts, handling API calls to fetching emails, to coordinating subsequent merge and reporting steps.

g. Web Interface:
- site_web/analyse.html and site_web/api.php:
- Offers an API to integrate with other systems or retrieve data from the database.

##### Relationships and Data Flow
- Input Stage:
- The system receives target emails via an API call to the database (configured via .env files).
- god.py initiates the workflow.
- Data Collection Stage:
- god.py triggers individual collection scripts (holeheson.py, spiderfood.py, cherchlock.py) that run inside Docker containers.
- Each script outputs results in JSON format to the /result directory.
- Data Aggregation and Reporting:
- merge.py takes the JSON files as inputs, deduplicates and merges the data, and even triggers screenshot captures.
- rapport.py then processes these results to generate user-centric reports.
- Visualization:
- The generated reports (in /rapport) and screenshots (in /screen) are made accessible via the web interface.
- The API (site_web/api.php) further enables data retrieval from a database.
- Support Technologies:
- Docker is critical to encapsulate external OSINT tools.
- Pandoc is used to convert Markdown reports into PDFs.

##### Architectural Patterns and Design Principles
- Modularity: Components are well-separated (collection, aggregation, reporting), which is reflected in the directory structure.
- Orchestration: A central orchestrator (god.py) to sequence and coordinate tasks.
- Containerization: Use of Docker to run external tools independently.
- API-driven communication: Between the web interface and the database for dynamic data retrieval.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Input & Management
    subgraph "Data Input & Management"
        Input["API & Credentials\n(.env, config files)"]
    end

    %% Orchestration
    subgraph "Orchestration"
        God["god.py (Orchestrator)"]
    end

    %% Data Collection Module
    subgraph "Data Collection Module"
        Holehe["holeheson.py (Holehe)"]
        SpiderFood["spiderfood.py (SpiderFoot)"]
        Sherlock["cherchlock.py (Sherlock)"]
    end

    %% External Tools
    subgraph "External Tools"
        Docker["Docker Containers"]
    end

    %% Data Aggregation & Report Generation
    subgraph "Data Aggregation & Report Generation"
        Merge["merge.py (Data Aggregation)"]
        Rapport["rapport.py (Report Generation)"]
        Screenshots["Screenshot Capture"]
        Pandoc["Pandoc (PDF Converter)"]
        ReportsStore["Reports Storage\n(Markdown/PDF)"]
        ScreensStore["Screenshots Storage"]
    end

    %% Web Interface
    subgraph "Web Interface"
        Analyse["Web Analysis Page (UI)"]
        WebAPI["Web API (Data Retrieval)"]
    end

    %% Connections
    Input -->|"feeds"| God
    God -->|"triggers"| Holehe
    God -->|"triggers"| SpiderFood
    God -->|"triggers"| Sherlock

    Docker ---|"containerizes"| Holehe
    Docker --- SpiderFood
    Docker --- Sherlock

    Holehe -->|"outputs JSON"| Merge
    SpiderFood --> Merge
    Sherlock --> Merge

    Merge -->|"aggregates data"| Rapport
    Merge -->|"captures links"| Screenshots

    Rapport -->|"generates"| ReportsStore
    Rapport -->|"converts via"| Pandoc
    Pandoc -->|"produces PDF"| ReportsStore

    Screenshots -->|"saves to"| ScreensStore

    ReportsStore -->|"displays in"| Analyse
    ReportsStore --> WebAPI
    ScreensStore --> Analyse
    ScreensStore --> WebAPI

    %% Click Events
    click Input "https://github.com/joblinours/workzint/blob/main/site_web/api.php"
    click God "https://github.com/joblinours/workzint/blob/main/script/god.py"
    click Holehe "https://github.com/joblinours/workzint/blob/main/script/holeheson.py"
    click SpiderFood "https://github.com/joblinours/workzint/blob/main/script/spiderfood.py"
    click Sherlock "https://github.com/joblinours/workzint/blob/main/script/cherchlock.py"
    click Merge "https://github.com/joblinours/workzint/blob/main/script/merge.py"
    click Rapport "https://github.com/joblinours/workzint/blob/main/script/rapport.py"
    click Analyse "https://github.com/joblinours/workzint/blob/main/site_web/analyse.html"
    click WebAPI "https://github.com/joblinours/workzint/blob/main/site_web/api.php"
    click ReportsStore "https://github.com/joblinours/workzint/tree/main/rapport"
    click ScreensStore "https://github.com/joblinours/workzint/tree/main/screen"

    %% Styles
    classDef input fill:#FDF6E3,stroke:#333,stroke-width:2px;
    classDef orchestration fill:#C1E1FF,stroke:#333,stroke-width:2px;
    classDef collection fill:#FFCCE5,stroke:#333,stroke-width:2px;
    classDef aggregation fill:#CCFFCC,stroke:#333,stroke-width:2px;
    classDef reporting fill:#CCFFFF,stroke:#333,stroke-width:2px;
    classDef interface fill:#FFF2CC,stroke:#333,stroke-width:2px;
    classDef storage fill:#FF9999,stroke:#333,stroke-width:2px;
    classDef external fill:#E0E0E0,stroke:#333,stroke-width:2px;

    class Input input;
    class God orchestration;
    class Holehe,SpiderFood,Sherlock collection;
    class Merge aggregation;
    class Rapport,Screenshots reporting;
    class ReportsStore,ScreensStore storage;
    class Analyse,WebAPI interface;
    class Docker,Pandoc external;
```
