# bklockly/proxyz architecture

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

- Interactive diagram: https://gitdiagram.com/bklockly/proxyz
- Repository: https://github.com/bklockly/proxyz

## Overview

##### Project Type & Purpose
- Proxyz is a full-stack application meant to manage and switch proxy IPs. It has a Go-based backend (using the Wails framework) and a modern frontend built with Vue.js.
- The tool listens on a local address (127.0.0.1:1080) and can both import proxy files and attempt to crawl free proxy lists. The README makes clear that it is intended for research and authorized testing.

##### Analyzing the File Structure
- Top-Level Overview:
– Backend: Contains directories like client, config, info, and request. The “client” subdirectory holds modules (app.go, start.go, etc.) for managing connections, logging, and responses.
– Frontend: Contains the Vue.js application (components, assets, main.ts, etc.) plus additional Wails-related JavaScript (wailsjs folder). This indicates that the frontend communicates with the Go backend through the Wails runtime.
– Build: Packaging scripts and installer configurations for different platforms (Darwin and Windows). This suggests that after building, the application is bundled for desktop platforms.
– Static: Contains assets like images shown in the README for previewing proxy status.
– Configurations: Files like wails.json, go.mod, and various installer scripts provide deployment and dependency info.

##### Key Architecture Components
a. Frontend Layer:
– Wails Runtime: Show how the frontend leverages the Wails JavaScript bridge (wailsjs folder) to interact with the backend.

b. Backend Layer:
– Go Application (Main.go entry point): Indicate that the backend is written in Go with modular directories:
- Client: Handles operations related to starting the service, logging, managing responses.
- Config: Loads and manages configuration parameters.
- Request: Contains modules that deal with fetching or processing proxy requests (like pr_89.go, pr_happy.go, etc.).
- Info: Likely used to display or manage meta-information about the proxy pool status.
– Local Proxy Server: Highlight that the backend continuously listens on 127.0.0.1:1080 to serve or proxy requests.

c. Build & Deployment:
– Build Scripts: Separate modules that package and produce installers for macOS (Darwin) and Windows environments.
– Indicate deployment artifacts or compiled executables (e.g., wails.exe, Info.plist) as part of the packaged application.

d. Interconnections:
- The Vue.js UI sends requests/invocations through the Wails framework.
- The backend processes proxy configurations, manages the dynamic switching of IPs, and feeds status updates back to the frontend.
– Optionally, illustrate logging/response flows and data exchange (like config changes or proxy updates).

## Diagram (Mermaid)

```mermaid
graph TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        FE1("Vue.js Frontend Application"):::frontend
        FE2("Wails JS Bridge"):::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        BE1("Go Backend & Proxy Listener (127.0.0.1:1080)"):::backend
        BE2("Client Module"):::backend
        BE3("Config Module"):::backend
        BE4("Request Module"):::backend
        BE5("Info Module"):::backend
    end

    %% Build & Deployment
    subgraph "Build & Deployment"
        BD1("Build & Deployment Scripts"):::builder
        BD2("Installer - Darwin"):::builder
        BD3("Installer - Windows"):::builder
    end

    %% Data Flow Connections
    FE1 -->|"invokes"| FE2
    FE2 -->|"calls"| BE1
    BE1 -->|"manages"| BE2
    BE1 -->|"manages"| BE3
    BE1 -->|"manages"| BE4
    BE1 -->|"manages"| BE5
    BE1 -->|"statusUpdates"| FE1

    BD1 -->|"builds"| BE1
    BD1 --> BD2
    BD1 --> BD3

    %% Click Events
    click FE1 "https://github.com/bklockly/proxyz/tree/master/frontend/src"
    click FE2 "https://github.com/bklockly/proxyz/tree/master/frontend/wailsjs"
    click BE1 "https://github.com/bklockly/proxyz/blob/master/main.go"
    click BE2 "https://github.com/bklockly/proxyz/tree/master/backend/client"
    click BE3 "https://github.com/bklockly/proxyz/tree/master/backend/config"
    click BE4 "https://github.com/bklockly/proxyz/tree/master/backend/request"
    click BE5 "https://github.com/bklockly/proxyz/tree/master/backend/info"
    click BD1 "https://github.com/bklockly/proxyz/tree/master/build"

    %% Class Definitions for Colors
    classDef frontend fill:#f9c74f,stroke:#f9844a,stroke-width:2px;
    classDef backend fill:#90be6d,stroke:#43aa8b,stroke-width:2px;
    classDef builder fill:#f94144,stroke:#f3722c,stroke-width:2px;
```
