# confeden/antigravity architecture

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

- Interactive diagram: https://gitdiagram.com/confeden/antigravity
- Repository: https://github.com/confeden/antigravity

## Overview

Antigravity Unlocker is a Windows/Linux tool for making Google’s Antigravity coding products usable from restricted regions. The user enters a license, enables switches in the GUI or TUI, and the app patches the client and configures a local service; Antigravity traffic then uses DNS routing and available proxy/egress paths, with route choice informed by model responses. The README documents these capabilities; source-index references and excerpts support the implementation links shown. Unsampled subsystems are included where documented, but their internal call paths are not inferred.

Main entry points: [`src/ops.rs`](https://github.com/confeden/antigravity/blob/main/src/ops.rs) (Switch operations), [`src/gui/main_view.rs`](https://github.com/confeden/antigravity/blob/main/src/gui/main_view.rs) (Desktop GUI), [`src/proxy.rs`](https://github.com/confeden/antigravity/blob/main/src/proxy.rs) (Local proxy), [`src/dns_forwarder.rs`](https://github.com/confeden/antigravity/blob/main/src/dns_forwarder.rs) (DNS forwarder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and interfaces"]
  node_main["Process entry<br/>[main.rs]"]
  node_gui["Desktop GUI<br/>[main_view.rs]"]
  node_tui["Terminal UI<br/>[mod.rs]"]
  node_license["License flow<br/>[license.rs]"]
end

subgraph group_control["Switches and maintenance"]
  node_ops["Switch operations<br/>[ops.rs]"]
  node_settings["Persistent settings<br/>[settings.rs]"]
  node_clientpatch["Client patching<br/>[patch_binary.rs]"]
  node_idepatch["IDE patching<br/>[patch_ide.rs]"]
  node_watchdog["Auto patch watchdog<br/>[watchdog.rs]"]
  node_update["Unlocker updates<br/>[update.rs]"]
end

subgraph group_service["Local service"]
  node_service["Background service<br/>[background.rs]"]
  node_forwarder["DNS forwarder<br/>[dns_forwarder.rs]"]
  node_proxy["Local proxy<br/>[proxy.rs]"]
  node_gate["Region gate monitor<br/>[gate.rs]"]
end

subgraph group_routing["DNS and egress"]
  node_dns["System DNS rules<br/>[dns.rs]"]
  node_resolver["Resolver selection<br/>[resolvers.rs]"]
  node_dnsclient["DNS query client<br/>[dns_client.rs]"]
  node_routes["Route selection<br/>[routes.rs]"]
  node_egress["Egress selection<br/>[egress.rs]"]
  node_upstream["Proxy upstreams<br/>[upstream.rs]"]
end

subgraph group_diagnostics["Status and diagnostics"]
  node_status["Live status<br/>[status.rs]"]
  node_report["Diagnostic report<br/>[report.rs]"]
end

node_user(("User"))
node_antigravity["Antigravity client"]
node_google["Google endpoints"]

node_user -->|"launches"| node_main
node_main -->|"starts"| node_gui
node_main -->|"starts"| node_tui
node_user -->|"provides key"| node_license
node_gui -->|"opens"| node_license
node_gui -->|"controls"| node_ops
node_tui -->|"controls"| node_ops
node_gui -->|"renders"| node_status
node_gui -->|"requests"| node_report
node_gui -->|"checks"| node_update
node_ops -.->|"reads/writes"| node_settings
node_ops -->|"applies patch"| node_clientpatch
node_ops -->|"applies patch"| node_idepatch
node_ops -->|"sets rules"| node_dns
node_ops -.->|"manages"| node_service
node_watchdog -->|"reapplies"| node_clientpatch
node_watchdog -->|"checks"| node_service
node_service -.->|"runs"| node_forwarder
node_forwarder -->|"resolves via"| node_resolver
node_resolver -->|"queries"| node_dnsclient
node_forwarder -.->|"dispatches"| node_proxy
node_proxy -.->|"selects route"| node_routes
node_proxy -->|"opens upstream"| node_upstream
node_proxy -.->|"selects egress"| node_egress
node_forwarder -->|"reports gate"| node_gate
node_gate -.->|"responds to refusals"| node_routes
node_antigravity -->|"uses local proxy"| node_proxy
node_antigravity -->|"queries routed hosts"| node_dns
node_proxy -.->|"forwards traffic"| node_google
node_gui -->|"reads state"| node_status
node_report -->|"reads service log"| node_forwarder
node_report -->|"reads gate state"| node_gate
node_status -->|"reads status"| node_ops

click node_main "https://github.com/confeden/antigravity/blob/main/src/main.rs"
click node_gui "https://github.com/confeden/antigravity/blob/main/src/gui/main_view.rs"
click node_tui "https://github.com/confeden/antigravity/blob/main/src/tui/mod.rs"
click node_license "https://github.com/confeden/antigravity/blob/main/src/gui/license.rs"
click node_ops "https://github.com/confeden/antigravity/blob/main/src/ops.rs"
click node_settings "https://github.com/confeden/antigravity/blob/main/src/settings.rs"
click node_clientpatch "https://github.com/confeden/antigravity/blob/main/src/patch_binary.rs"
click node_idepatch "https://github.com/confeden/antigravity/blob/main/src/patch_ide.rs"
click node_watchdog "https://github.com/confeden/antigravity/blob/main/src/watchdog.rs"
click node_update "https://github.com/confeden/antigravity/blob/main/src/update.rs"
click node_service "https://github.com/confeden/antigravity/blob/main/src/background.rs"
click node_forwarder "https://github.com/confeden/antigravity/blob/main/src/dns_forwarder.rs"
click node_proxy "https://github.com/confeden/antigravity/blob/main/src/proxy.rs"
click node_gate "https://github.com/confeden/antigravity/blob/main/src/gate.rs"
click node_dns "https://github.com/confeden/antigravity/blob/main/src/dns.rs"
click node_resolver "https://github.com/confeden/antigravity/blob/main/src/resolvers.rs"
click node_dnsclient "https://github.com/confeden/antigravity/blob/main/src/dns_client.rs"
click node_routes "https://github.com/confeden/antigravity/blob/main/src/routes.rs"
click node_egress "https://github.com/confeden/antigravity/blob/main/src/egress.rs"
click node_upstream "https://github.com/confeden/antigravity/blob/main/src/upstream.rs"
click node_status "https://github.com/confeden/antigravity/blob/main/src/gui/status.rs"
click node_report "https://github.com/confeden/antigravity/blob/main/src/gui/report.rs"

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_main,node_gui,node_tui,node_license,node_user,node_antigravity toneBlue
class node_ops,node_settings,node_clientpatch,node_idepatch,node_watchdog,node_update toneAmber
class node_service,node_forwarder,node_proxy,node_gate toneMint
class node_dns,node_resolver,node_dnsclient,node_routes,node_egress,node_upstream toneRose
class node_status,node_report,node_google toneIndigo
```

## Components

### App and interfaces

- [Process entry](https://github.com/confeden/antigravity/blob/main/src/main.rs): `src/main.rs`
- [Desktop GUI](https://github.com/confeden/antigravity/blob/main/src/gui/main_view.rs): `src/gui/main_view.rs`
- [Terminal UI](https://github.com/confeden/antigravity/blob/main/src/tui/mod.rs): `src/tui/mod.rs`
- [License flow](https://github.com/confeden/antigravity/blob/main/src/gui/license.rs): `src/gui/license.rs`

### Switches and maintenance

- [Switch operations](https://github.com/confeden/antigravity/blob/main/src/ops.rs): `src/ops.rs`
- [Persistent settings](https://github.com/confeden/antigravity/blob/main/src/settings.rs): `src/settings.rs`
- [Client patching](https://github.com/confeden/antigravity/blob/main/src/patch_binary.rs): `src/patch_binary.rs`
- [IDE patching](https://github.com/confeden/antigravity/blob/main/src/patch_ide.rs): `src/patch_ide.rs`
- [Auto patch watchdog](https://github.com/confeden/antigravity/blob/main/src/watchdog.rs): `src/watchdog.rs`
- [Unlocker updates](https://github.com/confeden/antigravity/blob/main/src/update.rs): `src/update.rs`

### Local service

- [Background service](https://github.com/confeden/antigravity/blob/main/src/background.rs): `src/background.rs`
- [DNS forwarder](https://github.com/confeden/antigravity/blob/main/src/dns_forwarder.rs): `src/dns_forwarder.rs`
- [Local proxy](https://github.com/confeden/antigravity/blob/main/src/proxy.rs): `src/proxy.rs`
- [Region gate monitor](https://github.com/confeden/antigravity/blob/main/src/gate.rs): `src/gate.rs`

### DNS and egress

- [System DNS rules](https://github.com/confeden/antigravity/blob/main/src/dns.rs): `src/dns.rs`
- [Resolver selection](https://github.com/confeden/antigravity/blob/main/src/resolvers.rs): `src/resolvers.rs`
- [DNS query client](https://github.com/confeden/antigravity/blob/main/src/dns_client.rs): `src/dns_client.rs`
- [Route selection](https://github.com/confeden/antigravity/blob/main/src/routes.rs): `src/routes.rs`
- [Egress selection](https://github.com/confeden/antigravity/blob/main/src/egress.rs): `src/egress.rs`
- [Proxy upstreams](https://github.com/confeden/antigravity/blob/main/src/upstream.rs): `src/upstream.rs`

### Status and diagnostics

- [Live status](https://github.com/confeden/antigravity/blob/main/src/gui/status.rs): `src/gui/status.rs`
- [Diagnostic report](https://github.com/confeden/antigravity/blob/main/src/gui/report.rs): `src/gui/report.rs`

### Other components

- **User**
- **Antigravity client**
- **Google endpoints**

## Connections

- User → Process entry: launches (evidence: `README.md`)
- Process entry → Desktop GUI: starts (evidence: `src/main.rs`)
- Process entry → Terminal UI: starts (evidence: `src/main.rs`)
- User → License flow: provides key (evidence: `README.md`)
- Desktop GUI → License flow: opens (evidence: `src/gui/mod.rs`)
- Desktop GUI → Switch operations: controls (evidence: `src/gui/main_view.rs`)
- Terminal UI → Switch operations: controls (evidence: `src/tui/mod.rs`)
- Desktop GUI → Live status: renders (evidence: `src/gui/main_view.rs`)
- Desktop GUI → Diagnostic report: requests (evidence: `src/gui/main_view.rs`)
- Desktop GUI → Unlocker updates: checks (evidence: `src/gui/mod.rs`)
- Switch operations → Persistent settings: reads/writes (evidence: `src/ops.rs`)
- Switch operations → Client patching: applies patch (evidence: `src/ops.rs`)
- Switch operations → IDE patching: applies patch (evidence: `src/ops.rs`)
- Switch operations → System DNS rules: sets rules (evidence: `src/ops.rs`)
- Switch operations → Background service: manages (evidence: `src/ops.rs`)
- Auto patch watchdog → Client patching: reapplies (evidence: `src/watchdog.rs`)
- Auto patch watchdog → Background service: checks (evidence: `src/watchdog.rs`)
- Background service → DNS forwarder: runs (evidence: `src/background.rs`)
- DNS forwarder → Resolver selection: resolves via (evidence: `src/dns_forwarder.rs`)
- Resolver selection → DNS query client: queries (evidence: `src/resolvers.rs`)
- DNS forwarder → Local proxy: dispatches (evidence: `src/dns_forwarder.rs`)
- Local proxy → Route selection: selects route (evidence: `src/proxy.rs`)
- Local proxy → Proxy upstreams: opens upstream (evidence: `src/proxy.rs`)
- Local proxy → Egress selection: selects egress (evidence: `src/egress.rs`)
- DNS forwarder → Region gate monitor: reports gate (evidence: `src/dns_forwarder.rs`)
- Region gate monitor → Route selection: responds to refusals (evidence: `src/gate.rs`)
- Antigravity client → Local proxy: uses local proxy (evidence: `README.md`)
- Antigravity client → System DNS rules: queries routed hosts (evidence: `README.md`)
- Local proxy → Google endpoints: forwards traffic
- Desktop GUI → Live status: reads state (evidence: `src/gui/status.rs`)
- Diagnostic report → DNS forwarder: reads service log (evidence: `src/gui/report.rs`)
- Diagnostic report → Region gate monitor: reads gate state (evidence: `src/gui/report.rs`)
- Live status → Switch operations: reads status (evidence: `src/gui/status.rs`)
