# spkiller2301/distributed-streaming-based-client-server architecture

> Architecture diagram of the GitHub repository spkiller2301/distributed-streaming-based-client-server, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/spkiller2301/distributed-streaming-based-client-server
- Repository: https://github.com/spkiller2301/distributed-streaming-based-client-server

## Overview

Collab App is a browser-based chat and file-sharing application whose clients communicate with a server over a custom reliable, encrypted UDP transport. The principal workflow is browser interaction through the local web UI, client-side message/file handling, server authentication and routing, then delivery to another online client. The graph also includes the transport and shared protocol layers. Relationships for unsampled modules are included only where the README or SOURCE INDEX supports them; the web UI’s detailed request wiring was not excerpted.

Main entry points: [`server/server.py`](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/server/server.py) (Server runtime), [`transport/endpoint.py`](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/transport/endpoint.py) (UDP endpoint), [`client/client.py`](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/client/client.py) (Client runtime), [`server/router.py`](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/server/router.py) (Message router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client_app["Client application"]
  node_web_ui["Local web UI<br/>[http_server.py]"]
  node_web_frontend["Web frontend<br/>[app.js]"]
  node_client_runtime["Client runtime<br/>[client.py]"]
  node_file_transfer["File transfer<br/>[file_transfer.py]"]
end

subgraph group_server_app["Server collaboration"]
  node_server_runtime["Server runtime<br/>[server.py]"]
  node_authentication["Authentication<br/>[auth.py]"]
  node_online_registry["Online registry<br/>[registry.py]"]
  node_message_router["Message router<br/>[router.py]"]
end

subgraph group_transport["Reliable transport"]
  node_udp_endpoint["UDP endpoint<br/>[endpoint.py]"]
  node_connection["Reliable connection<br/>[connection.py]"]
  node_stream_logic["Stream handling<br/>[stream.py]"]
  node_congestion_control["Congestion control<br/>[congestion.py]"]
  node_session_crypto["Session crypto<br/>[crypto.py]"]
end

subgraph group_protocol["Shared protocol"]
  node_packet_codec["Packet codec<br/>[packet.py]"]
  node_message_codec["Message codec<br/>[messages.py]"]
  node_protocol_constants["Protocol constants<br/>[constants.py]"]
end

node_browser_user(("Browser user"))
node_peer_client(("Other client"))

node_browser_user -->|"uses"| node_web_frontend
node_web_frontend -.->|"serves UI"| node_web_ui
node_web_ui -.->|"exposes actions"| node_client_runtime
node_client_runtime -->|"sends messages"| node_udp_endpoint
node_client_runtime -->|"uses"| node_file_transfer
node_client_runtime -->|"encodes messages"| node_message_codec
node_client_runtime -->|"uses"| node_protocol_constants
node_udp_endpoint -->|"dispatches packets"| node_connection
node_udp_endpoint -->|"uses handshake"| node_session_crypto
node_udp_endpoint -->|"decodes packets"| node_packet_codec
node_connection -->|"uses streams"| node_stream_logic
node_connection -->|"controls sending"| node_congestion_control
node_connection -->|"encrypts data"| node_session_crypto
node_connection -->|"builds packets"| node_packet_codec
node_packet_codec -->|"uses sizes"| node_protocol_constants
node_server_runtime -->|"receives callbacks"| node_udp_endpoint
node_server_runtime -->|"verifies login"| node_authentication
node_server_runtime -->|"tracks users"| node_online_registry
node_server_runtime -->|"routes messages"| node_message_router
node_server_runtime -->|"decodes messages"| node_message_codec
node_server_runtime -->|"uses streams"| node_protocol_constants
node_message_router -->|"sends data"| node_udp_endpoint
node_message_router -->|"looks up users"| node_online_registry
node_message_router -->|"encodes messages"| node_message_codec
node_message_router -->|"uses streams"| node_protocol_constants
node_server_runtime -->|"relays chat and files"| node_peer_client

click node_web_ui "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/client/web_ui/http_server.py"
click node_web_frontend "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/client/web_ui/static/app.js"
click node_client_runtime "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/client/client.py"
click node_file_transfer "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/client/file_transfer.py"
click node_server_runtime "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/server/server.py"
click node_authentication "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/server/auth.py"
click node_online_registry "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/server/registry.py"
click node_message_router "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/server/router.py"
click node_udp_endpoint "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/transport/endpoint.py"
click node_connection "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/transport/connection.py"
click node_stream_logic "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/transport/stream.py"
click node_congestion_control "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/transport/congestion.py"
click node_session_crypto "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/transport/crypto.py"
click node_packet_codec "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/common/packet.py"
click node_message_codec "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/common/messages.py"
click node_protocol_constants "https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/common/constants.py"

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_web_ui,node_web_frontend,node_client_runtime,node_file_transfer,node_browser_user,node_peer_client toneBlue
class node_server_runtime,node_authentication,node_online_registry,node_message_router toneAmber
class node_udp_endpoint,node_connection,node_stream_logic,node_congestion_control,node_session_crypto toneMint
class node_packet_codec,node_message_codec,node_protocol_constants toneRose
```

## Components

### Client application

- [Local web UI](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/client/web_ui/http_server.py): `client/web_ui/http_server.py`
- [Web frontend](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/client/web_ui/static/app.js): `client/web_ui/static/app.js`
- [Client runtime](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/client/client.py): `client/client.py`
- [File transfer](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/client/file_transfer.py): `client/file_transfer.py`

### Server collaboration

- [Server runtime](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/server/server.py): `server/server.py`
- [Authentication](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/server/auth.py): `server/auth.py`
- [Online registry](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/server/registry.py): `server/registry.py`
- [Message router](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/server/router.py): `server/router.py`

### Reliable transport

- [UDP endpoint](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/transport/endpoint.py): `transport/endpoint.py`
- [Reliable connection](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/transport/connection.py): `transport/connection.py`
- [Stream handling](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/transport/stream.py): `transport/stream.py`
- [Congestion control](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/transport/congestion.py): `transport/congestion.py`
- [Session crypto](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/transport/crypto.py): `transport/crypto.py`

### Shared protocol

- [Packet codec](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/common/packet.py): `common/packet.py`
- [Message codec](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/common/messages.py): `common/messages.py`
- [Protocol constants](https://github.com/spkiller2301/distributed-streaming-based-client-server/blob/main/common/constants.py): `common/constants.py`

### Other components

- **Browser user**
- **Other client**

## Connections

- Browser user → Web frontend: uses (evidence: `README.md`)
- Web frontend → Local web UI: serves UI
- Local web UI → Client runtime: exposes actions
- Client runtime → UDP endpoint: sends messages (evidence: `client/client.py`)
- Client runtime → File transfer: uses (evidence: `client/client.py`)
- Client runtime → Message codec: encodes messages (evidence: `client/client.py`)
- Client runtime → Protocol constants: uses (evidence: `client/client.py`)
- UDP endpoint → Reliable connection: dispatches packets (evidence: `transport/endpoint.py`)
- UDP endpoint → Session crypto: uses handshake (evidence: `transport/endpoint.py`)
- UDP endpoint → Packet codec: decodes packets (evidence: `transport/endpoint.py`)
- Reliable connection → Stream handling: uses streams (evidence: `transport/connection.py`)
- Reliable connection → Congestion control: controls sending (evidence: `transport/connection.py`)
- Reliable connection → Session crypto: encrypts data (evidence: `transport/connection.py`)
- Reliable connection → Packet codec: builds packets (evidence: `transport/connection.py`)
- Packet codec → Protocol constants: uses sizes (evidence: `common/packet.py`)
- Server runtime → UDP endpoint: receives callbacks (evidence: `server/server.py`)
- Server runtime → Authentication: verifies login (evidence: `server/server.py`)
- Server runtime → Online registry: tracks users (evidence: `server/server.py`)
- Server runtime → Message router: routes messages (evidence: `server/server.py`)
- Server runtime → Message codec: decodes messages (evidence: `server/server.py`)
- Server runtime → Protocol constants: uses streams (evidence: `server/server.py`)
- Message router → UDP endpoint: sends data (evidence: `server/router.py`)
- Message router → Online registry: looks up users (evidence: `server/router.py`)
- Message router → Message codec: encodes messages (evidence: `server/router.py`)
- Message router → Protocol constants: uses streams (evidence: `server/router.py`)
- Server runtime → Other client: relays chat and files (evidence: `README.md`)
