rushtalk Svelte Themes

Rushtalk

Low-latency voice chat for gamers — built with Tauri 2, Svelte 5, Rust audio engine, Go backend & LiveKit WebRTC

RushTalk

A real-time voice & text communication platform for gamers
Built with Rust, Go, Svelte 5, and Tauri 2.0


Overview

RushTalk is a full-stack, production-grade voice communication application — think Discord, rebuilt from scratch with a focus on low-latency audio and modern architecture. It features a custom zero-allocation Rust audio engine with sub-60ms latency, a Clean Architecture Go backend, and a Svelte 5 desktop client powered by Tauri 2.0.

Key Highlights

  • Custom real-time audio engine in Rust with adaptive jitter buffer, Opus encoding, and packet loss concealment
  • Full-stack monorepo spanning 4 languages (Rust, Go, TypeScript, SQL) with ~12,000+ lines of code
  • Production-ready infrastructure — Docker, Kubernetes, CI/CD pipelines, monitoring
  • All tests passing across 3 test suites (Rust, Go, Vitest)

Architecture

                                 ┌──────────────────────┐
                                 │    LiveKit SFU        │
                                 │  (WebRTC Routing)     │
                                 └──────┬───────┬───────┘
                                        │       │
                              publish   │       │  subscribe
                              (PCM)     │       │  (PCM)
                                        │       │
┌────────────────────────────────────────┼───────┼────────────────────────────────┐
│  Desktop Client (Tauri 2.0)           │       │                                │
│                                       │       │                                │
│  ┌──────────┐   ┌──────────────────┐  │       │  ┌──────────────────────────┐  │
│  │  Svelte  │◄──│  Tauri IPC       │◄─┘       └─►│  Rust Audio Engine       │  │
│  │  Frontend│   │  Commands (40+)  │              │                          │  │
│  │          │──►│                  │──────────────►│  Capture → Pipeline →    │  │
│  │  18 comps│   │  audio / voice / │              │  Opus → LiveKit          │  │
│  │  9 stores│   │  overlay / net   │              │                          │  │
│  │  6 svc   │   └──────────────────┘              │  LiveKit → Mixer →       │  │
│  └──────────┘                                     │  Playback (per-user)     │  │
│                                                   └──────────────────────────┘  │
└─────────────────────────────────────────────────────────────────────────────────┘
                              │
                              │  REST + WebSocket
                              ▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│  Go Backend (Clean Architecture)                                               │
│                                                                                │
│  ┌───────────┐  ┌──────────────┐  ┌───────────────┐  ┌──────────────────────┐  │
│  │  Echo     │  │  Application │  │  Domain        │  │  Infrastructure      │  │
│  │  Handlers │─►│  Services    │─►│  Entities +    │  │  PostgreSQL (pgx v5) │  │
│  │  (41 eps) │  │  (5 svc)     │  │  Permissions   │  │  Redis (sessions)    │  │
│  │           │  │              │  │  (pure logic)  │  │  MinIO (S3 storage)  │  │
│  │  WS Hub   │  └──────────────┘  └───────────────┘  │  LiveKit (tokens)    │  │
│  │  (events) │                                        └──────────────────────┘  │
│  └───────────┘                                                                  │
└─────────────────────────────────────────────────────────────────────────────────┘

Tech Stack

Layer Technology Purpose
Desktop Runtime Tauri 2.0 Native wrapper, IPC bridge, auto-updater
Frontend Svelte 5 + TypeScript Reactive UI, state management
Audio Engine Rust (cpal + audiopus) Capture, processing, Opus codec, playback
Voice Transport LiveKit (WebRTC SFU) Multi-user voice routing, TURN/STUN
Backend API Go (Echo framework) REST endpoints, business logic
Real-time Events WebSocket + Redis Pub/Sub Chat, presence, typing, voice state
Database PostgreSQL 16 Users, servers, channels, messages (16 tables)
Cache / Sessions Redis 7 JWT blocklist, rate limiting, presence
Object Storage MinIO (S3-compatible) File uploads, avatars
Monitoring Prometheus + Grafana Metrics, alerting
CI/CD GitHub Actions Tests, multi-platform builds, Docker push
Deployment Kubernetes + Docker HPA, TLS (cert-manager), health checks

