# jaennaet/pissstream architecture

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

- Interactive diagram: https://gitdiagram.com/jaennaet/pissstream
- Repository: https://github.com/jaennaet/pissstream

## Overview

##### Main Components

a) Client-Side Components:
- Menu Bar Interface
- WebSocket Client
- State Management
- Data Processing Layer

b) External Services:
- NASA's ISS Telemetry Stream
- Lightstreamer Service

**User Interface Layer**

**Application Layer**

**Communication Layer**

**External Services Layer**

##### Specific Component Details

a) User Interface Layer:
- It to the ContentView component

b) Application Layer:
- AppStateViewModel component
- State management flow

c) Communication Layer:
- PissSocket component (WebSocket client)
- Connection handling

d) External Services:
- NASA ISS Telemetry Stream
- Lightstreamer Service

- Unidirectional data flow from AppStateViewModel to UI components
- Error state handling paths

##### Important Elements to Highlight

- Connection states (Connected, Connection Lost, Signal Lost)
- Real-time data flow
- State updates to UI
- Error handling paths

##### Specific Implementation Details

- SwiftUI-based architecture
- Real-time WebSocket communication
- Menu bar integration
- State management pattern

##### Additional Notes

- Real-time nature of the application
- Menu bar integration
- Error handling paths clearly

Remember to include:
- Clear component boundaries
- State transition flows
- Error handling paths
- Real-time data update cycle
- Menu bar integration specifics

This will provide a complete picture of how this unique application interfaces with space station telemetry to display something as specific as the ISS urine tank levels in real-time.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef endpoint fill:#3498db,stroke:#2980b9,color:white
    classDef service fill:#2ecc71,stroke:#27ae60,color:white

    %% API Endpoints
    subgraph NASA_API
        E1["GET /telemetry/stream"]:::endpoint
        E2["GET /telemetry/status"]:::endpoint
    end

    subgraph Lightstreamer_API
        E3["WS /lightstreamer/create_session"]:::endpoint
        E4["WS /lightstreamer/bind_session"]:::endpoint
        E5["WS /lightstreamer/control"]:::endpoint
        E6["WS /lightstreamer/destroy_session"]:::endpoint
    end

    %% Services
    NASA["NASA ISS Telemetry Service"]:::service
    LS["Lightstreamer Service"]:::service

    %% Connections
    NASA --> E1
    NASA --> E2
    LS --> E3
    LS --> E4
    LS --> E5
    LS --> E6

    %% Click Events
    click E3 "https://github.com/Jaennaet/pISSStream/blob/main/pISSStream/PissSocket.swift"
    click E4 "https://github.com/Jaennaet/pISSStream/blob/main/pISSStream/PissSocket.swift"
    click E5 "https://github.com/Jaennaet/pISSStream/blob/main/pISSStream/PissSocket.swift"
    click E6 "https://github.com/Jaennaet/pISSStream/blob/main/pISSStream/PissSocket.swift"
```
