| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Variance is a private, decentralized messaging app for people who think their conversations are nobody else's business. No accounts, no phone numbers, no company holding your data. You generate an identity that belongs to you, pick a username, and start talking. The encryption, the peer discovery, the relay infrastructure — all of it happens invisibly. You shouldn't have to understand cryptography to deserve privacy.
Conversations in Variance are ephemeral by design. Messages fade after 30 days, because that's how real conversations work — you remember what matters and let the rest go. There are no servers to subpoena, no message archives to leak, and no social graph being harvested in the background. Find your people however you find them: share a username in person, send a link, scan a code. Variance doesn't want to know who your friends are.
Variance is a multi-crate workspace implementing a decentralized communication platform with:
variance/ ├── crates/ │ ├── variance-proto/ # Protocol Buffer definitions │ ├── variance-p2p/ # libp2p networking core │ ├── variance-identity/ # DID-based identity system │ ├── variance-messaging/ # Chat and messaging │ ├── variance-media/ # WebRTC media handling │ ├── variance-app/ # Application logic & HTTP API │ ├── variance-relay/ # Standalone relay node (NAT traversal, offline message relay) │ └── variance-cli/ # Standalone CLI (headless/debugging only) ├── app/ # Tauri desktop application (React/TypeScript) │ ├── src/ # UI components (onboarding, conversations, messages) │ └── src-tauri/ # Tauri host (embeds variance_app in-process via FFI) ├── docs/ # Architecture documentation └── Cargo.toml # Workspace manifest
| Crate | Purpose | Key Dependencies |
|---|---|---|
| variance-proto | Protobuf schemas | prost |
| variance-p2p | libp2p networking + protocol handlers | libp2p, tokio, variance-{identity,messaging,media} |
| variance-identity | DID & identity logic | variance-proto, ed25519-dalek |
| variance-messaging | Messaging logic | variance-proto, variance-identity, ulid |
| variance-media | WebRTC signaling logic | variance-proto, ed25519-dalek |
| variance-app | HTTP API & state | axum, variance-p2p, variance-{identity,messaging,media} |
| variance-relay | Standalone relay node (NAT traversal) | libp2p, axum, clap |
| variance-cli | Standalone CLI (headless/debugging) | variance-app, clap |
| variance-desktop | Tauri desktop host (primary runtime) | tauri, variance-app |
Architecture note: The Tauri desktop app embeds variance-app in-process — there is no sidecar. The React frontend talks to the Rust node directly via Tauri commands (FFI). variance-cli exists for headless operation, debugging, and testing only.
Note: As of 2026-02-15, the dependency flow was corrected. variance-p2p now depends on the business logic crates (not vice versa) to wire up protocol handlers.
macOS:
brew install protobufLinux:
apt install -y protobuf-compiler # Debian/Ubuntu
dnf install -y protobuf-compiler # FedoraWindows:
choco install protoc# Build all crates
cargo build
# Build specific crate
cargo build -p variance-app
# Build release
cargo build --releaseThe primary way to use Variance is through the Tauri desktop app, which embeds the node in-process.
Using the justfile (recommended):
just dev # Run the desktop app in dev mode
just tauri-build # Build a release bundle
just frontend-dev # Run just the frontend (no Tauri/node)
just dev-two # Run two instances for P2P testingOr directly via pnpm in the app/ directory:
cd app
pnpm install # First time only
pnpm run tauri:dev # Dev mode with hot reload
pnpm run tauri:build # Release bundle
pnpm run dev # Frontend only (Vite dev server, no Tauri)The desktop app handles identity generation, configuration, and node startup automatically through its onboarding flow.
The variance CLI exists for headless operation, debugging, and testing (e.g. generating identities without the UI, running a second node for P2P testing):
# Generate an identity
cargo run --bin variance -- identity generate
# Start a headless node
cargo run --bin variance -- start
# Show identity info
cargo run --bin variance -- identity showSee docs/CLI-USAGE.md for the full command reference.
A relay node enables NAT traversal for peers behind restrictive firewalls. It accepts circuit reservations and forwards traffic between peers that cannot connect directly.
# Build the relay binary
cargo build -p variance-relay --release
# Run (listens on port 4001 by default)
./target/release/variance-relay --port 4001The relay prints its PeerId on startup:
INFO variance_relay: Relay PeerId: 12D3KooW... INFO variance_relay: Listening on /ip4/0.0.0.0/tcp/4001
To configure clients to use the relay, add to your config.toml:
[[p2p.relay_peers]]
peer_id = "12D3KooW..."
multiaddr = "/ip4/<YOUR_IP>/tcp/4001"The client will dial the relay on startup, reserve a circuit slot, and become reachable at /ip4/<YOUR_IP>/tcp/4001/p2p/12D3KooW.../p2p-circuit/p2p/<CLIENT_PEER_ID>.
See docs/NAT-TRAVERSAL.md for design details.
cargo testThis project uses pre-commit to automatically run checks before commits and pushes. The hooks ensure code quality by running formatters, linters, and tests.
Installation:
Install pre-commit (if not already installed):
# macOS
brew install pre-commit
# Linux/macOS with pip
pip install pre-commit
# Or use pipx
pipx install pre-commitInstall the git hooks in your local repository:
pre-commit install
pre-commit install --hook-type pre-pushWhat Gets Checked:
On every commit:
On every push:
Manual Usage:
# Run all hooks on all files (useful after installation)
pre-commit run --all-files
# Run only on staged files
pre-commit run
# Run specific hook
pre-commit run cargo-fmt --all-files
pre-commit run clippy --all-files
# Skip hooks for a specific commit (not recommended)
git commit --no-verifyUpdating Hooks:
# Update hook versions to latest
pre-commit autoupdateThe pre-commit configuration is in .pre-commit-config.yaml.
Protobufs are automatically compiled during build via prost-build in variance-proto/build.rs.
To manually trigger:
cargo build -p variance-protoRUST_LOG controls log verbosity for both the desktop app and the CLI — the node is the same code either way:
# Desktop app
RUST_LOG=variance=debug just dev
# CLI (headless)
RUST_LOG=variance=debug cargo run --bin variance -- start
# Trace level with libp2p internals
RUST_LOG=variance=trace,libp2p=debug just devFoundation:
Identity System:
Messaging:
Media (WebRTC):
Application Layer:
Testing & Documentation:
AGPL-3.0 License. See LICENSE for details.
Contributions welcome. Core messaging, identity, and relay infrastructure are implemented and stable.
Key areas for future work:
| Back | FazBrowse Home | New Git URL |