Features

Voice Communication

  • Multi-user voice channels via LiveKit SFU with < 60ms latency
  • Custom audio processing pipeline: high-pass filter, noise suppression, AGC, VAD
  • Opus encoding at 32kbps with adaptive Forward Error Correction
  • Adaptive jitter buffer (EMA-based, 10–80ms range)
  • Packet Loss Concealment — repeats last decoded frame for up to 50ms
  • Speaking indicators with real-time animation
  • Per-user volume control and mute/deafen

Text Chat

  • Per-channel message history with keyset pagination
  • Real-time delivery via WebSocket
  • Message grouping (consecutive messages from same author within 5 minutes)
  • File attachments via S3-compatible storage
  • Typing indicators

Server & Channel Management

  • Create and join servers via invite codes
  • Channel types: text, voice, category
  • Role-based permission system (64-bit bitmask with channel overwrites)
  • Member management with role assignment

Audio Settings

  • Input/output device selection with live switching
  • Noise suppression levels (Off / Low / Standard / Aggressive)
  • Voice activation detection with configurable threshold
  • Push-to-talk mode
  • Real-time diagnostics (underruns, PLC frames, latency)
  • Mic loopback test

Gaming Overlay

  • Always-on-top transparent window
  • Global hotkey toggle (Shift + `)
  • Shows active voice channel participants
  • Configurable opacity and position

Authentication

  • Email/password registration and login
  • OAuth: Steam (OpenID 2.0) and Google (OAuth 2.0 + PKCE)
  • JWT RS256 with 15-minute access tokens and 7-day sliding refresh
  • Automatic token refresh on 401

Platform Support

  • Windows (x86_64)
  • macOS (ARM64 + Intel)
  • Linux (x86_64 AppImage)

Project Structure

RushTalk/
├── apps/
│   ├── api/                              # Go backend
│   │   ├── cmd/server/main.go            # Entry point, dependency injection
│   │   ├── config/                       # Environment configuration
│   │   └── internal/
│   │       ├── domain/                   # Business entities, repository interfaces
│   │       │   ├── user/                 # User, OAuth, Presence
│   │       │   ├── server/               # Server, Member, Role, Permissions
│   │       │   ├── channel/              # Channel, Message, Overwrite
│   │       │   └── voice/                # VoiceRoom, VoiceParticipant
│   │       ├── application/              # Use-case services
│   │       │   ├── auth/                 # Login, OAuth, JWT refresh
│   │       │   ├── user/                 # Profile management
│   │       │   ├── server/               # Server CRUD, membership
│   │       │   ├── channel/              # Channel CRUD, messages
│   │       │   └── voice/                # Room join/leave, LiveKit tokens
│   │       ├── infrastructure/           # External adapters
│   │       │   ├── postgres/             # pgx v5 repositories + migrations
│   │       │   ├── redis/                # Session blocklist, rate limit
│   │       │   ├── storage/              # S3/MinIO client
│   │       │   └── livekit/              # Token generation
│   │       └── interface/
│   │           ├── http/                 # Echo handlers + middleware
│   │           └── ws/                   # WebSocket hub + events
│   │
│   └── desktop/                          # Tauri desktop application
│       ├── src/                          # Svelte 5 frontend
│       │   ├── routes/                   # Pages (main, login, register, overlay)
│       │   └── lib/
│       │       ├── components/           # 18 Svelte components
│       │       │   ├── chat/             # ChatPanel
│       │       │   ├── layout/           # AppLayout, ServerRail, ChannelSidebar
│       │       │   ├── overlay/          # OverlayWindow
│       │       │   ├── ui/               # SettingsModal, ContextMenu
│       │       │   └── voice/            # VoicePanel, VoiceChannelUsers
│       │       ├── stores/               # 9 Svelte stores (auth, voice, messages...)
│       │       ├── services/             # API client, WebSocket, Tauri bridge
│       │       └── types/                # TypeScript type definitions
│       └── src-tauri/                    # Rust backend for Tauri
│           └── src/
│               ├── commands/             # IPC command handlers (40+)
│               └── state/                # AppState (AudioEngine + VoiceRoom)
│
├── crates/                               # Rust workspace
│   ├── rushtalk-audio/                   # Audio engine (1,400+ LOC)
│   │   └── src/
│   │       ├── capture.rs                # Mic input, spin-yield loop
│   │       ├── playback.rs               # Speaker output, PLC, mixer tick
│   │       ├── processing/               # Pipeline, gain, VAD, noise suppression
│   │       ├── codec/                    # Opus encoder/decoder
│   │       ├── buffer/                   # Adaptive jitter buffer
│   │       ├── mixer.rs                  # Multi-user audio mixer
│   │       └── diagnostics.rs            # Runtime metrics
│   ├── rushtalk-voice/                   # LiveKit integration (650+ LOC)
│   │   └── src/
│   │       ├── connection.rs             # WebRTC publish/subscribe
│   │       └── room.rs                   # VoiceRoom management
│   └── rushtalk-protocol/                # Shared types (350 LOC)
│       └── src/
│           ├── models.rs                 # Domain models
│           ├── events.rs                 # Event definitions
│           └── errors.rs                 # Error types
│
├── deploy/
│   ├── k8s/                              # Kubernetes manifests
│   ├── prometheus/                       # Monitoring configuration
│   └── livekit/                          # LiveKit server config
│
├── .github/workflows/
│   ├── ci.yml                            # Test pipeline (Go + Rust + Vitest)
│   └── release.yml                       # Multi-platform build + Docker push
│
├── docker-compose.yml                    # Local dev stack (7 services)
├── Makefile                              # Development commands
└── Cargo.toml                            # Rust workspace configuration

Audio Engine Deep Dive

The audio engine is the core differentiator of this project — a custom, low-latency audio pipeline built entirely in Rust.

TX (Transmit) Path

Microphone (cpal, 48kHz mono, 5ms buffers)
    │
    ▼
Raw PCM Ring Buffer (lock-free SPSC, 200ms capacity)
    │
    ▼
CaptureProcessor (dedicated thread, elevated priority)
    ├── High-pass filter (100Hz cutoff)
    ├── Noise suppression (configurable level)
    ├── Automatic Gain Control
    ├── Voice Activity Detection
    ├── Input volume scaling
    │
    ├──► LiveKit NativeAudioSource (PCM i16, WebRTC handles Opus internally)
    │
    └──► Opus Encoder (32kbps, adaptive FEC) → Encoded Ring Buffer

RX (Receive) Path

LiveKit NativeAudioStream (per remote participant)
    │
    ▼
RX Bridge Task (tokio, 10ms polling)
    │
    ▼
Decoded Audio Ring Buffer (lock-free SPSC, 64 packets)
    │
    ▼
PlaybackProcessor (dedicated thread, elevated priority)
    ├── Per-user frame accumulation
    ├── Packet Loss Concealment (repeat last frame, max 50ms)
    ├── Multi-user AudioMixer (time-based, 10ms ticks)
    ├── Stale user garbage collection (2s timeout)
    │
    ▼
Mixed PCM Ring Buffer (lock-free SPSC, 200ms capacity)
    │
    ▼
Speaker (cpal, 48kHz, volume scaling + deafen)

Performance Characteristics

Metric Value
End-to-end latency < 60ms (same region)
Frame size 480 samples (10ms @ 48kHz)
Hardware buffer 240 samples (5ms) when supported
Opus bitrate 32 kbps
Jitter buffer range 10–80ms (adaptive)
Hot-path allocations Zero (pre-allocated buffers)
Thread priority Max (via thread-priority crate)

Database Schema

16 tables across 3 migrations (310 lines of SQL):

-- Core
Users, UserOAuth, UserPresence, Sessions

-- Social
Servers, ServerMembers, ServerRoles, Friendships, Invites

-- Communication
Channels, ChannelOverwrites, Messages, Attachments, MessageReactions

-- Voice
VoiceRooms, VoiceParticipants

Permission system uses a 64-bit bitmask with role-based resolution and per-channel overwrites (allow/deny), computed entirely in memory — no DB round-trip for authorization checks.


Getting Started

Prerequisites

  • Rust 1.75+ (with cargo)
  • Go 1.24+
  • Node.js 22+ (with npm)
  • Docker & Docker Compose

Quick Start

# Clone the repository
git clone https://github.com/yourusername/rushtalk.git
cd rushtalk

# Start infrastructure (Postgres, Redis, MinIO, LiveKit, Prometheus, Grafana)
make dev-up

# Run database migrations
make migrate-up

# Start the Go API
cd apps/api && go run ./cmd/server

# Start the desktop app (in a new terminal)
cd apps/desktop && npm install && npm run tauri dev

Available Commands

make dev-up          # Start Docker services
make dev-down        # Stop Docker services
make dev-logs        # View service logs
make test            # Run all test suites (Go + Rust + Vitest)
make build-api       # Build Go API binary
make build-desktop   # Build Tauri desktop app
make migrate-up      # Run database migrations
make migrate-down    # Rollback migrations
make k8s-apply       # Deploy to Kubernetes

Testing

# All tests
make test

# Individual suites
cargo test -p rushtalk-audio -p rushtalk-protocol    # 22/22 pass
cd apps/api && go test -race ./...                    # All pass
cd apps/desktop && npm test                           # 12/12 pass
cd apps/desktop && npm run check                      # 0 errors, 504 files
Suite Framework Tests Status
Rust Audio cargo test 22 All passing
Go Backend go test (table-driven) All All passing
Frontend Vitest 12 All passing
Type Check svelte-check 504 files Zero errors

Deployment

Docker

# Build API image
docker build -t rushtalk-api -f apps/api/Dockerfile .

# Run full stack
docker-compose up -d

The API image uses a multi-stage build with a distroless runtime (~20 MB).

Kubernetes

# Apply manifests
make k8s-apply

# Includes:
# - Deployment with HPA (1-10 replicas, 70% CPU target)
# - Nginx Ingress with cert-manager TLS
# - Health checks (liveness + readiness probes)
# - Prometheus metrics endpoint

CI/CD

The GitHub Actions pipeline runs 3 parallel test suites on every push and PR. On version tags (v*), it builds:

  • Windows .exe installer
  • macOS .dmg (ARM64 + Intel)
  • Linux AppImage
  • Docker image pushed to GHCR

Configuration

Environment Variables (Backend)

Variable Description Default
DATABASE_URL PostgreSQL connection string postgres://...
REDIS_URL Redis connection string redis://localhost:6379
JWT_PRIVATE_KEY_PATH RS256 private key for signing keys/private.pem
JWT_PUBLIC_KEY_PATH RS256 public key for verification keys/public.pem
LIVEKIT_API_KEY LiveKit API key
LIVEKIT_API_SECRET LiveKit API secret
S3_ENDPOINT MinIO/S3 endpoint localhost:9000
CORS_ORIGINS Allowed CORS origins http://localhost:1420

Logs

Application logs are written to %APPDATA%/rushtalk/rushtalk.log (Windows) on release builds. In development, logs print to stdout.

Set RUST_LOG for granular control:

RUST_LOG=rushtalk=debug,rushtalk_audio=trace cargo tauri dev

Technical Decisions

Decision Choice Rationale
Audio codec Opus via audiopus 0.2 Industry standard for voice, adaptive FEC
Audio I/O cpal 0.15 Cross-platform (WASAPI/ALSA/CoreAudio)
Ring buffers rtrb (lock-free SPSC) Zero-allocation, real-time safe
Desktop framework Tauri 2.0 Smaller than Electron, native Rust backend
Frontend Svelte 5 Minimal runtime, reactive stores, fast
Backend framework Echo (Go) High performance, built-in middleware
Database driver pgx v5 Statement caching, connection pooling
Voice transport LiveKit Open-source SFU, handles TURN/STUN
Auth tokens JWT RS256 Stateless verification, secure refresh flow
Permissions 64-bit bitmask In-memory resolution, no DB round-trip
Release builds LTO + strip + codegen-units=1 Maximum optimization for production

License

MIT


Built with Rust, Go, Svelte, and a lot of audio engineering.

Top categories

Loading Svelte Themes