# levalz/leninja-discord-evs-gen architecture

> Architecture diagram of the GitHub repository levalz/leninja-discord-evs-gen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/levalz/leninja-discord-evs-gen
- Repository: https://github.com/levalz/leninja-discord-evs-gen

## Overview

LeNinja is a browser-automation account-registration tool with a bundled Nopecha CAPTCHA extension. Its principal workflow is configured, concurrent registration attempts: prepare browser, proxy, and fingerprint; create and verify a mailbox; complete the browser flow and CAPTCHA; extract and validate a token; then record outcomes and summarize the run. The README documents major integrations and capabilities. The large obfuscated extension files were only partially sampled, so its internal dispatch relationships are not inferred.

Main entry points: [`main.py`](https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py) (Registration flow), [`extension/nopecha_ext/background.js`](https://github.com/levalz/leninja-discord-evs-gen/blob/main/extension/nopecha_ext/background.js) (CAPTCHA extension runtime), [`config/config.yaml`](https://github.com/levalz/leninja-discord-evs-gen/blob/main/config/config.yaml) (Configuration), [`data/fingerprints_default.jsonl`](https://github.com/levalz/leninja-discord-evs-gen/blob/main/data/fingerprints_default.jsonl) (Fingerprint pool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Run orchestration"]
  node_runner["Run entry point<br/>[main.py]"]
  node_configuration["Configuration<br/>[config.yaml]"]
  node_workers["Concurrent workers<br/>[main.py]"]
  node_proxy_pool["Proxy pool<br/>[main.py]"]
  node_fingerprints["Fingerprint pool"]
  node_metrics["Run metrics<br/>[main.py]"]
end

subgraph group_registration["Registration workflow"]
  node_registration_flow["Registration flow<br/>[main.py]"]
  node_mailbox["Mailbox creation<br/>[main.py]"]
  node_form_entry["Humanized form entry<br/>[main.py]"]
  node_captcha_chain["CAPTCHA solver chain<br/>[main.py]"]
  node_email_verification["Email verification<br/>[main.py]"]
  node_token_validation["Token extraction<br/>[main.py]"]
  node_result_files["Account and token files<br/>[accounts.txt]"]
end

subgraph group_integrations["External integrations"]
  node_browser(("Chromium browser"))
  node_discord(("Discord registration service"))
  node_mail_providers(("Mail providers"))
  node_groq(("Groq vision API"))
  node_claude(("Claude vision API"))
  node_proxy_check(("IP check service"))
end

subgraph group_extension["Nopecha extension"]
  node_captcha_extension["CAPTCHA extension runtime<br/>[background.js]"]
  node_captcha_adapters["CAPTCHA handlers"]
  node_extension_ui["Extension popup<br/>[popup.js]"]
  node_event_hook["Event hook loader<br/>[loader.js]"]
  node_element_locator["Challenge locator<br/>[locate.js]"]
end

node_operator(("Operator"))

node_operator -->|"starts run"| node_runner
node_runner -->|"loads config"| node_configuration
node_runner -->|"runs attempts"| node_workers
node_workers -->|"claims proxy"| node_proxy_pool
node_workers -->|"chooses fingerprint"| node_fingerprints
node_proxy_pool -->|"health checks"| node_proxy_check
node_workers -->|"launches browser"| node_browser
node_workers -->|"runs attempt"| node_registration_flow
node_registration_flow -->|"creates mailbox"| node_mailbox
node_mailbox -->|"requests mailbox"| node_mail_providers
node_registration_flow -->|"fills form"| node_form_entry
node_registration_flow -->|"handles challenge"| node_captcha_chain
node_captcha_chain -->|"tries first"| node_captcha_extension
node_captcha_chain -.->|"optional fallback"| node_groq
node_captcha_chain -.->|"optional fallback"| node_claude
node_registration_flow -->|"verifies email"| node_email_verification
node_email_verification -->|"polls inbox"| node_mail_providers
node_registration_flow -->|"extracts token"| node_token_validation
node_token_validation -->|"validates token"| node_discord
node_registration_flow -->|"registers account"| node_discord
node_workers -->|"records outcome"| node_metrics
node_metrics -.->|"writes results"| node_result_files
node_captcha_extension -.->|"dispatches handlers"| node_captcha_adapters

click node_runner "https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py"
click node_configuration "https://github.com/levalz/leninja-discord-evs-gen/blob/main/config/config.yaml"
click node_workers "https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py"
click node_proxy_pool "https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py"
click node_fingerprints "https://github.com/levalz/leninja-discord-evs-gen/blob/main/data/fingerprints_default.jsonl"
click node_metrics "https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py"
click node_registration_flow "https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py"
click node_mailbox "https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py"
click node_form_entry "https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py"
click node_captcha_chain "https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py"
click node_email_verification "https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py"
click node_token_validation "https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py"
click node_result_files "https://github.com/levalz/leninja-discord-evs-gen/blob/main/output/accounts.txt"
click node_captcha_extension "https://github.com/levalz/leninja-discord-evs-gen/blob/main/extension/nopecha_ext/background.js"
click node_captcha_adapters "https://github.com/levalz/leninja-discord-evs-gen/tree/main/extension/nopecha_ext/captcha"
click node_extension_ui "https://github.com/levalz/leninja-discord-evs-gen/blob/main/extension/nopecha_ext/popup.js"
click node_event_hook "https://github.com/levalz/leninja-discord-evs-gen/blob/main/extension/nopecha_ext/eventhook/loader.js"
click node_element_locator "https://github.com/levalz/leninja-discord-evs-gen/blob/main/extension/nopecha_ext/locate.js"

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_runner,node_configuration,node_workers,node_proxy_pool,node_fingerprints,node_metrics toneBlue
class node_registration_flow,node_mailbox,node_form_entry,node_captcha_chain,node_email_verification,node_token_validation,node_result_files toneAmber
class node_browser,node_discord,node_mail_providers,node_groq,node_claude,node_proxy_check toneMint
class node_captcha_extension,node_captcha_adapters,node_extension_ui,node_event_hook,node_element_locator toneRose
class node_operator toneIndigo
```

## Components

### Run orchestration

- [Run entry point](https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py): `main.py`
- [Configuration](https://github.com/levalz/leninja-discord-evs-gen/blob/main/config/config.yaml): `config/config.yaml`
- [Concurrent workers](https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py): `main.py`
- [Proxy pool](https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py): `main.py`
- [Fingerprint pool](https://github.com/levalz/leninja-discord-evs-gen/blob/main/data/fingerprints_default.jsonl): `data/fingerprints_default.jsonl`
- [Run metrics](https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py): `main.py`

### Registration workflow

- [Registration flow](https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py): `main.py`
- [Mailbox creation](https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py): `main.py`
- [Humanized form entry](https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py): `main.py`
- [CAPTCHA solver chain](https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py): `main.py`
- [Email verification](https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py): `main.py`
- [Token extraction](https://github.com/levalz/leninja-discord-evs-gen/blob/main/main.py): `main.py`
- [Account and token files](https://github.com/levalz/leninja-discord-evs-gen/blob/main/output/accounts.txt): `output/accounts.txt`

### External integrations

- **Chromium browser**
- **Discord registration service**
- **Mail providers**
- **Groq vision API**
- **Claude vision API**
- **IP check service**

### Nopecha extension

- [CAPTCHA extension runtime](https://github.com/levalz/leninja-discord-evs-gen/blob/main/extension/nopecha_ext/background.js): `extension/nopecha_ext/background.js`
- [CAPTCHA handlers](https://github.com/levalz/leninja-discord-evs-gen/tree/main/extension/nopecha_ext/captcha): `extension/nopecha_ext/captcha`
- [Extension popup](https://github.com/levalz/leninja-discord-evs-gen/blob/main/extension/nopecha_ext/popup.js): `extension/nopecha_ext/popup.js`
- [Event hook loader](https://github.com/levalz/leninja-discord-evs-gen/blob/main/extension/nopecha_ext/eventhook/loader.js): `extension/nopecha_ext/eventhook/loader.js`
- [Challenge locator](https://github.com/levalz/leninja-discord-evs-gen/blob/main/extension/nopecha_ext/locate.js): `extension/nopecha_ext/locate.js`

### Other components

- **Operator**

## Connections

- Operator → Run entry point: starts run (evidence: `README.md`)
- Run entry point → Configuration: loads config (evidence: `README.md`)
- Run entry point → Concurrent workers: runs attempts (evidence: `README.md`)
- Concurrent workers → Proxy pool: claims proxy (evidence: `README.md`)
- Concurrent workers → Fingerprint pool: chooses fingerprint (evidence: `README.md`)
- Proxy pool → IP check service: health checks (evidence: `README.md`)
- Concurrent workers → Chromium browser: launches browser (evidence: `README.md`)
- Concurrent workers → Registration flow: runs attempt (evidence: `README.md`)
- Registration flow → Mailbox creation: creates mailbox (evidence: `README.md`)
- Mailbox creation → Mail providers: requests mailbox (evidence: `README.md`)
- Registration flow → Humanized form entry: fills form (evidence: `README.md`)
- Registration flow → CAPTCHA solver chain: handles challenge (evidence: `README.md`)
- CAPTCHA solver chain → CAPTCHA extension runtime: tries first (evidence: `README.md`)
- CAPTCHA solver chain → Groq vision API: optional fallback (evidence: `README.md`)
- CAPTCHA solver chain → Claude vision API: optional fallback (evidence: `README.md`)
- Registration flow → Email verification: verifies email (evidence: `README.md`)
- Email verification → Mail providers: polls inbox (evidence: `README.md`)
- Registration flow → Token extraction: extracts token (evidence: `README.md`)
- Token extraction → Discord registration service: validates token (evidence: `README.md`)
- Registration flow → Discord registration service: registers account (evidence: `README.md`)
- Concurrent workers → Run metrics: records outcome (evidence: `README.md`)
- Run metrics → Account and token files: writes results
- CAPTCHA extension runtime → CAPTCHA handlers: dispatches handlers
