# gabriel-logan/private-meet architecture

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

- Interactive diagram: https://gitdiagram.com/gabriel-logan/private-meet
- Repository: https://github.com/gabriel-logan/private-meet

## Overview

Private Meet is a self-hostable, account-free chat and WebRTC meeting app with mobile and Wails desktop clients and a Go backend. The principal workflow is to create or join a room, obtain a token through REST sign-in, connect over WebSocket for room membership, chat, presence and WebRTC signaling, then establish peer-to-peer media and image transfer. Separate client layers provide encrypted messaging and mesh media. The README documents capabilities beyond the sampled source; links for those are cited to it, while unsampled implementation details are not inferred.

Main entry points: [`server/internal/httpapi/router.go`](https://github.com/gabriel-logan/private-meet/blob/main/server/internal/httpapi/router.go) (HTTP routing), [`server/internal/httpapi/handlers/auth.go`](https://github.com/gabriel-logan/private-meet/blob/main/server/internal/httpapi/handlers/auth.go) (REST API), [`client/mobile/src/pages/Chat.tsx`](https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/pages/Chat.tsx) (Mobile chat), [`client/web-desktop/frontend/src/pages/Chat.tsx`](https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/pages/Chat.tsx) (Desktop chat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client experiences"]
  node_mobilehome["Mobile home<br/>[Home.tsx]"]
  node_desktophome["Desktop home<br/>[Home.tsx]"]
  node_mobilechat["Mobile chat<br/>[Chat.tsx]"]
  node_desktopchat["Desktop chat<br/>[Chat.tsx]"]
  node_mobileauth["Mobile auth state<br/>[authStore.ts]"]
  node_desktopauth["Desktop auth state<br/>[authStore.ts]"]
end

subgraph group_room["Room and chat"]
  node_protocol["WS protocol<br/>[ws.ts]"]
  node_mobilews["Mobile WS client<br/>[wsInstance.ts]"]
  node_desktopws["Desktop WS client<br/>[wsInstance.ts]"]
end

subgraph group_media["Privacy and media"]
  node_mobilecrypto["Mobile E2EE<br/>[e2ee.ts]"]
  node_desktopcrypto["Desktop E2EE<br/>[e2ee.ts]"]
  node_mobilemesh["Mobile WebRTC mesh<br/>[useWebRTCMesh.ts]"]
  node_desktopmesh["Desktop WebRTC mesh<br/>[useWebRTCMesh.ts]"]
  node_webrtc["WebRTC helpers<br/>[webRTC.ts]"]
end

subgraph group_server["Backend services"]
  node_rest["REST API<br/>[auth.go]"]
  node_router["HTTP routing<br/>[router.go]"]
  node_serverentry["Server entry<br/>[main.go]"]
  node_jwt["JWT security<br/>[jwt.go]"]
  node_wsendpoint["WebSocket endpoint<br/>[handler.go]"]
  node_wshub["Room relay<br/>[hub.go]"]
  node_wsmanager["WebSocket manager<br/>[manager.go]"]
end

node_participant(("Participant"))

node_participant -->|"creates or joins"| node_mobilehome
node_participant -->|"creates or joins"| node_desktophome
node_mobilehome -->|"signs in"| node_rest
node_desktophome -->|"signs in"| node_rest
node_rest -->|"issues token"| node_jwt
node_serverentry -->|"configures"| node_router
node_router -->|"routes WS"| node_wsendpoint
node_router -->|"routes sign-in"| node_rest
node_serverentry -->|"creates manager"| node_wsmanager
node_router -->|"passes manager"| node_wsmanager
node_wsendpoint -->|"validates token"| node_jwt
node_mobilechat -->|"uses connection"| node_mobilews
node_desktopchat -->|"uses connection"| node_desktopws
node_mobilechat -->|"encrypts messages"| node_mobilecrypto
node_desktopchat -->|"encrypts messages"| node_desktopcrypto
node_mobilechat -->|"runs meeting"| node_mobilemesh
node_desktopchat -->|"runs meeting"| node_desktopmesh
node_mobilemesh -->|"handles signaling"| node_protocol
node_desktopmesh -->|"handles signaling"| node_protocol
node_desktopmesh -->|"delegates media"| node_webrtc
node_wsendpoint -.->|"relays room events"| node_wshub
node_wsmanager -.->|"dispatches rooms"| node_wshub

click node_mobilehome "https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/pages/Home.tsx"
click node_desktophome "https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/pages/Home.tsx"
click node_mobilechat "https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/pages/Chat.tsx"
click node_desktopchat "https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/pages/Chat.tsx"
click node_mobileauth "https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/stores/authStore.ts"
click node_desktopauth "https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/stores/authStore.ts"
click node_rest "https://github.com/gabriel-logan/private-meet/blob/main/server/internal/httpapi/handlers/auth.go"
click node_router "https://github.com/gabriel-logan/private-meet/blob/main/server/internal/httpapi/router.go"
click node_serverentry "https://github.com/gabriel-logan/private-meet/blob/main/server/cmd/api/main.go"
click node_jwt "https://github.com/gabriel-logan/private-meet/blob/main/server/internal/security/jwt.go"
click node_wsendpoint "https://github.com/gabriel-logan/private-meet/blob/main/server/internal/ws/handler.go"
click node_wshub "https://github.com/gabriel-logan/private-meet/blob/main/server/internal/ws/hub.go"
click node_wsmanager "https://github.com/gabriel-logan/private-meet/blob/main/server/internal/ws/manager.go"
click node_protocol "https://github.com/gabriel-logan/private-meet/blob/main/client/shared/protocol/ws.ts"
click node_mobilews "https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/lib/wsInstance.ts"
click node_desktopws "https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/lib/wsInstance.ts"
click node_mobilecrypto "https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/lib/e2ee.ts"
click node_desktopcrypto "https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/lib/e2ee.ts"
click node_mobilemesh "https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/hooks/useWebRTCMesh.ts"
click node_desktopmesh "https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/hooks/useWebRTCMesh.ts"
click node_webrtc "https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/lib/webRTC.ts"

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_mobilehome,node_desktophome,node_mobilechat,node_desktopchat,node_mobileauth,node_desktopauth toneBlue
class node_protocol,node_mobilews,node_desktopws toneAmber
class node_mobilecrypto,node_desktopcrypto,node_mobilemesh,node_desktopmesh,node_webrtc toneMint
class node_rest,node_router,node_serverentry,node_jwt,node_wsendpoint,node_wshub,node_wsmanager toneRose
class node_participant toneIndigo
```

## Components

### Client experiences

- [Mobile home](https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/pages/Home.tsx): `client/mobile/src/pages/Home.tsx`
- [Desktop home](https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/pages/Home.tsx): `client/web-desktop/frontend/src/pages/Home.tsx`
- [Mobile chat](https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/pages/Chat.tsx): `client/mobile/src/pages/Chat.tsx`
- [Desktop chat](https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/pages/Chat.tsx): `client/web-desktop/frontend/src/pages/Chat.tsx`
- [Mobile auth state](https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/stores/authStore.ts): `client/mobile/src/stores/authStore.ts`
- [Desktop auth state](https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/stores/authStore.ts): `client/web-desktop/frontend/src/stores/authStore.ts`

### Room and chat

- [WS protocol](https://github.com/gabriel-logan/private-meet/blob/main/client/shared/protocol/ws.ts): `client/shared/protocol/ws.ts`
- [Mobile WS client](https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/lib/wsInstance.ts): `client/mobile/src/lib/wsInstance.ts`
- [Desktop WS client](https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/lib/wsInstance.ts): `client/web-desktop/frontend/src/lib/wsInstance.ts`

### Privacy and media

- [Mobile E2EE](https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/lib/e2ee.ts): `client/mobile/src/lib/e2ee.ts`
- [Desktop E2EE](https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/lib/e2ee.ts): `client/web-desktop/frontend/src/lib/e2ee.ts`
- [Mobile WebRTC mesh](https://github.com/gabriel-logan/private-meet/blob/main/client/mobile/src/hooks/useWebRTCMesh.ts): `client/mobile/src/hooks/useWebRTCMesh.ts`
- [Desktop WebRTC mesh](https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/hooks/useWebRTCMesh.ts): `client/web-desktop/frontend/src/hooks/useWebRTCMesh.ts`
- [WebRTC helpers](https://github.com/gabriel-logan/private-meet/blob/main/client/web-desktop/frontend/src/lib/webRTC.ts): `client/web-desktop/frontend/src/lib/webRTC.ts`

### Backend services

- [REST API](https://github.com/gabriel-logan/private-meet/blob/main/server/internal/httpapi/handlers/auth.go): `server/internal/httpapi/handlers/auth.go`
- [HTTP routing](https://github.com/gabriel-logan/private-meet/blob/main/server/internal/httpapi/router.go): `server/internal/httpapi/router.go`
- [Server entry](https://github.com/gabriel-logan/private-meet/blob/main/server/cmd/api/main.go): `server/cmd/api/main.go`
- [JWT security](https://github.com/gabriel-logan/private-meet/blob/main/server/internal/security/jwt.go): `server/internal/security/jwt.go`
- [WebSocket endpoint](https://github.com/gabriel-logan/private-meet/blob/main/server/internal/ws/handler.go): `server/internal/ws/handler.go`
- [Room relay](https://github.com/gabriel-logan/private-meet/blob/main/server/internal/ws/hub.go): `server/internal/ws/hub.go`
- [WebSocket manager](https://github.com/gabriel-logan/private-meet/blob/main/server/internal/ws/manager.go): `server/internal/ws/manager.go`

### Other components

- **Participant**

## Connections

- Participant → Mobile home: creates or joins
- Participant → Desktop home: creates or joins
- Mobile home → REST API: signs in
- Desktop home → REST API: signs in
- REST API → JWT security: issues token (evidence: `server/internal/httpapi/handlers/auth.go`)
- Server entry → HTTP routing: configures (evidence: `server/cmd/api/main.go`)
- HTTP routing → WebSocket endpoint: routes WS (evidence: `server/internal/httpapi/router.go`)
- HTTP routing → REST API: routes sign-in (evidence: `server/internal/httpapi/router.go`)
- Server entry → WebSocket manager: creates manager (evidence: `server/cmd/api/main.go`)
- HTTP routing → WebSocket manager: passes manager (evidence: `server/internal/httpapi/router.go`)
- WebSocket endpoint → JWT security: validates token (evidence: `server/internal/ws/handler.go`)
- Mobile chat → Mobile WS client: uses connection
- Desktop chat → Desktop WS client: uses connection (evidence: `client/web-desktop/frontend/src/pages/Chat.tsx`)
- Mobile chat → Mobile E2EE: encrypts messages
- Desktop chat → Desktop E2EE: encrypts messages (evidence: `client/web-desktop/frontend/src/pages/Chat.tsx`)
- Mobile chat → Mobile WebRTC mesh: runs meeting
- Desktop chat → Desktop WebRTC mesh: runs meeting (evidence: `client/web-desktop/frontend/src/pages/Chat.tsx`)
- Mobile WebRTC mesh → WS protocol: handles signaling (evidence: `client/mobile/src/hooks/useWebRTCMesh.ts`)
- Desktop WebRTC mesh → WS protocol: handles signaling (evidence: `client/web-desktop/frontend/src/hooks/useWebRTCMesh.ts`)
- Desktop WebRTC mesh → WebRTC helpers: delegates media (evidence: `client/web-desktop/frontend/src/hooks/useWebRTCMesh.ts`)
- WebSocket endpoint → Room relay: relays room events
- WebSocket manager → Room relay: dispatches rooms
