Skip to main content

Codebase Reference

This page maps the full Wavry workspace so engineers can quickly locate ownership, runtime boundaries, and extension points.

Workspace Snapshot

  • Rust crates in crates/: 17
  • Rust source files in crates/: 82
  • Strongest platform surface area: wavry-media, wavry-server, wavry-client, wavry-gateway
  • Primary protocol/crypto core: rift-core, rift-crypto

Layered Component Map

LayerCratesPrimary Responsibility
Protocolrift-coreRIFT packet formats, relay wire protocol, congestion-control primitives, STUN helpers
Cryptorift-cryptoidentity keys, Noise XX handshake/session, replay windows
Shared runtimewavry-commonshared protocol structs, tracing helpers, file-transfer utility types
Session runtimeswavry-server, wavry-clienthost capture/encode/send, client receive/decode/render/input
Control planewavry-gateway, wavry-master, wavry-relayauth/signaling, relay registry/selection, encrypted UDP forwarding
Platform/mediawavry-media, wavry-platformcapture, encode/decode/render, input injection, clipboard
Product/API surfaceswavry-desktop, wavry-cli, wavry-ffi, wavry-web, wavry-vr*desktop UX, CLI tooling, FFI embedding, web bridge, VR adapters

Crate-by-Crate Guide

Protocol and Crypto

CrateKey FilesWhat You Change Here
rift-corecrates/rift-core/src/lib.rs, crates/rift-core/src/cc.rs, crates/rift-core/src/relay.rs, crates/rift-core/src/stun.rspacket schemas, framing logic, congestion behavior, relay wire headers
rift-cryptocrates/rift-crypto/src/identity.rs, crates/rift-crypto/src/noise.rs, crates/rift-crypto/src/session.rs, crates/rift-crypto/src/connection.rshandshake flow, key material rules, replay protection windows, secure packet wrapping

Session Runtime

CrateEntrypointKey ModulesNotes
wavry-servercrates/wavry-server/src/main.rswebrtc_bridge.rshost runtime; capture + encode + encrypted transport + input/file transfer ingress
wavry-clientcrates/wavry-client/src/bin/wavry-client.rsclient.rs, signaling.rs, media.rs, input.rs, types.rsclient runtime; signaling + receive/decode/render + input uplink
wavry-commoncrates/wavry-common/src/lib.rsprotocol.rs, helpers.rs, file_transfer.rs, error.rsshared message and helper layer used by most services

Control Plane and Relay

CrateEntrypointKey ModulesNotes
wavry-gatewaycrates/wavry-gateway/src/main.rsauth.rs, signal.rs, security.rs, relay.rs, db.rs, admin.rs, web.rsinternet-facing auth/signaling server and gateway-local relay session management
wavry-mastercrates/wavry-master/src/main.rsselection.rsrelay registry, lease issuance, relay scoring/selection
wavry-relaycrates/wavry-relay/src/main.rssession.rsencrypted UDP forwarding with lease validation and rate limiting

Platform and Media

CrateKey FilesNotes
wavry-mediacrates/wavry-media/src/lib.rs, crates/wavry-media/src/linux.rs, crates/wavry-media/src/windows.rs, crates/wavry-media/src/mac_*.rs, crates/wavry-media/src/android/*.rs, crates/wavry-media/src/recorder.rslargest platform-specific surface: encoders, renderers, capture backends, runtime diagnostics
wavry-platformcrates/wavry-platform/src/lib.rs, crates/wavry-platform/src/linux/mod.rs, crates/wavry-platform/src/windows_input_injector.rs, crates/wavry-platform/src/clipboard.rsplatform input injection, capture abstraction, clipboard plumbing

Product and Integration Surfaces

CrateEntrypoint / Core FileNotes
wavry-desktopcrates/wavry-desktop/src-tauri/src/lib.rsTauri desktop shell, auth/session commands, Linux runtime diagnostics commands
wavry-clicrates/wavry-cli/src/main.rsCLI subcommands for keygen, ID inspection, connectivity ping, version
wavry-fficrates/wavry-ffi/src/lib.rsC ABI surface for host/client embedding
wavry-webcrates/wavry-web/src/lib.rsWebTransport/WebRTC integration layer (runtime-feature-gated)
wavry-vrcrates/wavry-vr/src/lib.rsshared VR traits/types/status
wavry-vr-alvrcrates/wavry-vr-alvr/src/lib.rsALVR adapter or stub fallback
wavry-vr-openxrcrates/wavry-vr-openxr/src/lib.rsOpenXR runtime glue per platform

Runtime Entry Points

Primary process entry points in this repository:

  • crates/wavry-server/src/main.rs
  • crates/wavry-client/src/bin/wavry-client.rs
  • crates/wavry-gateway/src/main.rs
  • crates/wavry-master/src/main.rs
  • crates/wavry-relay/src/main.rs
  • crates/wavry-cli/src/main.rs
  • crates/wavry-desktop/src-tauri/src/main.rs

Test Coverage Snapshot (By #[test] / #[tokio::test] Count)

CrateApprox. Test Count
rift-core45
wavry-media34
wavry-client29
wavry-gateway28
rift-crypto24
wavry-common14
wavry-server6
wavry-platform5
wavry-master3
wavry-desktop3
wavry-relay0
wavry-ffi0
wavry-vr, wavry-vr-alvr, wavry-vr-openxr, wavry-web, wavry-cli0

Use this as a prioritization map for additional hardening tests.

Where To Extend Safely

  • New transport behavior: start in rift-core and rift-crypto, then thread into wavry-server and wavry-client.
  • New auth/policy behavior: start in wavry-gateway/src/security.rs and wavry-gateway/src/auth.rs.
  • Relay selection behavior: wavry-master/src/selection.rs.
  • Linux capture/input behavior: wavry-media/src/linux.rs and wavry-platform/src/linux/mod.rs.
  • Desktop workflow integration: wavry-desktop/src-tauri/src/commands.rs and crates/wavry-desktop/src/routes/+page.svelte.