# dx-bear/deflare architecture

> Architecture diagram of the GitHub repository dx-bear/deflare, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dx-bear/deflare
- Repository: https://github.com/dx-bear/deflare

## Overview

Deflare is a small Python utility for detecting Turnstile challenges and attempting checkbox bypasses through Patchright or Pydoll. Its runtime is concentrated in `solver.py`: the public API checks for challenges, resolves iframe coordinates (including through shadow roots via CDP), and the retrying bypass flow uses a backend-specific click. The excerpts show coordinate-resolution internals; the README documents the broader API and backend behavior, so those links are cited there.

Main entry points: [`src/deflare/solver.py`](https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py) (Public solver API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Solver runtime"]
  node_api["Public solver API<br/>[solver.py]"]
  node_detection["Challenge detection<br/>[solver.py]"]
  node_coordinates["Coordinate resolution<br/>[solver.py]"]
  node_cdp["CDP DOM inspection<br/>[solver.py]"]
  node_bypass["Retry and bypass<br/>[solver.py]"]
  node_click["Backend checkbox click<br/>[solver.py]"]
end

node_browser(("Automation page"))

node_browser -->|"provides page"| node_api
node_api -->|"checks challenge"| node_detection
node_api -->|"gets coordinates"| node_coordinates
node_api -->|"starts attempts"| node_bypass
node_bypass -->|"checks challenge"| node_detection
node_bypass -->|"gets coordinates"| node_coordinates
node_coordinates -->|"pierces DOM"| node_cdp
node_bypass -->|"clicks checkbox"| node_click
node_click -->|"interacts with page"| node_browser

click node_api "https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py"
click node_detection "https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py"
click node_coordinates "https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py"
click node_cdp "https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py"
click node_bypass "https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py"
click node_click "https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py"

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_api,node_detection,node_coordinates,node_cdp,node_bypass,node_click toneBlue
class node_browser toneIndigo
```

## Components

### Solver runtime

- [Public solver API](https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py): `src/deflare/solver.py`
- [Challenge detection](https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py): `src/deflare/solver.py`
- [Coordinate resolution](https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py): `src/deflare/solver.py`
- [CDP DOM inspection](https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py): `src/deflare/solver.py`
- [Retry and bypass](https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py): `src/deflare/solver.py`
- [Backend checkbox click](https://github.com/dx-bear/deflare/blob/main/src/deflare/solver.py): `src/deflare/solver.py`

### Other components

- **Automation page**

## Connections

- Automation page → Public solver API: provides page (evidence: `README.md`)
- Public solver API → Challenge detection: checks challenge (evidence: `README.md`)
- Public solver API → Coordinate resolution: gets coordinates (evidence: `README.md`)
- Public solver API → Retry and bypass: starts attempts (evidence: `README.md`)
- Retry and bypass → Challenge detection: checks challenge (evidence: `README.md`)
- Retry and bypass → Coordinate resolution: gets coordinates (evidence: `src/deflare/solver.py`)
- Coordinate resolution → CDP DOM inspection: pierces DOM (evidence: `src/deflare/solver.py`)
- Retry and bypass → Backend checkbox click: clicks checkbox (evidence: `README.md`)
- Backend checkbox click → Automation page: interacts with page (evidence: `README.md`)
