# confetti3/sf4-ember-netplay architecture

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

- Interactive diagram: https://gitdiagram.com/confetti3/sf4-ember-netplay
- Repository: https://github.com/confetti3/sf4-ember-netplay

## Overview

SF4 Ember Netplay is a Windows in-game overlay and helper for private rollback rooms, with Rust networking, room-recovery and invitation capabilities, plus server services and a TypeScript bridge SDK. The player workflow is to create or join a room by invitation, then choose a battle table, queue, or spectate. The README documents product capabilities; source excerpts expose selected networking, identity, recovery, and SDK behavior. Many UI and server implementation files were not sampled, so links between those subsystems are omitted where their runtime wiring is not evidenced.

Main entry points: [`sdk/typescript/src/client.ts`](https://github.com/confetti3/sf4-ember-netplay/blob/release/sdk/typescript/src/client.ts) (TypeScript client), [`server/ember/bridge/src/http.rs`](https://github.com/confetti3/sf4-ember-netplay/blob/release/server/ember/bridge/src/http.rs) (Bridge API), [`server/ember/bridge/src/routes/webhooks.rs`](https://github.com/confetti3/sf4-ember-netplay/blob/release/server/ember/bridge/src/routes/webhooks.rs) (Webhook subscriptions), [`rust/sf4-net/src/service/mod.rs`](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/service/mod.rs) (Room networking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client networking"]
  node_netservice["Room networking<br/>[mod.rs]"]
  node_identity[("Persistent identity<br/>[mod.rs]")]
  node_identity_envelope["Identity envelope<br/>[envelope.rs]"]
  node_invite["Room invitations<br/>[invite.rs]"]
  node_short_invite["Short invitations<br/>[short_invite.rs]"]
  node_public_room["Public room admission<br/>[public_room.rs]"]
  node_probe["Route probes<br/>[probe.rs]"]
  node_recovery["Room recovery<br/>[recovery.rs]"]
  node_coordination["Room coordination<br/>[coordination.rs]"]
  node_departure["Member departure<br/>[departure.rs]"]
  node_transport["Peer transport<br/>[transport.rs]"]
  node_wire["Wire framing<br/>[wire.rs]"]
  node_tournament_bridges["Tournament bridges<br/>[bridges.rs]"]
end

subgraph group_server["Room services"]
  node_rooms_server["Public room hosting<br/>[supervisor.rs]"]
  node_short_server["Short-link service<br/>[lib.rs]"]
end

subgraph group_bridge["Bridge platform"]
  node_bridge_api["Bridge API<br/>[http.rs]"]
  node_webhook_routes["Webhook subscriptions<br/>[webhooks.rs]"]
  node_webhook_delivery["Webhook delivery<br/>[webhooks.rs]"]
end

subgraph group_sdk["Bridge SDK"]
  node_sdk_client["TypeScript client<br/>[client.ts]"]
  node_canonical["Strict JSON parsing<br/>[canonical.ts]"]
  node_events["Event parsing<br/>[events.ts]"]
end

node_player(("Player"))
node_overlay["In-game overlay"]

node_player -->|"uses"| node_overlay
node_overlay -.->|"starts room play"| node_netservice
node_player -->|"shares invitation"| node_invite
node_player -->|"joins room"| node_public_room
node_player -->|"hosts room"| node_rooms_server
node_player -.->|"uses short links"| node_short_server
node_sdk_client -->|"sends API requests"| node_bridge_api
node_sdk_client -->|"parses responses"| node_canonical
node_sdk_client -->|"parses events"| node_events
node_webhook_routes -.->|"serves routes"| node_bridge_api

click node_netservice "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/service/mod.rs"
click node_identity "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/identity/mod.rs"
click node_identity_envelope "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/identity/envelope.rs"
click node_invite "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/invite.rs"
click node_short_invite "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/short_invite.rs"
click node_public_room "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/public_room.rs"
click node_probe "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/probe.rs"
click node_recovery "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/recovery.rs"
click node_coordination "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/coordination.rs"
click node_departure "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/service/departure.rs"
click node_transport "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/transport.rs"
click node_wire "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/wire.rs"
click node_tournament_bridges "https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/tournament/bridges.rs"
click node_rooms_server "https://github.com/confetti3/sf4-ember-netplay/blob/release/server/ember-rooms/src/supervisor.rs"
click node_short_server "https://github.com/confetti3/sf4-ember-netplay/blob/release/server/ember-short/src/lib.rs"
click node_bridge_api "https://github.com/confetti3/sf4-ember-netplay/blob/release/server/ember/bridge/src/http.rs"
click node_webhook_routes "https://github.com/confetti3/sf4-ember-netplay/blob/release/server/ember/bridge/src/routes/webhooks.rs"
click node_webhook_delivery "https://github.com/confetti3/sf4-ember-netplay/blob/release/server/ember/bridge/src/delivery/webhooks.rs"
click node_sdk_client "https://github.com/confetti3/sf4-ember-netplay/blob/release/sdk/typescript/src/client.ts"
click node_canonical "https://github.com/confetti3/sf4-ember-netplay/blob/release/sdk/typescript/src/canonical.ts"
click node_events "https://github.com/confetti3/sf4-ember-netplay/blob/release/sdk/typescript/src/events.ts"

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_netservice,node_identity,node_identity_envelope,node_invite,node_short_invite,node_public_room,node_probe,node_recovery,node_coordination,node_departure,node_transport,node_wire,node_tournament_bridges toneBlue
class node_rooms_server,node_short_server toneAmber
class node_bridge_api,node_webhook_routes,node_webhook_delivery toneMint
class node_sdk_client,node_canonical,node_events toneRose
class node_player,node_overlay toneIndigo
```

## Components

### Client networking

- [Room networking](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/service/mod.rs): `rust/sf4-net/src/service/mod.rs`
- [Persistent identity](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/identity/mod.rs): `rust/sf4-net/src/identity/mod.rs`
- [Identity envelope](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/identity/envelope.rs): `rust/sf4-net/src/identity/envelope.rs`
- [Room invitations](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/invite.rs): `rust/sf4-net/src/invite.rs`
- [Short invitations](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/short_invite.rs): `rust/sf4-net/src/short_invite.rs`
- [Public room admission](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/public_room.rs): `rust/sf4-net/src/public_room.rs`
- [Route probes](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/probe.rs): `rust/sf4-net/src/probe.rs`
- [Room recovery](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/recovery.rs): `rust/sf4-net/src/recovery.rs`
- [Room coordination](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/coordination.rs): `rust/sf4-net/src/coordination.rs`
- [Member departure](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/service/departure.rs): `rust/sf4-net/src/service/departure.rs`
- [Peer transport](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/transport.rs): `rust/sf4-net/src/transport.rs`
- [Wire framing](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/wire.rs): `rust/sf4-net/src/wire.rs`
- [Tournament bridges](https://github.com/confetti3/sf4-ember-netplay/blob/release/rust/sf4-net/src/tournament/bridges.rs): `rust/sf4-net/src/tournament/bridges.rs`

### Room services

- [Public room hosting](https://github.com/confetti3/sf4-ember-netplay/blob/release/server/ember-rooms/src/supervisor.rs): `server/ember-rooms/src/supervisor.rs`
- [Short-link service](https://github.com/confetti3/sf4-ember-netplay/blob/release/server/ember-short/src/lib.rs): `server/ember-short/src/lib.rs`

### Bridge platform

- [Bridge API](https://github.com/confetti3/sf4-ember-netplay/blob/release/server/ember/bridge/src/http.rs): `server/ember/bridge/src/http.rs`
- [Webhook subscriptions](https://github.com/confetti3/sf4-ember-netplay/blob/release/server/ember/bridge/src/routes/webhooks.rs): `server/ember/bridge/src/routes/webhooks.rs`
- [Webhook delivery](https://github.com/confetti3/sf4-ember-netplay/blob/release/server/ember/bridge/src/delivery/webhooks.rs): `server/ember/bridge/src/delivery/webhooks.rs`

### Bridge SDK

- [TypeScript client](https://github.com/confetti3/sf4-ember-netplay/blob/release/sdk/typescript/src/client.ts): `sdk/typescript/src/client.ts`
- [Strict JSON parsing](https://github.com/confetti3/sf4-ember-netplay/blob/release/sdk/typescript/src/canonical.ts): `sdk/typescript/src/canonical.ts`
- [Event parsing](https://github.com/confetti3/sf4-ember-netplay/blob/release/sdk/typescript/src/events.ts): `sdk/typescript/src/events.ts`

### Other components

- **Player**
- **In-game overlay**

## Connections

- Player → In-game overlay: uses
- In-game overlay → Room networking: starts room play
- Player → Room invitations: shares invitation
- Player → Public room admission: joins room
- Player → Public room hosting: hosts room
- Player → Short-link service: uses short links
- TypeScript client → Bridge API: sends API requests (evidence: `sdk/typescript/src/client.ts`)
- TypeScript client → Strict JSON parsing: parses responses (evidence: `sdk/typescript/src/client.ts`)
- TypeScript client → Event parsing: parses events (evidence: `sdk/typescript/src/client.ts`)
- Webhook subscriptions → Bridge API: serves routes (evidence: `server/ember/bridge/src/routes/webhooks.rs`)
