# melihercan/webrtcme architecture

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

- Interactive diagram: https://gitdiagram.com/melihercan/webrtcme
- Repository: https://github.com/melihercan/webrtcme

## Overview

WebRTCme presents a W3C-like C# API over platform-specific WebRTC implementations. An application creates peer connections and media through that API; middleware adds media management, a video tile, and data/file messaging, while the connection package supplies signaling for peer-to-peer or mediasoup-SFU calls. The graph preserves these documented capabilities, plus the sampled MAUI rendering, recording, and mediasoup negotiation layers. Broad package relationships come from the README; sampled source confirms the finer implementation links shown.

Main entry points: [`WebRTCme/Api`](https://github.com/melihercan/webrtcme/tree/master/WebRTCme/Api) (W3C API), [`WebRTCme.Connection/WebRTCme.Connection`](https://github.com/melihercan/webrtcme/tree/master/WebRTCme.Connection/WebRTCme.Connection) (Connection Layer), [`WebRTCme.Connection/MediaSoup/WebRTCme.Connection.MediaSoup/Client/Handler.cs`](https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Connection/MediaSoup/WebRTCme.Connection.MediaSoup/Client/Handler.cs) (Mediasoup Handler), [`WebRTCme.Bindings`](https://github.com/melihercan/webrtcme/tree/master/WebRTCme.Bindings) (Native Bindings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Unified WebRTC API"]
  node_api_surface["W3C API"]
  node_cross_api["Platform Facade<br/>[CrossWebRtc.cs]"]
end

subgraph group_bindings["Platform Bindings"]
  node_native_bindings["Native Bindings<br/>[WebRTCme.Bindings]"]
  node_blazor_interop["Blazor Interop<br/>[JsEventHandler.cs]"]
end

subgraph group_middleware["Call Middleware"]
  node_middleware_services["Media Managers<br/>[Services]"]
  node_data_manager["Data Manager<br/>[DataManager.cs]"]
  node_recorder["Media Recorder"]
  node_media_tile["MAUI Video Tile<br/>[Media.cs]"]
  node_media_handler["MAUI Tile Handler"]
end

subgraph group_connection["Connection Layer"]
  node_connection_factory["Connection Layer"]
  node_mesh_connection["Peer-to-Peer<br/>[Services]"]
  node_mediasoup_handler["Mediasoup Handler<br/>[Handler.cs]"]
  node_socket["WebSocket Transport"]
end

subgraph group_signaling["Signaling Services"]
  node_signaling_client["Signaling Client<br/>[SignalingClient.cs]"]
  node_signaling_server["Signaling Server<br/>[Program.cs]"]
end

node_app(("Application"))
node_remote_peers(("Remote Peers"))
node_sfu{{"Mediasoup SFU"}}
node_browser_api{{"Browser WebRTC"}}
node_native_sdk{{"Native WebRTC SDKs"}}
node_recording_output["Recorded Media"]

node_app -->|"uses"| node_cross_api
node_cross_api -->|"exposes"| node_api_surface
node_api_surface -->|"maps to"| node_native_bindings
node_native_bindings -.->|"wraps"| node_browser_api
node_native_bindings -.->|"wraps"| node_native_sdk
node_api_surface -->|"extended by"| node_middleware_services
node_middleware_services -.->|"includes"| node_data_manager
node_middleware_services -.->|"includes"| node_recorder
node_api_surface -->|"renders streams"| node_media_tile
node_media_tile -->|"mapped by"| node_media_handler
node_media_handler -->|"reads tracks"| node_api_surface
node_recorder -->|"writes blobs"| node_recording_output
node_app -->|"uses"| node_connection_factory
node_connection_factory -->|"creates"| node_mesh_connection
node_connection_factory -->|"uses signaling"| node_signaling_client
node_connection_factory -->|"supports SFU"| node_mediasoup_handler
node_mediasoup_handler -->|"negotiates via"| node_api_surface
node_mediasoup_handler -.->|"uses transport"| node_socket
node_signaling_client -.->|"signals"| node_signaling_server
node_mesh_connection -->|"connects"| node_remote_peers
node_mediasoup_handler -->|"connects through"| node_sfu
node_sfu -.->|"relays media"| node_remote_peers

click node_api_surface "https://github.com/melihercan/webrtcme/tree/master/WebRTCme/Api"
click node_cross_api "https://github.com/melihercan/webrtcme/blob/master/WebRTCme/CrossWebRtc.cs"
click node_native_bindings "https://github.com/melihercan/webrtcme/tree/master/WebRTCme.Bindings"
click node_blazor_interop "https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Bindings/WebRTCme.Bindings.Blazor/Interops/JsEventHandler.cs"
click node_middleware_services "https://github.com/melihercan/webrtcme/tree/master/WebRTCme.Middleware/Core/Services"
click node_data_manager "https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Middleware/Core/Services/DataManager.cs"
click node_recorder "https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Middleware/Core/Services/MediaRecorderManager.cs"
click node_media_tile "https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Middleware/Maui/Media.cs"
click node_media_handler "https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Middleware/Maui/Platforms/iOS/MediaHandler.MaciOS.cs"
click node_connection_factory "https://github.com/melihercan/webrtcme/tree/master/WebRTCme.Connection/WebRTCme.Connection"
click node_mesh_connection "https://github.com/melihercan/webrtcme/tree/master/WebRTCme.Connection/WebRTCme.Connection/Services"
click node_mediasoup_handler "https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Connection/MediaSoup/WebRTCme.Connection.MediaSoup/Client/Handler.cs"
click node_socket "https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Connection/MediaSoup/WebRTCme.Connection.MediaSoup/ClientWebSockets/ClientWebSocketLitePcl.cs"
click node_signaling_client "https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Connection/Signaling/WebRTCme.Connection.Signaling.Proxy/Client/SignalingClient.cs"
click node_signaling_server "https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Connection/Signaling/WebRTCme.Connection.Signaling.Server/Program.cs"

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_api_surface,node_cross_api,node_browser_api toneBlue
class node_native_bindings,node_blazor_interop toneAmber
class node_middleware_services,node_data_manager,node_recorder,node_media_tile,node_media_handler toneMint
class node_connection_factory,node_mesh_connection,node_mediasoup_handler,node_socket toneRose
class node_signaling_client,node_signaling_server,node_app,node_remote_peers,node_sfu,node_native_sdk,node_recording_output toneIndigo
```

## Components

### Unified WebRTC API

- [W3C API](https://github.com/melihercan/webrtcme/tree/master/WebRTCme/Api): `WebRTCme/Api`
- [Platform Facade](https://github.com/melihercan/webrtcme/blob/master/WebRTCme/CrossWebRtc.cs): `WebRTCme/CrossWebRtc.cs`

### Platform Bindings

- [Native Bindings](https://github.com/melihercan/webrtcme/tree/master/WebRTCme.Bindings): `WebRTCme.Bindings`
- [Blazor Interop](https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Bindings/WebRTCme.Bindings.Blazor/Interops/JsEventHandler.cs): `WebRTCme.Bindings/WebRTCme.Bindings.Blazor/Interops/JsEventHandler.cs`

### Call Middleware

- [Media Managers](https://github.com/melihercan/webrtcme/tree/master/WebRTCme.Middleware/Core/Services): `WebRTCme.Middleware/Core/Services`
- [Data Manager](https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Middleware/Core/Services/DataManager.cs): `WebRTCme.Middleware/Core/Services/DataManager.cs`
- [Media Recorder](https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Middleware/Core/Services/MediaRecorderManager.cs): `WebRTCme.Middleware/Core/Services/MediaRecorderManager.cs`
- [MAUI Video Tile](https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Middleware/Maui/Media.cs): `WebRTCme.Middleware/Maui/Media.cs`
- [MAUI Tile Handler](https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Middleware/Maui/Platforms/iOS/MediaHandler.MaciOS.cs): `WebRTCme.Middleware/Maui/Platforms/iOS/MediaHandler.MaciOS.cs`

### Connection Layer

- [Connection Layer](https://github.com/melihercan/webrtcme/tree/master/WebRTCme.Connection/WebRTCme.Connection): `WebRTCme.Connection/WebRTCme.Connection`
- [Peer-to-Peer](https://github.com/melihercan/webrtcme/tree/master/WebRTCme.Connection/WebRTCme.Connection/Services): `WebRTCme.Connection/WebRTCme.Connection/Services`
- [Mediasoup Handler](https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Connection/MediaSoup/WebRTCme.Connection.MediaSoup/Client/Handler.cs): `WebRTCme.Connection/MediaSoup/WebRTCme.Connection.MediaSoup/Client/Handler.cs`
- [WebSocket Transport](https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Connection/MediaSoup/WebRTCme.Connection.MediaSoup/ClientWebSockets/ClientWebSocketLitePcl.cs): `WebRTCme.Connection/MediaSoup/WebRTCme.Connection.MediaSoup/ClientWebSockets/ClientWebSocketLitePcl.cs`

### Signaling Services

- [Signaling Client](https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Connection/Signaling/WebRTCme.Connection.Signaling.Proxy/Client/SignalingClient.cs): `WebRTCme.Connection/Signaling/WebRTCme.Connection.Signaling.Proxy/Client/SignalingClient.cs`
- [Signaling Server](https://github.com/melihercan/webrtcme/blob/master/WebRTCme.Connection/Signaling/WebRTCme.Connection.Signaling.Server/Program.cs): `WebRTCme.Connection/Signaling/WebRTCme.Connection.Signaling.Server/Program.cs`

### Other components

- **Application**
- **Remote Peers**
- **Mediasoup SFU**
- **Browser WebRTC**
- **Native WebRTC SDKs**
- **Recorded Media**

## Connections

- Application → Platform Facade: uses
- Platform Facade → W3C API: exposes
- W3C API → Native Bindings: maps to
- Native Bindings → Browser WebRTC: wraps
- Native Bindings → Native WebRTC SDKs: wraps
- W3C API → Media Managers: extended by (evidence: `WebRTCme.Middleware/Core/Services/DataManager.cs`)
- Media Managers → Data Manager: includes
- Media Managers → Media Recorder: includes
- W3C API → MAUI Video Tile: renders streams (evidence: `WebRTCme.Middleware/Maui/Media.cs`)
- MAUI Video Tile → MAUI Tile Handler: mapped by (evidence: `WebRTCme.Middleware/Maui/Platforms/iOS/MediaHandler.MaciOS.cs`)
- MAUI Tile Handler → W3C API: reads tracks (evidence: `WebRTCme.Middleware/Maui/Platforms/iOS/MediaHandler.MaciOS.cs`)
- Media Recorder → Recorded Media: writes blobs (evidence: `WebRTCme.Middleware/Core/Services/MediaRecorderManager.cs`)
- Application → Connection Layer: uses
- Connection Layer → Peer-to-Peer: creates (evidence: `WebRTCme.Connection/WebRTCme.Connection/Extensions/ServiceExtensions.cs`)
- Connection Layer → Signaling Client: uses signaling
- Connection Layer → Mediasoup Handler: supports SFU
- Mediasoup Handler → W3C API: negotiates via (evidence: `WebRTCme.Connection/MediaSoup/WebRTCme.Connection.MediaSoup/Client/Handler.cs`)
- Mediasoup Handler → WebSocket Transport: uses transport
- Signaling Client → Signaling Server: signals
- Peer-to-Peer → Remote Peers: connects
- Mediasoup Handler → Mediasoup SFU: connects through
- Mediasoup SFU → Remote Peers: relays media
