# resinat/resin architecture

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

- Interactive diagram: https://gitdiagram.com/resinat/resin
- Repository: https://github.com/resinat/resin

## Overview

Resin is a proxy-pool gateway: operators configure subscriptions and platform-specific pools, while client traffic enters through forward or reverse proxy endpoints and is routed to healthy outbound nodes with sticky account leases. The graph includes the management UI/API, subscription and topology lifecycle, probing and routing, proxy execution, and persistence/observability. Relationships among unsampled subsystems are limited to README-documented capabilities or imports visible in the source index; internal call details are not inferred.

Main entry points: [`cmd/resin/main.go`](https://github.com/resinat/resin/blob/master/cmd/resin/main.go) (Runtime Bootstrap), [`internal/topology/pool.go`](https://github.com/resinat/resin/blob/master/internal/topology/pool.go) (Node Pool), [`internal/proxy/reverse.go`](https://github.com/resinat/resin/blob/master/internal/proxy/reverse.go) (Proxy Execution), [`internal/probe/manager.go`](https://github.com/resinat/resin/blob/master/internal/probe/manager.go) (Health Probing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_management["Management"]
  node_webui["Admin Web UI<br/>[routes.tsx]"]
  node_ui_features["Admin Features"]
  node_api["HTTP API<br/>[server.go]"]
  node_control["Control Plane"]
end

subgraph group_pool["Pool Lifecycle"]
  node_subscriptions["Subscription Import<br/>[parser.go]"]
  node_topology["Node Pool<br/>[pool.go]"]
  node_platforms["Platform Policies<br/>[platform.go]"]
  node_probes["Health Probing<br/>[manager.go]"]
end

subgraph group_traffic["Proxy Traffic"]
  node_router["Sticky Router<br/>[router.go]"]
  node_inbound["Proxy Endpoints<br/>[inbound_mux.go]"]
  node_proxy["Proxy Execution<br/>[reverse.go]"]
  node_outbounds["Outbound Manager<br/>[manager.go]"]
end

subgraph group_operations["Operations"]
  node_state[("Persistent State<br/>[engine.go]")]
  node_metrics["Metrics<br/>[manager.go]"]
  node_requestlogs[("Request Logs<br/>[service.go]")]
  node_geoip["GeoIP Data<br/>[geoip.go]"]
end

subgraph group_runtime["Runtime"]
  node_runtime_app["Runtime Bootstrap<br/>[main.go]"]
end

node_operator(("Operator"))
node_client(("Proxy Client"))

node_operator -->|"configures"| node_webui
node_webui -->|"navigates"| node_ui_features
node_ui_features -.->|"requests"| node_api
node_api -->|"dispatches"| node_control
node_control -.->|"manages"| node_subscriptions
node_subscriptions -->|"updates"| node_topology
node_control -->|"configures"| node_platforms
node_topology -->|"supplies nodes"| node_probes
node_probes -->|"updates health"| node_topology
node_client -->|"sends traffic"| node_inbound
node_inbound -.->|"dispatches"| node_proxy
node_proxy -->|"selects node"| node_router
node_router -->|"applies policy"| node_platforms
node_proxy -->|"forwards traffic"| node_outbounds
node_outbounds -->|"reads node"| node_topology
node_runtime_app -->|"initializes"| node_api
node_runtime_app -->|"initializes"| node_topology
node_runtime_app -->|"initializes"| node_router
node_runtime_app -->|"initializes"| node_outbounds
node_runtime_app -->|"initializes"| node_probes
node_runtime_app -->|"initializes"| node_state
node_runtime_app -->|"initializes"| node_geoip
node_runtime_app -->|"initializes"| node_metrics
node_runtime_app -->|"initializes"| node_requestlogs
node_state -.->|"persists state"| node_topology
node_proxy -->|"records requests"| node_requestlogs
node_probes -.->|"uses lookup"| node_geoip

click node_webui "https://github.com/resinat/resin/blob/master/webui/src/app/routes.tsx"
click node_ui_features "https://github.com/resinat/resin/tree/master/webui/src/features"
click node_api "https://github.com/resinat/resin/blob/master/internal/api/server.go"
click node_control "https://github.com/resinat/resin/tree/master/internal/service"
click node_subscriptions "https://github.com/resinat/resin/blob/master/internal/subscription/parser.go"
click node_topology "https://github.com/resinat/resin/blob/master/internal/topology/pool.go"
click node_platforms "https://github.com/resinat/resin/blob/master/internal/platform/platform.go"
click node_probes "https://github.com/resinat/resin/blob/master/internal/probe/manager.go"
click node_router "https://github.com/resinat/resin/blob/master/internal/routing/router.go"
click node_inbound "https://github.com/resinat/resin/blob/master/cmd/resin/inbound_mux.go"
click node_proxy "https://github.com/resinat/resin/blob/master/internal/proxy/reverse.go"
click node_outbounds "https://github.com/resinat/resin/blob/master/internal/outbound/manager.go"
click node_state "https://github.com/resinat/resin/blob/master/internal/state/engine.go"
click node_metrics "https://github.com/resinat/resin/blob/master/internal/metrics/manager.go"
click node_requestlogs "https://github.com/resinat/resin/blob/master/internal/requestlog/service.go"
click node_geoip "https://github.com/resinat/resin/blob/master/internal/geoip/geoip.go"
click node_runtime_app "https://github.com/resinat/resin/blob/master/cmd/resin/main.go"

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_webui,node_ui_features,node_api,node_control,node_client toneBlue
class node_subscriptions,node_topology,node_platforms,node_probes toneAmber
class node_router,node_inbound,node_proxy,node_outbounds toneMint
class node_state,node_metrics,node_requestlogs,node_geoip toneRose
class node_runtime_app,node_operator toneIndigo
```

## Components

### Management

- [Admin Web UI](https://github.com/resinat/resin/blob/master/webui/src/app/routes.tsx): `webui/src/app/routes.tsx`
- [Admin Features](https://github.com/resinat/resin/tree/master/webui/src/features): `webui/src/features`
- [HTTP API](https://github.com/resinat/resin/blob/master/internal/api/server.go): `internal/api/server.go`
- [Control Plane](https://github.com/resinat/resin/tree/master/internal/service): `internal/service`

### Pool Lifecycle

- [Subscription Import](https://github.com/resinat/resin/blob/master/internal/subscription/parser.go): `internal/subscription/parser.go`
- [Node Pool](https://github.com/resinat/resin/blob/master/internal/topology/pool.go): `internal/topology/pool.go`
- [Platform Policies](https://github.com/resinat/resin/blob/master/internal/platform/platform.go): `internal/platform/platform.go`
- [Health Probing](https://github.com/resinat/resin/blob/master/internal/probe/manager.go): `internal/probe/manager.go`

### Proxy Traffic

- [Sticky Router](https://github.com/resinat/resin/blob/master/internal/routing/router.go): `internal/routing/router.go`
- [Proxy Endpoints](https://github.com/resinat/resin/blob/master/cmd/resin/inbound_mux.go): `cmd/resin/inbound_mux.go`
- [Proxy Execution](https://github.com/resinat/resin/blob/master/internal/proxy/reverse.go): `internal/proxy/reverse.go`
- [Outbound Manager](https://github.com/resinat/resin/blob/master/internal/outbound/manager.go): `internal/outbound/manager.go`

### Operations

- [Persistent State](https://github.com/resinat/resin/blob/master/internal/state/engine.go): `internal/state/engine.go`
- [Metrics](https://github.com/resinat/resin/blob/master/internal/metrics/manager.go): `internal/metrics/manager.go`
- [Request Logs](https://github.com/resinat/resin/blob/master/internal/requestlog/service.go): `internal/requestlog/service.go`
- [GeoIP Data](https://github.com/resinat/resin/blob/master/internal/geoip/geoip.go): `internal/geoip/geoip.go`

### Runtime

- [Runtime Bootstrap](https://github.com/resinat/resin/blob/master/cmd/resin/main.go): `cmd/resin/main.go`

### Other components

- **Operator**
- **Proxy Client**

## Connections

- Operator → Admin Web UI: configures (evidence: `README.md`)
- Admin Web UI → Admin Features: navigates (evidence: `webui/src/app/routes.tsx`)
- Admin Features → HTTP API: requests
- HTTP API → Control Plane: dispatches (evidence: `internal/api/server.go`)
- Control Plane → Subscription Import: manages
- Subscription Import → Node Pool: updates
- Control Plane → Platform Policies: configures (evidence: `internal/service/control_plane_platform.go`)
- Node Pool → Health Probing: supplies nodes (evidence: `internal/probe/manager.go`)
- Health Probing → Node Pool: updates health (evidence: `internal/probe/manager.go`)
- Proxy Client → Proxy Endpoints: sends traffic (evidence: `README.md`)
- Proxy Endpoints → Proxy Execution: dispatches
- Proxy Execution → Sticky Router: selects node (evidence: `internal/proxy/reverse.go`)
- Sticky Router → Platform Policies: applies policy (evidence: `internal/routing/router.go`)
- Proxy Execution → Outbound Manager: forwards traffic (evidence: `internal/proxy/reverse.go`)
- Outbound Manager → Node Pool: reads node (evidence: `internal/outbound/manager.go`)
- Runtime Bootstrap → HTTP API: initializes (evidence: `cmd/resin/main.go`)
- Runtime Bootstrap → Node Pool: initializes (evidence: `cmd/resin/main.go`)
- Runtime Bootstrap → Sticky Router: initializes (evidence: `cmd/resin/main.go`)
- Runtime Bootstrap → Outbound Manager: initializes (evidence: `cmd/resin/main.go`)
- Runtime Bootstrap → Health Probing: initializes (evidence: `cmd/resin/main.go`)
- Runtime Bootstrap → Persistent State: initializes (evidence: `cmd/resin/main.go`)
- Runtime Bootstrap → GeoIP Data: initializes (evidence: `cmd/resin/main.go`)
- Runtime Bootstrap → Metrics: initializes (evidence: `cmd/resin/main.go`)
- Runtime Bootstrap → Request Logs: initializes (evidence: `cmd/resin/main.go`)
- Persistent State → Node Pool: persists state
- Proxy Execution → Request Logs: records requests (evidence: `internal/requestlog/service.go`)
- Health Probing → GeoIP Data: uses lookup
