# qeeqbox/social-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/qeeqbox/social-analyzer
- Repository: https://github.com/qeeqbox/social-analyzer

## Overview

#### Purpose and entry points
Social Analyzer is a local OSINT tool that searches and analyzes possible social-media/web profiles for one or more usernames. It supports a Node.js CLI/web app and a Python CLI/package interface. Primary entry points are `app.js`, `app.py`, and the browser UI at `public/app.html`; the Node web app is served on port 9005 per the README.

#### Orchestration and execution modes
The core Node orchestration layer selects scan mode, applies user options (site, country, type, ranking, filters, workers, timeout), and aggregates profile results. `modules/engine.js` is the central execution boundary; `app.js` is the Node command/server entry point. The Python implementation provides a parallel user-facing interface through `app.py`, packaged by `setup.py`.

#### Site catalog and target selection
Search scope is data-driven. The site catalog contains profile URL patterns and site metadata used to select targets by explicit names, country, category/type, or top ranking. Core datasets are `data/sites.json`, `data/countries.json`, and `data/dict.json`. This is the boundary between static target intelligence and active network scanning.

#### Profile discovery pipeline
Discovery is split into scan strategies:
- Fast HTTP-oriented profile checks: `modules/fast-scan.js`
- Slower browser/WebDriver-based checks and richer evidence collection: `modules/slow-scan.js`
- Provider-specific detection paths, including Google/Facebook/Gmail cases: `modules/special-scan.js`

These stages evaluate candidate profile URLs and produce detection state/rating rather than treating HTTP success alone as proof. They may use proxies, custom headers, concurrency controls, retries, and configurable timeouts.

#### Analysis, scoring, and enrichment
Username inputs can be expanded and evaluated through string/name analysis before or alongside scanning. `modules/string-analysis.js` and `modules/name-analysis.js` support permutations, name origins/similarity, language/common-word signals, and limited age-oriented analysis. Scan outcomes are normalized into ratings and profile statistics through `modules/stats.js`; callers can then filter good/maybe/bad and detected/unknown/failed results.

#### Extraction, metadata, and visualization
For found or requested profiles, extraction collects profile text, URLs, patterns, and metadata. `modules/extraction.js` is the enrichment boundary, while `modules/visualize.js` prepares data for metadata/pattern visualization. The UI surface includes `public/app.html` for investigation controls/results and `public/graph.html` for force-directed graph output.

#### External dependencies and runtime infrastructure
Node.js is the principal web/CLI runtime (`package.json`), with Python support declared in `requirements.txt` and `setup.py`. Active scans depend on external websites and may use Selenium WebDriver with installed Firefox/Chrome; OCR/screenshot capabilities require browser and Tesseract-related dependencies. Optional external search integrations include Google and DuckDuckGo APIs, represented by `modules/external-apis.js`. Container deployment is defined by `Dockerfile` and `docker-compose.yml`; compose can provide grid-oriented faster checking. Output artifacts can be written to `logs/` and JSON consumed by CLI, integrations, or the local UI.

