# meshlinkfoundation/meshlink-wifi-gateway architecture

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

- Interactive diagram: https://gitdiagram.com/meshlinkfoundation/meshlink-wifi-gateway
- Repository: https://github.com/meshlinkfoundation/meshlink-wifi-gateway

## Overview

meshlink WiFi Gateway provisions a Raspberry Pi as a guest WiFi hotspot with captive-portal access control. The main guest workflow is: join the access point, receive DHCP configuration, get redirected to the broker portal, select access, and have forwarding enabled for the session. Operators configure the gateway with the installer and manage it through the broker dashboard. The repository tree contains only installer/bootstrap scripts and one guest-interface helper; the broker and host networking services are external runtime components. Relationships below are based on the README, not inspected source excerpts.

Main entry points: [`install.sh`](https://github.com/meshlinkfoundation/meshlink-wifi-gateway/blob/main/install.sh) (Gateway installer), [`bootstrap.sh`](https://github.com/meshlinkfoundation/meshlink-wifi-gateway/blob/main/bootstrap.sh) (Bootstrap), [`scripts/meshlink-guest-up.sh`](https://github.com/meshlinkfoundation/meshlink-wifi-gateway/blob/main/scripts/meshlink-guest-up.sh) (Guest interface setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_provisioning["Gateway provisioning"]
  node_bootstrap["Bootstrap<br/>[bootstrap.sh]"]
  node_installer["Gateway installer<br/>[install.sh]"]
end

subgraph group_guest_access["Guest access"]
  node_hostapd["WiFi access point"]
  node_guest_bridge["Guest bridge"]
  node_guest_up["Guest interface setup"]
  node_dnsmasq["DHCP and DNS"]
  node_firewall["Firewall and NAT"]
  node_broker["Meshlink broker"]
  node_portal["Captive portal"]
  node_auth_state[("Authorized IP sessions")]
end

subgraph group_operations["Operator services"]
  node_dashboard["Operator dashboard"]
  node_stripe["Stripe payments"]
  node_tailscale["Tailscale VPN"]
end

node_operator(("Gateway operator"))
node_guest_client(("Guest device"))

node_operator -->|"starts setup"| node_bootstrap
node_bootstrap -->|"runs"| node_installer
node_operator -->|"configures gateway"| node_installer
node_installer -->|"configures access point"| node_hostapd
node_installer -->|"configures DHCP/DNS"| node_dnsmasq
node_installer -->|"configures forwarding"| node_firewall
node_installer -->|"installs and configures"| node_broker
node_installer -->|"installs helper"| node_guest_up
node_hostapd -->|"bridges AP"| node_guest_bridge
node_guest_up -->|"brings up interfaces"| node_guest_bridge
node_guest_client -->|"joins WiFi"| node_hostapd
node_guest_client -->|"gets IP configuration"| node_dnsmasq
node_guest_client -->|"sends HTTP check"| node_firewall
node_firewall -->|"redirects port 80"| node_broker
node_broker -->|"serves portal"| node_portal
node_guest_client -->|"selects access tier"| node_portal
node_broker -->|"authorizes client IP"| node_auth_state
node_firewall -->|"allows session forwarding"| node_guest_client
node_operator -->|"manages gateway"| node_dashboard
node_dashboard -->|"served by"| node_broker
node_broker -.->|"starts paid checkout"| node_stripe
node_operator -.->|"sets up remote access"| node_tailscale
node_tailscale -.->|"provides remote reachability"| node_dashboard

click node_bootstrap "https://github.com/meshlinkfoundation/meshlink-wifi-gateway/blob/main/bootstrap.sh"
click node_installer "https://github.com/meshlinkfoundation/meshlink-wifi-gateway/blob/main/install.sh"
click node_guest_up "https://github.com/meshlinkfoundation/meshlink-wifi-gateway/blob/main/scripts/meshlink-guest-up.sh"

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_bootstrap,node_installer toneBlue
class node_hostapd,node_guest_bridge,node_guest_up,node_dnsmasq,node_firewall,node_broker,node_portal,node_auth_state toneAmber
class node_dashboard,node_stripe,node_tailscale toneMint
class node_operator,node_guest_client toneIndigo
```

## Components

### Gateway provisioning

- [Bootstrap](https://github.com/meshlinkfoundation/meshlink-wifi-gateway/blob/main/bootstrap.sh): `bootstrap.sh`
- [Gateway installer](https://github.com/meshlinkfoundation/meshlink-wifi-gateway/blob/main/install.sh): `install.sh`

### Guest access

- **WiFi access point**
- **Guest bridge**
- [Guest interface setup](https://github.com/meshlinkfoundation/meshlink-wifi-gateway/blob/main/scripts/meshlink-guest-up.sh): `scripts/meshlink-guest-up.sh`
- **DHCP and DNS**
- **Firewall and NAT**
- **Meshlink broker**
- **Captive portal**
- **Authorized IP sessions**

### Operator services

- **Operator dashboard**
- **Stripe payments**
- **Tailscale VPN**

### Other components

- **Gateway operator**
- **Guest device**

## Connections

- Gateway operator → Bootstrap: starts setup (evidence: `README.md`)
- Bootstrap → Gateway installer: runs (evidence: `README.md`)
- Gateway operator → Gateway installer: configures gateway (evidence: `README.md`)
- Gateway installer → WiFi access point: configures access point (evidence: `README.md`)
- Gateway installer → DHCP and DNS: configures DHCP/DNS (evidence: `README.md`)
- Gateway installer → Firewall and NAT: configures forwarding (evidence: `README.md`)
- Gateway installer → Meshlink broker: installs and configures (evidence: `README.md`)
- Gateway installer → Guest interface setup: installs helper (evidence: `README.md`)
- WiFi access point → Guest bridge: bridges AP (evidence: `README.md`)
- Guest interface setup → Guest bridge: brings up interfaces (evidence: `README.md`)
- Guest device → WiFi access point: joins WiFi (evidence: `README.md`)
- Guest device → DHCP and DNS: gets IP configuration (evidence: `README.md`)
- Guest device → Firewall and NAT: sends HTTP check (evidence: `README.md`)
- Firewall and NAT → Meshlink broker: redirects port 80 (evidence: `README.md`)
- Meshlink broker → Captive portal: serves portal (evidence: `README.md`)
- Guest device → Captive portal: selects access tier (evidence: `README.md`)
- Meshlink broker → Authorized IP sessions: authorizes client IP (evidence: `README.md`)
- Firewall and NAT → Guest device: allows session forwarding (evidence: `README.md`)
- Gateway operator → Operator dashboard: manages gateway (evidence: `README.md`)
- Operator dashboard → Meshlink broker: served by (evidence: `README.md`)
- Meshlink broker → Stripe payments: starts paid checkout (evidence: `README.md`)
- Gateway operator → Tailscale VPN: sets up remote access (evidence: `README.md`)
- Tailscale VPN → Operator dashboard: provides remote reachability (evidence: `README.md`)
