# liamcottle/reticulum-meshchat architecture

> Architecture diagram of the GitHub repository liamcottle/reticulum-meshchat, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/liamcottle/reticulum-meshchat
- Repository: https://github.com/liamcottle/reticulum-meshchat

## Overview

##### Main Components

a) Client-Side Components:
- Electron Application Container
- Vue.js Frontend
- WebSocket Client
- Audio Processing System (codec2)
- Local Storage (SQLite)

b) Server-Side Components:
- Python Backend Server
- WebSocket Server
- Reticulum Network Stack
- LXMF Router
- Database Handler

c) Network Interfaces:
- AutoInterface
- RNodeInterface
- TCPClient/Server Interfaces
- UDP Interface
- LoRa Radio Interface

##### Component Relationships

**[User Interface Layer]**
- Electron Container
- Vue.js Frontend Components
- Messages UI
- Network Visualizer
- Call Interface
- Settings/Profile Management
- Frontend Services
- WebSocket Client
- Audio Processing
- Local Storage

**[Backend Layer]**
- Python Server
- WebSocket Server
- LXMF Router
- Database Handler
- Reticulum Network Stack

**[Network Interface Layer]**
- Multiple Interface Types
- Local Network (Auto/UDP)
- Internet (TCP)
- LoRa Radio
- Other Interfaces

##### Key Design Elements

- Blue: Frontend components
- Green: Backend services
- Orange: Network interfaces
- Purple: External services/nodes
- Gray: Database/storage

b) Connection Types:

##### Implementation Details

- WebSocket connection on port 8000
- SQLite database for message storage
- Identity management system
- File and message encryption paths
- Audio codec processing pipeline
- Announce system for peer discovery

##### External Integrations

- Connection to other LXMF clients
- Integration with Nomad Network nodes
- LoRa radio communication via RNode
- Internet connectivity through TCP servers

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        EC[Electron Container]
        VF[Vue.js Frontend]
        WC[WebSocket Client]
        AP[Audio Processing]
        LS[(Local Storage)]
        
        subgraph "Frontend Components"
            MU[Messages UI]
            NV[Network Visualizer]
            CI[Call Interface]
            SP[Settings/Profile]
            IM[Interface Management]
        end
        
        EC --> VF
        VF --> WC
        VF --> AP
        VF --> LS
        VF --> |Contains| MU
        VF --> |Contains| NV
        VF --> |Contains| CI
        VF --> |Contains| SP
        VF --> |Contains| IM
    end
    
    subgraph Server
        PS[Python Backend Server]
        WS[WebSocket Server]
        LX[LXMF Router]
        DB[(Database Handler)]
        RN[Reticulum Network Stack]
        AH[Announce Handler]
        
        PS --> WS
        PS --> LX
        PS --> DB
        PS --> RN
        PS --> AH
    end
    
    subgraph "Network Layer"
        AI[AutoInterface]
        RI[RNode Interface]
        TC[TCP Interface]
        UD[UDP Interface]
        LR[LoRa Radio]
        
        RN --> AI
        RN --> RI
        RN --> TC
        RN --> UD
        RI --> LR
    end
    
    WC <--> |WebSocket| WS
    
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef network fill:#e67e22,stroke:#d35400,color:white
    classDef storage fill:#95a5a6,stroke:#7f8c8d,color:white
    
    class EC,VF,WC,AP,MU,NV,CI,SP,IM frontend
    class PS,WS,LX,RN,AH backend
    class AI,RI,TC,UD,LR network
    class LS,DB storage
    
    click EC "https://github.com/liamcottle/reticulum-meshchat/blob/master/electron/main.js"
    click VF "https://github.com/liamcottle/reticulum-meshchat/blob/master/src/frontend/components/App.vue"
    click WC "https://github.com/liamcottle/reticulum-meshchat/blob/master/src/frontend/js/WebSocketConnection.js"
    click AP "https://github.com/liamcottle/reticulum-meshchat/blob/master/src/backend/audio_call_manager.py"
    click LS "https://github.com/liamcottle/reticulum-meshchat/blob/master/database.py"
    click PS "https://github.com/liamcottle/reticulum-meshchat/blob/master/meshchat.py"
    click LX "https://github.com/liamcottle/reticulum-meshchat/blob/master/src/backend/lxmf_message_fields.py"
    click NV "https://github.com/liamcottle/reticulum-meshchat/blob/master/src/frontend/components/network-visualiser/NetworkVisualiser.vue"
    click CI "https://github.com/liamcottle/reticulum-meshchat/blob/master/src/frontend/components/call/CallPage.vue"
    click MU "https://github.com/liamcottle/reticulum-meshchat/blob/master/src/frontend/components/messages/MessagesPage.vue"
    click SP "https://github.com/liamcottle/reticulum-meshchat/blob/master/src/frontend/components/settings/SettingsPage.vue"
    click IM "https://github.com/liamcottle/reticulum-meshchat/blob/master/src/frontend/components/interfaces/InterfacesPage.vue"
    click AH "https://github.com/liamcottle/reticulum-meshchat/blob/master/src/backend/announce_handler.py"
```
