# phantominthewire/ventus architecture

> Architecture diagram of the GitHub repository phantominthewire/ventus, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/phantominthewire/ventus
- Repository: https://github.com/phantominthewire/ventus

## Overview

##### Main Components

a. Client Applications
- iOS Client (Ventus-iOS)
- macOS Client (Ventus-macos)
- CLI Clients (alt-cli, async_cli)
- Desktop GUI Application (desktop-app)

b. Server Components
- Async FTP Server (async-ftp-server)
- Sync FTP Server (sync-ftp-server)
- Actix Web Server (actix-web)
- Notification System (client-server-notify)

c. Core Components
- FTP Client Library (ftp_client)
- QR Code Helper (qrcode-helper)
- Background Daemon (daemon)

##### Component Relationships

- Connection between clients and notification system for real-time updates
- Integration between mobile/desktop apps and QR code helper
- Communication between the daemon and sync servers

##### Specific Implementation Details

Technical elements:
- FFI bridges (shown in ftp_clientFFI files)
- Protocol buffers (file_sync.proto)
- WebSocket connections for real-time updates
- File system watchers
- Async runtime environment

##### Key Features to Highlight

Architectural aspects:
- Asynchronous communication patterns
- Multi-platform support
- Real-time synchronization
- File system monitoring
- Cross-platform compatibility layer

##### Component Details

For each major component, include:
- Primary responsibilities
- Key dependencies
- Communication protocols used
- Platform-specific considerations

##### Security boundaries and authentication flows

This will create a comprehensive visualization of the Ventus system that accurately represents its distributed, multi-platform nature while highlighting its asynchronous communication patterns and file synchronization capabilities.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Clients
        iOS["iOS Client"]:::client
        macOS["macOS Client"]:::client
        CLI1["Alt CLI"]:::client
        CLI2["Async CLI"]:::client
        Desktop["Desktop GUI"]:::client
    end

    subgraph "Communication Layer"
        FTPClient["FTP Client Library"]:::core
        QR["QR Code Helper"]:::utility
        Proto["Protocol Buffers"]:::protocol
        WSConn["WebSocket Connection"]:::protocol
    end

    subgraph "Server Infrastructure"
        AsyncFTP["Async FTP Server"]:::server
        SyncFTP["Sync FTP Server"]:::server
        ActixWeb["Actix Web Server"]:::server
        Notify["Notification System"]:::server
        Daemon["Background Daemon"]:::service
    end

    %% Client Connections
    iOS --> FTPClient
    macOS --> FTPClient
    CLI1 --> FTPClient
    CLI2 --> FTPClient
    Desktop --> FTPClient

    %% QR Code Integration
    iOS --> QR
    macOS --> QR
    Desktop --> QR

    %% Protocol and Communication
    FTPClient --> AsyncFTP
    FTPClient --> SyncFTP
    Proto --> Notify
    WSConn --> Notify

    %% Server Interactions
    AsyncFTP --> Daemon
    SyncFTP --> Daemon
    Notify --> ActixWeb
    Daemon --> ActixWeb

    %% Real-time Updates
    Notify --> iOS
    Notify --> macOS
    Notify --> Desktop
    Notify --> CLI1
    Notify --> CLI2

    %% Click Events
    click iOS "https://github.com/PhantomInTheWire/Ventus/tree/main/Ventus-iOS"
    click macOS "https://github.com/PhantomInTheWire/Ventus/tree/main/Ventus-macos"
    click CLI1 "https://github.com/PhantomInTheWire/Ventus/tree/main/alt-cli"
    click CLI2 "https://github.com/PhantomInTheWire/Ventus/tree/main/async_cli"
    click Desktop "https://github.com/PhantomInTheWire/Ventus/tree/main/desktop-app"
    click AsyncFTP "https://github.com/PhantomInTheWire/Ventus/tree/main/async-ftp-server"
    click SyncFTP "https://github.com/PhantomInTheWire/Ventus/tree/main/sync-ftp-server"
    click ActixWeb "https://github.com/PhantomInTheWire/Ventus/tree/main/actix-web"
    click Notify "https://github.com/PhantomInTheWire/Ventus/tree/main/client-server-notify"
    click Proto "https://github.com/PhantomInTheWire/Ventus/blob/main/client-server-notify/file_sync.proto"
    click FTPClient "https://github.com/PhantomInTheWire/Ventus/tree/main/ftp_client"
    click QR "https://github.com/PhantomInTheWire/Ventus/tree/main/qrcode-helper"
    click Daemon "https://github.com/PhantomInTheWire/Ventus/blob/main/daemon/main.py"

    %% Styling
    classDef client fill:#3498db,stroke:#2980b9,color:white
    classDef server fill:#2ecc71,stroke:#27ae60,color:white
    classDef protocol fill:#f1c40f,stroke:#f39c12,color:black
    classDef utility fill:#9b59b6,stroke:#8e44ad,color:white
    classDef service fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef core fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        Client["Client Component"]:::client
        Server["Server Component"]:::server
        Protocol["Protocol/Communication"]:::protocol
        Utility["Utility Component"]:::utility
        Service["Background Service"]:::service
        Core["Core Component"]:::core
    end
```