Main entry points: [`modules/engine.js`](https://github.com/qeeqbox/social-analyzer/blob/main/modules/engine.js) (Scan orchestrator), [`modules/stats.js`](https://github.com/qeeqbox/social-analyzer/blob/main/modules/stats.js) (Result scoring), [`app.js`](https://github.com/qeeqbox/social-analyzer/blob/main/app.js) (Node CLI & web server), [`modules/fast-scan.js`](https://github.com/qeeqbox/social-analyzer/blob/main/modules/fast-scan.js) (Fast profile checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Interfaces"]
  node_node_entry["Node CLI &amp; web server<br/>Node entry point<br/>[app.js]"]
  node_browser_ui["Investigation UI<br/>browser UI<br/>[app.html]"]
  node_graph_ui["Graph viewer<br/>browser UI<br/>[graph.html]"]
  node_python_entry["Python CLI/package<br/>Python entry point<br/>[app.py]"]
end

subgraph group_node["Node execution"]
  node_node_engine{{"Scan orchestrator<br/>execution engine<br/>[engine.js]"}}
  node_node_runtime["Node runtime<br/>package runtime<br/>[package.json]"]
  node_container["Container deployment<br/>[docker-compose.yml]"]
end

subgraph group_intelligence["Target intelligence"]
  node_site_catalog[("Site catalog<br/>target dataset<br/>[sites.json]")]
  node_country_data[("Country data<br/>target dataset<br/>[countries.json]")]
  node_dictionary[("Language dictionary<br/>analysis dataset<br/>[dict.json]")]
end

subgraph group_discovery["Discovery pipeline"]
  node_fast_scan["Fast profile checks<br/>HTTP scanner<br/>[fast-scan.js]"]
  node_slow_scan["Browser profile checks<br/>WebDriver scanner<br/>[slow-scan.js]"]
  node_special_scan["Provider-specific checks<br/>specialized scanner<br/>[special-scan.js]"]
  node_external_apis["Search integrations<br/>external API client<br/>[external-apis.js]"]
  node_external_sites(("External websites<br/>network targets"))
end

subgraph group_analysis["Analysis &amp; output"]
  node_string_analysis["Username analysis<br/>input expansion<br/>[string-analysis.js]"]
  node_name_analysis["Name analysis<br/>identity signals<br/>[name-analysis.js]"]
  node_stats["Result scoring<br/>normalization<br/>[stats.js]"]
  node_extraction["Profile enrichment<br/>metadata extraction<br/>[extraction.js]"]
  node_visualize["Visualization prep<br/>graph data builder<br/>[visualize.js]"]
  node_logs["Scan artifacts<br/>local output"]
end

node_browser_ui -->|"requests scans"| node_node_entry
node_node_entry -->|"invokes"| node_node_engine
node_python_entry -.->|"parallel scan interface"| node_node_engine
node_node_runtime -->|"runs"| node_node_entry
node_container -->|"deploys"| node_node_entry
node_node_engine -->|"selects targets"| node_site_catalog
node_node_engine -->|"filters by country"| node_country_data
node_node_engine -->|"expands inputs"| node_string_analysis
node_string_analysis -->|"uses language signals"| node_dictionary
node_node_engine -->|"evaluates names"| node_name_analysis
node_node_engine -->|"fast mode"| node_fast_scan
node_node_engine -->|"slow mode"| node_slow_scan
node_node_engine -->|"provider paths"| node_special_scan
node_node_engine -.->|"optional search"| node_external_apis
node_fast_scan -->|"checks profiles"| node_external_sites
node_slow_scan -->|"checks profiles"| node_external_sites
node_special_scan -->|"checks providers"| node_external_sites
node_external_apis -.->|"queries"| node_external_sites
node_fast_scan -->|"detection outcomes"| node_stats
node_slow_scan -->|"evidence and outcomes"| node_stats
node_special_scan -->|"detection outcomes"| node_stats
node_stats -->|"found profiles"| node_extraction
node_extraction -->|"metadata and patterns"| node_visualize
node_visualize -->|"graph data"| node_graph_ui
node_stats -->|"filtered results"| node_browser_ui
node_stats -->|"writes results"| node_logs

click node_node_entry "https://github.com/qeeqbox/social-analyzer/blob/main/app.js"
click node_browser_ui "https://github.com/qeeqbox/social-analyzer/blob/main/public/app.html"
click node_graph_ui "https://github.com/qeeqbox/social-analyzer/blob/main/public/graph.html"
click node_python_entry "https://github.com/qeeqbox/social-analyzer/blob/main/app.py"
click node_node_engine "https://github.com/qeeqbox/social-analyzer/blob/main/modules/engine.js"
click node_node_runtime "https://github.com/qeeqbox/social-analyzer/blob/main/package.json"
click node_site_catalog "https://github.com/qeeqbox/social-analyzer/blob/main/data/sites.json"
click node_country_data "https://github.com/qeeqbox/social-analyzer/blob/main/data/countries.json"
click node_dictionary "https://github.com/qeeqbox/social-analyzer/blob/main/data/dict.json"
click node_string_analysis "https://github.com/qeeqbox/social-analyzer/blob/main/modules/string-analysis.js"
click node_name_analysis "https://github.com/qeeqbox/social-analyzer/blob/main/modules/name-analysis.js"
click node_fast_scan "https://github.com/qeeqbox/social-analyzer/blob/main/modules/fast-scan.js"
click node_slow_scan "https://github.com/qeeqbox/social-analyzer/blob/main/modules/slow-scan.js"
click node_special_scan "https://github.com/qeeqbox/social-analyzer/blob/main/modules/special-scan.js"
click node_external_apis "https://github.com/qeeqbox/social-analyzer/blob/main/modules/external-apis.js"
click node_stats "https://github.com/qeeqbox/social-analyzer/blob/main/modules/stats.js"
click node_extraction "https://github.com/qeeqbox/social-analyzer/blob/main/modules/extraction.js"
click node_visualize "https://github.com/qeeqbox/social-analyzer/blob/main/modules/visualize.js"
click node_container "https://github.com/qeeqbox/social-analyzer/blob/main/docker-compose.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_entry,node_browser_ui,node_graph_ui,node_python_entry toneBlue
class node_node_engine,node_node_runtime,node_container toneAmber
class node_site_catalog,node_country_data,node_dictionary toneMint
class node_fast_scan,node_slow_scan,node_special_scan,node_external_apis,node_external_sites toneRose
class node_string_analysis,node_name_analysis,node_stats,node_extraction,node_visualize,node_logs toneIndigo
```

## Components

### Interfaces

- [Node CLI & web server](https://github.com/qeeqbox/social-analyzer/blob/main/app.js): Node entry point · Serves the local web app on port 9005. · `app.js`
- [Investigation UI](https://github.com/qeeqbox/social-analyzer/blob/main/public/app.html): browser UI · `public/app.html`
- [Graph viewer](https://github.com/qeeqbox/social-analyzer/blob/main/public/graph.html): browser UI · `public/graph.html`
- [Python CLI/package](https://github.com/qeeqbox/social-analyzer/blob/main/app.py): Python entry point · Parallel user-facing interface. · `app.py`

### Node execution

- [Scan orchestrator](https://github.com/qeeqbox/social-analyzer/blob/main/modules/engine.js): execution engine · Applies options, selects modes, and aggregates results. · `modules/engine.js`
- [Node runtime](https://github.com/qeeqbox/social-analyzer/blob/main/package.json): package runtime · `package.json`
- [Container deployment](https://github.com/qeeqbox/social-analyzer/blob/main/docker-compose.yml): deployment · Compose can provide grid-oriented faster checking. · `docker-compose.yml`

### Target intelligence

- [Site catalog](https://github.com/qeeqbox/social-analyzer/blob/main/data/sites.json): target dataset · Profile URL patterns and site metadata. · `data/sites.json`
- [Country data](https://github.com/qeeqbox/social-analyzer/blob/main/data/countries.json): target dataset · `data/countries.json`
- [Language dictionary](https://github.com/qeeqbox/social-analyzer/blob/main/data/dict.json): analysis dataset · `data/dict.json`

### Discovery pipeline

- [Fast profile checks](https://github.com/qeeqbox/social-analyzer/blob/main/modules/fast-scan.js): HTTP scanner · `modules/fast-scan.js`
- [Browser profile checks](https://github.com/qeeqbox/social-analyzer/blob/main/modules/slow-scan.js): WebDriver scanner · Collects richer evidence through browser checks. · `modules/slow-scan.js`
- [Provider-specific checks](https://github.com/qeeqbox/social-analyzer/blob/main/modules/special-scan.js): specialized scanner · Handles Google, Facebook, and Gmail cases. · `modules/special-scan.js`
- [Search integrations](https://github.com/qeeqbox/social-analyzer/blob/main/modules/external-apis.js): external API client · Optional Google and DuckDuckGo integrations. · `modules/external-apis.js`
- **External websites**: network targets

### Analysis & output

- [Username analysis](https://github.com/qeeqbox/social-analyzer/blob/main/modules/string-analysis.js): input expansion · Builds and evaluates username permutations. · `modules/string-analysis.js`
- [Name analysis](https://github.com/qeeqbox/social-analyzer/blob/main/modules/name-analysis.js): identity signals · Provides origin, similarity, and language signals. · `modules/name-analysis.js`
- [Result scoring](https://github.com/qeeqbox/social-analyzer/blob/main/modules/stats.js): normalization · Produces ratings, profile statistics, and filter states. · `modules/stats.js`
- [Profile enrichment](https://github.com/qeeqbox/social-analyzer/blob/main/modules/extraction.js): metadata extraction · Collects text, URLs, patterns, and metadata. · `modules/extraction.js`
- [Visualization prep](https://github.com/qeeqbox/social-analyzer/blob/main/modules/visualize.js): graph data builder · `modules/visualize.js`
- **Scan artifacts**: local output · Logs and JSON results for CLI, integrations, and UI.

## Connections

- Investigation UI → Node CLI & web server: requests scans
- Node CLI & web server → Scan orchestrator: invokes
- Python CLI/package → Scan orchestrator: parallel scan interface
- Node runtime → Node CLI & web server: runs
- Container deployment → Node CLI & web server: deploys
- Scan orchestrator → Site catalog: selects targets
- Scan orchestrator → Country data: filters by country
- Scan orchestrator → Username analysis: expands inputs
- Username analysis → Language dictionary: uses language signals
- Scan orchestrator → Name analysis: evaluates names
- Scan orchestrator → Fast profile checks: fast mode
- Scan orchestrator → Browser profile checks: slow mode
- Scan orchestrator → Provider-specific checks: provider paths
- Scan orchestrator → Search integrations: optional search
- Fast profile checks → External websites: checks profiles
- Browser profile checks → External websites: checks profiles
- Provider-specific checks → External websites: checks providers
- Search integrations → External websites: queries
- Fast profile checks → Result scoring: detection outcomes
- Browser profile checks → Result scoring: evidence and outcomes
- Provider-specific checks → Result scoring: detection outcomes
- Result scoring → Profile enrichment: found profiles
- Profile enrichment → Visualization prep: metadata and patterns
- Visualization prep → Graph viewer: graph data
- Result scoring → Investigation UI: filtered results
- Result scoring → Scan artifacts: writes results
