# brodev3/antidetect architecture

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

- Interactive diagram: https://gitdiagram.com/brodev3/antidetect
- Repository: https://github.com/brodev3/antidetect

## Overview

##### Project type and purpose
- This is a Node.js console application (“Antidetect browser”) for creating and managing multiple virtual browser profiles with anti-detection/fingerprinting protection.
- It connects to a Google Sheets “Dashboard,” uses Google Drive for storage, and calls an external FingerprintSwitcher service to mask browser fingerprints.

##### File structure
Top-level:
- index.js – entry point, boots the console UI and orchestrates modules
- config.js / .env_example – configuration loader for Google API credentials and local/drive paths
- package.json – dependencies (googleapis, inquirer or similar console UI, request/http libs)
- LICENSE, README.md

app/
- commands.js – maps console commands (create, list, open, delete profiles)
- interfaces.js – defines the console UI menus and prompt flows

scr/ (scripts/core logic)
- browser.js – spawns browser processes (likely Puppeteer/Playwright or native browser) with fingerprint & proxy settings
- db.js – reads/writes profile meta from Google Sheets via Sheets API
- manage.js – high-level orchestration (create profile folder structure, tie together browser.js & fingerprint.js & db.js)
- fingerprint.js – fetches and applies fingerprint JSON from FingerprintSwitcher service
- utils.js – shared helpers (parsing, error handling, file‐system interactions)

engines/ – example engine templates, showing pluggable engine architecture for additional browser backends

##### README for additional insights
- Core features: profile creation, proxy setup, fingerprint masking (User-Agent, canvas, WebRTC), data isolation (local/cloud), Google-Sheets “Dashboard” as the data store, Google Drive sync for profile directories.
- External services: Google Sheets API, Google Drive API, FingerprintSwitcher API.
- Usage flow: user issues console commands → module loads credentials → reads/writes sheet → fetches fingerprint → spawns browser.

##### Be as detailed as possible
- How config.js propagates into each module that needs credentials or paths.
- “engines/” as a plugin registry feeding into browser.js.
- Don’t overthink—simply outline every logical component and its interactions to provide maximum clarity.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry Point
    ENTRY["index.js"]:::internal
    click ENTRY "https://github.com/brodev3/antidetect/blob/main/index.js"

    %% Console UI Layer
    subgraph "Console UI Layer"
        UI1["app/interfaces.js"]:::internal
        UI2["app/commands.js"]:::internal
    end
    click UI1 "https://github.com/brodev3/antidetect/blob/main/app/interfaces.js"
    click UI2 "https://github.com/brodev3/antidetect/blob/main/app/commands.js"

    %% Core Orchestration Layer
    subgraph "Core Orchestration Layer"
        MGR["scr/manage.js"]:::internal
        UTIL["scr/utils.js"]:::internal
    end
    click MGR "https://github.com/brodev3/antidetect/blob/main/scr/manage.js"

    %% Data Layer
    subgraph "Data Layer"
        DB["scr/db.js"]:::internal
        CFG["config.js / .env_example"]:::internal
        subgraph "Local Storage & Drive Sync"
            FS["Local File System"]:::internal
            DRIVE_SYNC["Google Drive API"]:::external
        end
    end
    click DB "https://github.com/brodev3/antidetect/blob/main/scr/db.js"
    click CFG "https://github.com/brodev3/antidetect/blob/main/config.js"
    click CFG "https://github.com/brodev3/antidetect/blob/main/.env_example"

    %% External Services
    extSheets["Google Sheets API"]:::external
    extFP["FingerprintSwitcher API"]:::external

    %% Fingerprint Service Layer
    subgraph "Fingerprint Service"
        FP["scr/fingerprint.js"]:::internal
    end
    click FP "https://github.com/brodev3/antidetect/blob/main/scr/fingerprint.js"

    %% Browser Launcher & Plugins
    subgraph "Browser Launcher & Engines"
        BR["scr/browser.js"]:::internal
        ENGINES["engines/"]:::internal
        BROWSER_PROC["Browser Process"]:::runtime
    end
    click BR "https://github.com/brodev3/antidetect/blob/main/scr/browser.js"
    click ENGINES "https://github.com/brodev3/antidetect/tree/main/engines/"

    %% Flows
    ENTRY -->|"boot CLI"| UI1
    UI1 -->|"user input"| UI2
    UI2 -->|"invoke command"| MGR
    ENTRY -->|"load config"| CFG

    MGR -->|"use config"| CFG
    MGR -->|"orchestrate"| UTIL
    UTIL -->|"fs operations"| FS
    FS -->|"sync profile dirs"| DRIVE_SYNC

    MGR -->|"read/write profiles"| DB
    DB -->|"fetch/update"| extSheets

    MGR -->|"fetch fingerprint"| FP
    FP -->|"get JSON"| extFP

    MGR -->|"launch browser"| BR
    ENGINES -->|"plugin registry"| BR
    BR -->|"spawn with fingerprint & proxy"| BROWSER_PROC

    %% Styles
    classDef internal fill:#D0E6FF,stroke:#3B82F6,color:#1E3A8A;
    classDef external fill:#D1FAE5,stroke:#10B981,color:#065F46,stroke-dasharray: 5 5;
    classDef runtime fill:#FFEDD5,stroke:#F97316,color:#C2410C;
```
