Skip to content

rivet-gg/rivet

Folders and files

NameName
Last commit message
Last commit date
Nov 13, 2024
Jan 5, 2025
Jun 21, 2023
Oct 29, 2024
Jan 5, 2025
Jan 5, 2025
Jan 3, 2025
Jan 5, 2025
Jan 2, 2025
Jan 5, 2025
Jan 5, 2025
Jan 5, 2025
Jan 5, 2025
Jun 16, 2023
Nov 27, 2024
Oct 17, 2024
Mar 15, 2024
Jun 4, 2024
Jan 5, 2025
Jan 5, 2025
Dec 23, 2024
Jan 5, 2025
Jan 5, 2025
Jun 16, 2023
Jan 5, 2025
Jan 2, 2025
Dec 20, 2024
Jan 5, 2025
Oct 24, 2024
Mar 15, 2024
Jan 24, 2024
Jan 5, 2025

Repository files navigation

Rivet

Run and scale realtime applications
Rivet Actors have built-in RPC, state, and events β€” the easiest way to build modern applications.

License Apache-2.0 GitHub commit activity GitHub Discussions Discord

Code snippets

Features

Rivet Actors

  • Remote Procedure Calls: Create cross-application function calls with minimal code overhead.
  • State: Automatically manage and persist your data with built-in state handling.
  • Events: Manage real-time state changes using integrated pub/sub messaging.
  • Scaling & Concurrency: Actors scale automatically to cover regions and process needs.
  • Edge Networking: Automatically distribute your applications to global edge locations.

Learn more about actors here.

Infrastructure

  • Runs globally near your users: Minimize latency with actors created in regions closest to your users.
  • Scales to zero: Handle millions of connections with low latency and high-throughput writes while saving costs through instant actor sleep/wake cycles.
  • Built-in monitoring: Includes monitoring out of the box.
  • Supports data localization: Store data in designated locations to meet data localization compliance requirements.
  • Powered by V8 isolates & Deno runtime: Faster, cheaper, and more lightweight than lambda functions & containers.
  • Supports both isolates & containers: Run your code on V8 isolates or run things like Godot/Unity game servers or video encoding in containers.
  • Built with technologies you can trust: Rust, FoundationDB, the Rivet workflow engine, and Rivet orchestrator make Rivet delightfully boring to use.

Use cases

  • Collaborative applications
  • Local-first apps
  • AI agents
  • Discord Activities
  • Game Servers
  • Chat Apps
  • Yjs Sync & Storage
  • Run Untrusted User Code

Quickstart

Install CLI

Install the CLI on your machine in order to create & deploy Rivet Actors.

macOS & Linux & WSL
curl -fsSL https://releases.rivet.gg/rivet/latest/install.sh | sh

Next, follow the setup guide.

Windows (cmd)
powershell -Command "iwr https://releases.rivet.gg/rivet/latest/install.ps1 -useb | iex"

Next, follow the setup guide.

Windows (PowerShell)
iwr https://releases.rivet.gg/rivet/latest/install.ps1 -useb | iex

Next, follow the setup guide.

Build from source (cargo build)
git clone https://github.com/rivet-gg/rivet
cargo build --bin rivet

The executable will be available at target/debug/rivet.

Next, follow the setup guide.

Single-node cluster

Run a single-node Rivet instance for developing your applications locally.

docker run

Start a Rivet cluster:

docker run --name rivet -v "$(pwd)/rivet-data:/data" -p 8080:8080 -p 9000:9000 -p 7080:7080 -p 7443:7443 --platform linux/amd64 rivetgg/rivet

Next, follow the setup guide.

docker run with TCP & UDP

Start a Rivet cluster with TCP & UDP enabled:

docker run --name rivet -v "$(pwd)/rivet-data:/data" -p 8080:8080 -p 9000:9000 -p 7080:7080 -p 7443:7443 -p 7500-7599:7500-7599 -p 7600-7699:7600-7699 --platform linux/amd64 rivetgg/rivet

Next, follow the setup guide.

Integrate in to your Docker Compose

Integrate in to an your existing project's Docker Compose with:

services:
  rivet:
    image: rivetgg/rivet
    platform: linux/amd64
    volumes:
      - rivet-data:/data
    ports:
      - "8080:8080"
      - "9000:9000"
      - "7080:7080"
      - "7443:7443"
      # Optional: Rivet Guard TCP & UDP
      - "7500-7599:7500-7599"
      # Optional: Host networking TCP & UDP
      - "7600-7699:7600-7699"

volumes:
  rivet-data:

Next, follow the setup guide.

Developing Rivet

Compile Rivet from scratch and start a full cluster.

Docker Compose

Build & start the cluster with:

docker compose -f docker/dev-full/docker-compose.yml up -d --build

Then visit http://localhost:8080 in your browser.

Self-hosting & manual deployment

Read our self-hosting documentation.

Rivet Cloud

Rivet Cloud is the fastest, most affordable, and most reliable way to deploy Rivet Actors with zero infrastructure maintenance. Get started at hub.rivet.gg.

Rivet Enterprise

Get a demo, tailored pricing to fit your needs, or have your questions answered about Rivet. Contact us here.

Documentation

Community & Support

Architecture

Core technologies

  • Rust
  • V8 & Deno: Actor isolate runtime
  • FoundationDB: Actor state
  • CockroachDB: OLTP
  • ClickHouse: Developer-facing monitoring
  • Valkey: Caching
  • NATS: Pub/sub
  • Traefik: Load balancers & tunnels

Diagram

Architecture

Project layout

docker/                      Docker-related files
    client/                  Client image
    dev-full/                Full development environment setup
    monolith/                Monolithic Docker setup
    server/                  Server image
docs/                        Documentation
docs-internal/               Internal documentation
examples/                    Example projects
packages/                    Project packages
    api/                     API package
    common/                  Common utilities
    infra/                   Infrastructure-related code
    services/                Service implementations
    toolchain/               Toolchain-related code
resources/                   Resource files
scripts/                     Scripts for various tasks
sdks/                        SDKs
    actor/                   Actor SDK
    api/                     API SDK

License

Apache 2.0