# muhammad-deve/goport architecture

> Architecture diagram of the GitHub repository muhammad-deve/goport, 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/muhammad-deve/goport
- Repository: https://github.com/muhammad-deve/goport

## Overview

GoPort exposes a developer’s local TCP service through a public HTTPS tunnel. The documented workflow is to authenticate, start a tunnel (optionally requesting or resetting a subdomain), route public traffic to the local app, monitor requests and tunnel status, and disconnect. The sampled Go client implements registration, yamux sessions, stream forwarding, and reconnection; the README describes server-side routing and PocketBase responsibilities. Backend, server, and landing-page internals were not sampled, so their relationships are shown only where documented.

Main entry points: [`server`](https://github.com/muhammad-deve/goport/tree/main/server) (Tunnel server), [`goport.go`](https://github.com/muhammad-deve/goport/blob/main/goport.go) (Tunnel registration), [`backend`](https://github.com/muhammad-deve/goport/tree/main/backend) (Auth and subdomains), [`landing`](https://github.com/muhammad-deve/goport/tree/main/landing) (Traffic dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Tunnel client"]
  node_go_client["Go tunnel client<br/>[goport.go]"]
  node_registration["Tunnel registration<br/>[goport.go]"]
  node_multiplexing["yamux streams<br/>[goport.go]"]
  node_stream_proxy["Local stream proxy<br/>[goport.go]"]
end

subgraph group_server["Public tunnel service"]
  node_tunnel_server["Tunnel server"]
  node_auth_registry[("Auth and subdomains")]
  node_request_routing["Public request routing"]
end

subgraph group_web["Web experience"]
  node_dashboard["Traffic dashboard"]
  node_website["GoPort website"]
end

node_developer(("Developer"))
node_local_app["Local application"]
node_internet(("Public visitors"))

node_developer -->|"starts tunnel"| node_go_client
node_go_client -->|"opens tunnel"| node_registration
node_registration -->|"registers over TCP"| node_tunnel_server
node_registration -.->|"authenticates and requests URL"| node_auth_registry
node_tunnel_server -.->|"creates yamux session"| node_multiplexing
node_multiplexing -->|"accepts streams"| node_stream_proxy
node_stream_proxy -->|"forwards TCP traffic"| node_local_app
node_internet -->|"sends HTTPS requests"| node_request_routing
node_request_routing -->|"routes through tunnel"| node_tunnel_server
node_tunnel_server -.->|"dispatches tunnel traffic"| node_multiplexing
node_developer -->|"monitors traffic"| node_dashboard
node_developer -.->|"visits"| node_website

click node_go_client "https://github.com/muhammad-deve/goport/blob/main/goport.go"
click node_registration "https://github.com/muhammad-deve/goport/blob/main/goport.go"
click node_multiplexing "https://github.com/muhammad-deve/goport/blob/main/goport.go"
click node_stream_proxy "https://github.com/muhammad-deve/goport/blob/main/goport.go"
click node_tunnel_server "https://github.com/muhammad-deve/goport/tree/main/server"
click node_auth_registry "https://github.com/muhammad-deve/goport/tree/main/backend"
click node_request_routing "https://github.com/muhammad-deve/goport/tree/main/server"
click node_dashboard "https://github.com/muhammad-deve/goport/tree/main/landing"
click node_website "https://github.com/muhammad-deve/goport/tree/main/landing"

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_go_client,node_registration,node_multiplexing,node_stream_proxy toneBlue
class node_tunnel_server,node_auth_registry,node_request_routing toneAmber
class node_dashboard,node_website toneMint
class node_developer,node_local_app,node_internet toneIndigo
```

## Components

### Tunnel client

- [Go tunnel client](https://github.com/muhammad-deve/goport/blob/main/goport.go): `goport.go`
- [Tunnel registration](https://github.com/muhammad-deve/goport/blob/main/goport.go): `goport.go`
- [yamux streams](https://github.com/muhammad-deve/goport/blob/main/goport.go): `goport.go`
- [Local stream proxy](https://github.com/muhammad-deve/goport/blob/main/goport.go): `goport.go`

### Public tunnel service

- [Tunnel server](https://github.com/muhammad-deve/goport/tree/main/server): `server`
- [Auth and subdomains](https://github.com/muhammad-deve/goport/tree/main/backend): `backend`
- [Public request routing](https://github.com/muhammad-deve/goport/tree/main/server): `server`

### Web experience

- [Traffic dashboard](https://github.com/muhammad-deve/goport/tree/main/landing): `landing`
- [GoPort website](https://github.com/muhammad-deve/goport/tree/main/landing): `landing`

### Other components

- **Developer**
- **Local application**
- **Public visitors**

## Connections

- Developer → Go tunnel client: starts tunnel (evidence: `README.md`)
- Go tunnel client → Tunnel registration: opens tunnel (evidence: `goport.go`)
- Tunnel registration → Tunnel server: registers over TCP (evidence: `goport.go`)
- Tunnel registration → Auth and subdomains: authenticates and requests URL (evidence: `README.md`)
- Tunnel server → yamux streams: creates yamux session (evidence: `README.md`)
- yamux streams → Local stream proxy: accepts streams (evidence: `goport.go`)
- Local stream proxy → Local application: forwards TCP traffic (evidence: `goport.go`)
- Public visitors → Public request routing: sends HTTPS requests (evidence: `README.md`)
- Public request routing → Tunnel server: routes through tunnel (evidence: `README.md`)
- Tunnel server → yamux streams: dispatches tunnel traffic (evidence: `README.md`)
- Developer → Traffic dashboard: monitors traffic (evidence: `README.md`)
- Developer → GoPort website: visits (evidence: `README.md`)
