# er-ragul/anywhere architecture

> Architecture diagram of the GitHub repository er-ragul/anywhere, 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/er-ragul/anywhere
- Repository: https://github.com/er-ragul/anywhere

## Overview

Anywhere is a React Native Android VPN client with WireGuard tunnel control and a hub-management interface. Users can authenticate to a hub, create or select a WireGuard configuration, connect or disconnect, and monitor traffic; hub profiles also support peer administration. The excerpts show navigation, selected persistence and native-module calls, but not all screen implementations or the native module source, so some internal relationships and capabilities are represented only where documented or directly evidenced.

Main entry points: [`App.js`](https://github.com/er-ragul/anywhere/blob/main/App.js) (App navigation), [`src/components/VPN.js`](https://github.com/er-ragul/anywhere/blob/main/src/components/VPN.js) (VPN dashboard), [`src/components/Connections.js`](https://github.com/er-ragul/anywhere/blob/main/src/components/Connections.js) (Connection profiles), [`src/components/Authentication.js`](https://github.com/er-ragul/anywhere/blob/main/src/components/Authentication.js) (Hub authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_app["App navigation<br/>[App.js]"]
end

subgraph group_tunnel["VPN configuration"]
  node_vpn["VPN dashboard<br/>[VPN.js]"]
  node_connections["Connection profiles<br/>[Connections.js]"]
  node_configuration["Configuration editor<br/>[Configuration.js]"]
  node_qrscanner["QR scanner<br/>[Qrscanner.js]"]
  node_wireguard["WireGuard bridge<br/>[WireGuardModule.js]"]
end

subgraph group_hub["Hub management"]
  node_authentication["Hub authentication<br/>[Authentication.js]"]
  node_profiles["Hub peer management<br/>[Profiles.js]"]
end

subgraph group_state["Runtime state"]
  node_store["Redux store<br/>[store.js]"]
  node_variables["VPN metrics state<br/>[variableSlice.js]"]
end

node_user(("VPN user"))
node_hubservice["Hub service"]
node_localstorage[("Device storage")]

node_user -->|"launches"| node_app
node_app -->|"routes to"| node_vpn
node_app -->|"routes to"| node_connections
node_app -->|"routes to"| node_configuration
node_app -->|"routes to"| node_authentication
node_app -->|"routes to"| node_profiles
node_app -->|"provides"| node_store
node_store -->|"uses reducer"| node_variables
node_vpn -->|"calls"| node_wireguard
node_connections -->|"calls"| node_wireguard
node_vpn -->|"updates metrics"| node_variables
node_authentication -->|"registers with"| node_hubservice
node_profiles -->|"manages peers"| node_hubservice
node_authentication -->|"reads and writes"| node_localstorage
node_profiles -->|"removes credentials"| node_localstorage
node_connections -->|"loads profiles"| node_localstorage
node_configuration -->|"saves profiles"| node_localstorage

click node_app "https://github.com/er-ragul/anywhere/blob/main/App.js"
click node_vpn "https://github.com/er-ragul/anywhere/blob/main/src/components/VPN.js"
click node_connections "https://github.com/er-ragul/anywhere/blob/main/src/components/Connections.js"
click node_configuration "https://github.com/er-ragul/anywhere/blob/main/src/components/Configuration.js"
click node_qrscanner "https://github.com/er-ragul/anywhere/blob/main/src/components/Qrscanner.js"
click node_wireguard "https://github.com/er-ragul/anywhere/blob/main/src/wireguard/WireGuardModule.js"
click node_authentication "https://github.com/er-ragul/anywhere/blob/main/src/components/Authentication.js"
click node_profiles "https://github.com/er-ragul/anywhere/blob/main/src/components/Profiles.js"
click node_store "https://github.com/er-ragul/anywhere/blob/main/src/redux/store.js"
click node_variables "https://github.com/er-ragul/anywhere/blob/main/src/redux/variableSlice.js"

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_app,node_user toneBlue
class node_vpn,node_connections,node_configuration,node_qrscanner,node_wireguard,node_localstorage toneAmber
class node_authentication,node_profiles toneMint
class node_store,node_variables toneRose
class node_hubservice toneIndigo
```

## Components

### App navigation

- [App navigation](https://github.com/er-ragul/anywhere/blob/main/App.js): `App.js`

### VPN configuration

- [VPN dashboard](https://github.com/er-ragul/anywhere/blob/main/src/components/VPN.js): `src/components/VPN.js`
- [Connection profiles](https://github.com/er-ragul/anywhere/blob/main/src/components/Connections.js): `src/components/Connections.js`
- [Configuration editor](https://github.com/er-ragul/anywhere/blob/main/src/components/Configuration.js): `src/components/Configuration.js`
- [QR scanner](https://github.com/er-ragul/anywhere/blob/main/src/components/Qrscanner.js): `src/components/Qrscanner.js`
- [WireGuard bridge](https://github.com/er-ragul/anywhere/blob/main/src/wireguard/WireGuardModule.js): `src/wireguard/WireGuardModule.js`

### Hub management

- [Hub authentication](https://github.com/er-ragul/anywhere/blob/main/src/components/Authentication.js): `src/components/Authentication.js`
- [Hub peer management](https://github.com/er-ragul/anywhere/blob/main/src/components/Profiles.js): `src/components/Profiles.js`

### Runtime state

- [Redux store](https://github.com/er-ragul/anywhere/blob/main/src/redux/store.js): `src/redux/store.js`
- [VPN metrics state](https://github.com/er-ragul/anywhere/blob/main/src/redux/variableSlice.js): `src/redux/variableSlice.js`

### Other components

- **VPN user**
- **Hub service**
- **Device storage**

## Connections

- VPN user → App navigation: launches
- App navigation → VPN dashboard: routes to (evidence: `App.js`)
- App navigation → Connection profiles: routes to (evidence: `App.js`)
- App navigation → Configuration editor: routes to (evidence: `App.js`)
- App navigation → Hub authentication: routes to (evidence: `App.js`)
- App navigation → Hub peer management: routes to (evidence: `App.js`)
- App navigation → Redux store: provides (evidence: `App.js`)
- Redux store → VPN metrics state: uses reducer (evidence: `src/redux/store.js`)
- VPN dashboard → WireGuard bridge: calls (evidence: `src/components/VPN.js`)
- Connection profiles → WireGuard bridge: calls (evidence: `src/components/Connections.js`)
- VPN dashboard → VPN metrics state: updates metrics (evidence: `src/components/VPN.js`)
- Hub authentication → Hub service: registers with (evidence: `src/components/Authentication.js`)
- Hub peer management → Hub service: manages peers (evidence: `src/components/Profiles.js`)
- Hub authentication → Device storage: reads and writes (evidence: `src/components/Authentication.js`)
- Hub peer management → Device storage: removes credentials (evidence: `src/components/Profiles.js`)
- Connection profiles → Device storage: loads profiles (evidence: `src/components/Connections.js`)
- Configuration editor → Device storage: saves profiles (evidence: `src/components/Configuration.js`)
