spacewave

package module
v0.53.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

README

Spacewave

Your own cloud, built for humans and agents

Private workspace that runs on your computers, syncs peer-to-peer, and keeps working offline.


Spacewave turns your computers into a local-first cloud you control. Start with a private workspace, use it from the browser or desktop app, sync it peer-to-peer, and keep working even when you are offline.

As your work grows, that workspace becomes a Space: shared encrypted state for files, notes, apps, layouts, devices, workflows, and plugin data without putting everything inside someone else's database.

People, apps, devices, and AI agents can all work against the same Space. That means automation can operate on durable state you can inspect, edit, share, and recover, instead of disappearing into a chat transcript.

Spacewave combines the convenience of cloud apps with the freedom of open-source software. The cloud can help with accounts, relay, backup, storage, and networking, but it does not become the owner of your work.

When you want to go deeper, Spacewave is also a full-stack for local-first apps and plugins, built with Go, TypeScript, React, and WebAssembly - a home for your personal operating system.

Features:

  • Spaces: Shared local-first state for files, apps, devices, and workflows
  • Peer-to-Peer Sync: Work offline and sync directly when peers are available
  • Human and Agent Ready: Give people, plugins, and AI agents the same durable state
  • Open-Source Full Stack: Build apps and plugins with Go, TypeScript, React, and WebAssembly
  • Pluggable Storage: Store data in local, browser, cloud, or self-hosted backends
  • End-to-End Encrypted: Keep storage, sync, and collaboration private by default

Plugin Ecosystem: Extend workspaces with community plugins:

  • File, database, code, and document collaboration
  • Chat, communications, forums, and messaging
  • Remote command and control of your devices
  • SkiffOS for running and managing Linux hosts
  • ...and more!

Getting Started

Where would you like to start?

You can try Spacewave instantly in your web browser, just click here.

Running from source

To start the Spacewave app:

# Install dependencies
bun install

# Start the desktop app
bun run start:desktop

# Start the web app with GoScript browser Go plugins
bun run start:web

# Start the web app with standard Go/WASM browser Go plugins
bun run start:web:wasm

To run the test suite:

# All tests
bun run test

# Go tests only
bun run test:go

# Lint
bun run lint

# Typecheck
bun run typecheck

Spacewave uses Protobuf for message encoding.

You should re-generate the protobufs after changing any .proto file:

# generate the protobufs
bun run gen

Why Spacewave?

Traditional web-apps store and process data on servers and cloud infrastructure. Developers write API calls to access the user data, and the frontend just displays the response. Recent trends towards server-side rendering have increased dependence on servers and the cloud even more.

This works great for static websites and services that require an internet connection. But what if we want apps that work offline, are open-source, or use features traditionally expensive to scale like multiplayer sync?

Imagine if every video game you played was rendered fully server-side. That game would be way too laggy to play smoothly, right? This is how our modern web apps are designed and built. But it doesn't have to be this way.

Modern web browsers come with WebAssembly, WebWorkers, ServiceWorkers, SharedWorkers, IndexedDB, and WebRTC. These features enable building fully self-sufficient apps running fully on the client side.

Spacewave utilizes these features to provide resources to apps with an abstraction layer smoothing the differences between platforms. For example, an app can allocate a SQL database and store it in Redis, BadgerDB, or IndexedDB, all without changing a single line of code when switching backends.

We look forward to building a new generation of apps that are both open-source and cloud-enabled, without requiring users to jump through hoops to self-host and manage their own servers.

Architecture

The goal is to build software that runs anywhere with any storage backend.

Spacewave runs the app logic in WebWorkers/SharedWorkers in the web browser and as native processes on desktop. This brings the entire Go ecosystem to the browser while enabling true local-first apps.

Components:

  • Bifrost - Network over any transport

    • Cross-platform peer-to-peer communication
    • Encrypted transport protocols with stream multiplexing
    • Supports WebRTC and WebSocket in the web browser
  • Hydra - Store data anywhere w/ p2p sync

    • Many supported data structures: SQL, K/V, GraphDB, ...
    • Pluggable storage backends: BadgerDB, Redis, S3, ...
    • Supports IndexedDB in the web browser
  • Bldr - Build and run on any OS or browser

    • Build system and development environment
    • Hot reload and fast JS bundling with esbuild and vite
    • Cross-platform build and release
  • GoScript - Compile Go to TypeScript for the web browser

    • Builds Go module packages into readable TypeScript modules
    • Shares Go algorithms, data structures, and runtime code without a second implementation
    • Powers Bldr's Go compiler mode for Spacewave web plugins and browser builds
  • SkiffOS - Build and run on any device (w/ Linux)

    • Supports 40+ device types
    • Cross-compiles to target any architecture
    • Minimal with modular configuration
  • Forge - Continuous integration and automation

    • Distributed job scheduler
    • CI/CD pipeline automation
    • Workflow orchestration
  • Auth - Authentication methods and credential flows

    • Password and PEM-based authentication primitives
    • Shared auth building blocks for provider and session flows
  • Identity - Identity and domain primitives

    • Identity records and domain-backed configuration
    • Supporting types for account and provider workflows

All components are designed to be used in multiple ways:

  • As an application: each component has its own CLI
  • As a library: all Go packages are documented as libraries
  • As part of Spacewave: controller configuration with YAML/JSON

Spacewave can be extended with custom plugins or modifications to the client, and custom apps can use the libraries to directly access the data stored in your workspaces.

The current repository is a monorepo. The root app layer sits alongside the component directories:

  • net/ - Bifrost
  • db/ - Hydra
  • bldr/ - Bldr
  • forge/ - Forge
  • auth/ - Auth
  • identity/ - Identity
  • app/, core/, sdk/, web/, cmd/ - the Spacewave application layer

Space: The Final Frontier

Let's take a moment to look far into the future. We're sending the first people to Mars. What OS are they using on their laptops and phones? What apps are they using to share files, collaborate, and communicate?

The latency of a one-way message from Mars to Earth varies between 2 to 24 minutes. HTTPs does not work with this much latency, and even begins to break with round-trip times over one second, let alone two minutes. Our existing internet apps would not work in this environment.

Spacewave solves this problem with a local-first p2p architecture. Regardless of internet latency or equipment failure, users can access their workspaces and apps, without the need for cloud, servers, or on-call engineers.

Peer-to-peer networking works even when the internet doesn't.

License

Spacewave is licensed under the permissive Apache-2.0 license.

All dependencies are verified to be equally permissive, one of:

  • 0BSD
  • Apache-2.0
  • Apache-2.0 OR MIT
  • BSD-2-Clause
  • BSD-3-Clause
  • CC0-1.0
  • ISC
  • MIT
  • MPL-2.0

All of these licenses support commercial use, modification, and redistribution with attribution.

Support and Community

Spacewave is a community project to build the most powerful collaborative workspace and self-hosting tool.

We welcome contributions in the form of GitHub issues and pull requests.

Please open a GitHub issue with any questions / issues / suggestions.

... or feel free to reach out via Email or Discord!

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MetaSources embed.FS

MetaSources contains docs, license files, etc.

Functions

func BuildMetaSourcesFSCursor

func BuildMetaSourcesFSCursor() *unixfs_iofs.FSCursor

BuildMetaSourcesFSCursor builds a *fs.Cursor for the MetaSources.

func BuildMetaSourcesFSHandle

func BuildMetaSourcesFSHandle(ctx context.Context, le *logrus.Entry) *unixfs.FSHandle

BuildMetaSourcesFSHandle builds a unixfs FSHandle for the MetaSources.

func GetLicense

func GetLicense() string

GetLicense returns the contents of the LICENSE file.

Types

This section is empty.

Directories

Path Synopsis
method/password
Package auth_method_password implements password-based entity key derivation using scrypt with a blake3-derived deterministic salt from the username.
Package auth_method_password implements password-based entity key derivation using scrypt with a blake3-derived deterministic salt from the username.
method/pem
Package auth_method_pem implements a PEM backup key auth method.
Package auth_method_pem implements a PEM backup key auth method.
cmd/bldr command
example/cli
Package example_cli provides example CLI commands for the bldr demo.
Package example_cli provides example CLI commands for the bldr demo.
plugin/host/logs
Package plugin_host_logs contains structured plugin log schema types.
Package plugin_host_logs contains structured plugin log schema types.
prototypes/sync-optimization command
test-gomod-compare: Tests whether comparing the generated go.mod with the existing file on disk can be used to skip go mod tidy + vendor.
test-gomod-compare: Tests whether comparing the generated go.mod with the existing file on disk can be used to skip go mod tidy + vendor.
prototypes/wasi command
util/logfile
Package logfile provides file-based logging for bldr via logrus hooks.
Package logfile provides file-based logging for bldr via logrus hooks.
util/tailwriter
Package tailwriter provides an io.Writer that forwards all writes to an inner writer while keeping the last N complete lines in a ring buffer.
Package tailwriter provides an io.Writer that forwards all writes to an inner writer while keeping the last N complete lines in a ring buffer.
util/wazerofs
Package wazerofs provides a simplified filesystem adapter that bridges UnixFS with the Wazero WebAssembly runtime's filesystem interface.
Package wazerofs provides a simplified filesystem adapter that bridges UnixFS with the Wazero WebAssembly runtime's filesystem interface.
values
package bldr_values contains value types that are injected to the target binary.
package bldr_values contains value types that are injected to the target binary.
web
cmd
changelog-gen command
changelog-notes command
plugin-release command
spacewave command
spacewave-debug command
spacewave-dev command
spacewave/cli
Package spacewave_cli provides CLI commands for the spacewave CLI binary.
Package spacewave_cli provides CLI commands for the spacewave CLI binary.
core
cdn
debug/trace
Package debug_trace serves Go runtime trace and pprof data via HTTP.
Package debug_trace serves Go runtime trace and pprof data via HTTP.
e2e
forge/dashboard
Package forge_dashboard implements the ForgeDashboard block type and world operations.
Package forge_dashboard implements the ForgeDashboard block type and world operations.
git
plugin/process
Package process_binding provides CRUD helpers for process bindings in the platform-account ObjectStore.
Package process_binding provides CRUD helpers for process bindings in the platform-account ObjectStore.
plugin/webview
Package plugin_webview provides conventions for plugin ObjectType web viewer registration.
Package plugin_webview provides conventions for plugin ObjectType web viewer registration.
provider/gccleanup
Package provider_gccleanup runs provider account GC cleanup sweeps.
Package provider_gccleanup runs provider account GC cleanup sweeps.
provider/spacewave/cacheseed
Package provider_spacewave_cacheseed provides the dev-only cache-seed inspector RPC service.
Package provider_spacewave_cacheseed provides the dev-only cache-seed inspector RPC service.
provider/spacewave/cacheseedbuffer
Package cacheseedbuffer owns bounded recording of seed-reason-tagged HTTP requests.
Package cacheseedbuffer owns bounded recording of seed-reason-tagged HTTP requests.
provider/spacewave/packfile/delta
Package delta builds incremental packfile uploads from a writable block store by diffing against a CDN mirror view and chunking the delta into size-bounded kvfile packs.
Package delta builds incremental packfile uploads from a writable block store by diffing against a CDN mirror view and chunking the delta into size-bounded kvfile packs.
provider/spacewave/packfile/order
Package order contains packfile block ordering helpers.
Package order contains packfile block ordering helpers.
provider/spacewave/seedreason
Package seedreason owns the HTTP seed-reason taxonomy used to classify provider cloud requests.
Package seedreason owns the HTTP seed-reason taxonomy used to classify provider cloud requests.
resource/listener/control
Package control implements the local daemon control protocol that backs spacewave stop and socket takeover between the CLI daemon and the desktop app's resource listener.
Package control implements the local daemon control protocol that backs spacewave stop and socket takeover between the CLI daemon and the desktop app's resource listener.
resource/listener/yieldpolicy
Package yieldpolicy implements the yield-policy broker used by the desktop resource listener.
Package yieldpolicy implements the yield-policy broker used by the desktop resource listener.
session/lock
Package session_lock provides shared lock/unlock operations for session private keys.
Package session_lock provides shared lock/unlock operations for session private keys.
space/http/download
Package download serves projected space file content via HTTP.
Package download serves projected space file content via HTTP.
space/http/export
Package export serves projected space data via HTTP zip routes.
Package export serves projected space data via HTTP zip routes.
space/http/header
Package header provides shared HTTP header helpers for space HTTP handlers.
Package header provides shared HTTP header helpers for space HTTP handlers.
space/resolve
Package resolve provides utilities for resolving resource paths to world engines.
Package resolve provides utilities for resolving resource paths to world engines.
db
block
Package block defines a common pattern for interacting with block reference structures in Hydra and in memory.
Package block defines a common pattern for interacting with block reference structures in Hydra and in memory.
block/copy
Package block_copy provides functions for copying block DAGs between stores.
Package block_copy provides functions for copying block DAGs between stores.
block/gc
Package block_gc implements garbage collection for Hydra block stores.
Package block_gc implements garbage collection for Hydra block stores.
block/gc/gcgraph
Package gcgraph implements the GC reference graph on OPFS.
Package gcgraph implements the GC reference graph on OPFS.
cdc/jc
Package jc implements the JC (Jump Condition) content-defined chunking algorithm.
Package jc implements the JC (Jump Condition) content-defined chunking algorithm.
cli
cmd/hydra command
dex
dex/session
Package dex_session provides shared block transfer session logic for DEX backends.
Package dex_session provides shared block transfer session logic for DEX backends.
git
git/unixfs
Package unixfs_git implements a git-backed FSCursor.
Package unixfs_git implements a git-backed FSCursor.
kvtx/block/iavl
Package iavl implements a iavl tree.
Package iavl implements a iavl tree.
kvtx/hidalgo
Package hidalgo implements the high-level database abstractions for Go interfaces for kvtx.
Package hidalgo implements the high-level database abstractions for Go interfaces for kvtx.
kvtx/kvfile
Package kvtx_kvfile implements a key/value store backed by a file.
Package kvtx_kvfile implements a key/value store backed by a file.
sql
NewSqlDb wraps a SqlStore in a stdlib *sql.DB handle.
NewSqlDb wraps a SqlStore in a stdlib *sql.DB handle.
sql/mock
Package sql_mock exercises a SqlStore through the stdlib high-level *sql.DB API (sql.Tx, sql.Rows.Scan), which pulls reflect via convert.go.
Package sql_mock exercises a SqlStore through the stdlib high-level *sql.DB API (sql.Tx, sql.Rows.Scan), which pulls reflect via convert.go.
sql/mysql/gormadapter
Package gormadapter bridges a Mysql transaction to a gorm instance.
Package gormadapter bridges a Mysql transaction to a gorm instance.
store/kvkey
Package store_kvkey provides common key patterns for key/value stores.
Package store_kvkey provides common key patterns for key/value stores.
store/kvtx/sqlite/common
Package common provides shared implementations for SQLite kvtx stores.
Package common provides shared implementations for SQLite kvtx stores.
traceutil
Package traceutil wraps runtime/trace so callers compile under TinyGo, which lacks the runtime/trace package; the TinyGo build provides no-op equivalents.
Package traceutil wraps runtime/trace so callers compile under TinyGo, which lacks the runtime/trace package; the TinyGo build provides no-op equivalents.
tx
unixfs/errors
Package unixfs_errors contains common error definitions.
Package unixfs_errors contains common error definitions.
unixfs/plan9fs
Package plan9fs implements a 9p2000.L filesystem server binding to hydra's FSCursor/FSHandle interfaces.
Package plan9fs implements a 9p2000.L filesystem server binding to hydra's FSCursor/FSHandle interfaces.
unixfs/tar
Package unixfs_tar implements a read-only FSCursor backed by a tar archive.
Package unixfs_tar implements a read-only FSCursor backed by a tar archive.
volume/js/opfs/blockshard
Package blockshard implements a sharded block store engine backed by immutable SSTable segment files with per-shard manifests.
Package blockshard implements a sharded block store engine backed by immutable SSTable segment files with per-shard manifests.
volume/js/opfs/metashard
Package metashard is implemented for JS builds.
Package metashard is implemented for JS builds.
volume/js/opfs/pagestore
Package pagestore implements a B+tree key-value store using fixed-size pages with copy-on-write commits and dual superblocks.
Package pagestore implements a B+tree key-value store using fixed-size pages with copy-on-write commits and dual superblocks.
volume/js/opfs/segment
Package segment implements a sorted-string table (SSTable) binary format for key-value storage.
Package segment implements a sorted-string table (SSTable) binary format for key-value storage.
Package dev provides the spacewave-dev command surface for downstream applications that build on spacewave.
Package dev provides the spacewave-dev command surface for downstream applications that build on spacewave.
e2e
drivebench
Package drivebench owns the run.json artifact schema shared by the Drive startup benches.
Package drivebench owns the run.json artifact schema shared by the Drive startup benches.
electron
Package electron provides an opt-in Electron E2E harness backed by the existing Bldr desktop runtime.
Package electron provides an opt-in Electron E2E harness backed by the existing Bldr desktop runtime.
wasm
Package wasm provides a Go test harness that boots the real bldr start:web:wasm lifecycle and exposes the running app for e2e testing.
Package wasm provides a Go test harness that boots the real bldr start:web:wasm lifecycle and exposes the running app for e2e testing.
wasm/memlab
Package memlab provides heap snapshot capture via Chrome DevTools Protocol and analysis via @memlab/heap-analysis for memory leak detection in e2e tests.
Package memlab provides heap snapshot capture via Chrome DevTools Protocol and analysis via @memlab/heap-analysis for memory leak detection in e2e tests.
cli
cmd/forge command
job
lib/v86/wazero/usernet
Package usernet implements a small usermode L2 network stack for v86 guests.
Package usernet implements a small usermode L2 network stack for v86 guests.
net
cli
cmd/bifrost command
crypto
Package crypto implements cryptographic key utilities for bifrost.
Package crypto implements cryptographic key utilities for bifrost.
crypto/tls
Package p2ptls provides TLS identity for bifrost peer authentication.
Package p2ptls provides TLS identity for bifrost peer authentication.
examples/mesh-chat command
mesh-chat demonstrates decentralized peer-to-peer messaging.
mesh-chat demonstrates decentralized peer-to-peer messaging.
rpc
sim/graph
Package graph and sub-packages contain a virtual representation of a graph of connected networks and nodes.
Package graph and sub-packages contain a virtual representation of a graph of connected networks and nodes.
plugin
prototypes
bench-storage
Package benchstorage contains browser-oriented storage benchmarks.
Package benchstorage contains browser-oriented storage benchmarks.
git-clone-test command
opfs/bench
Package bench contains OPFS storage benchmarks for browser WASM.
Package bench contains OPFS storage benchmarks for browser WASM.
opfs/go-opfs
Package opfs provides Go wrappers for the Origin Private File System browser API.
Package opfs provides Go wrappers for the Origin Private File System browser API.
opfs/store
Package store implements a kvtx.Store backed by OPFS flat files.
Package store implements a kvtx.Store backed by OPFS flat files.
sdk
apt
Package s4wave_apt implements apt repository block types and world operations.
Package s4wave_apt implements apt repository block types and world operations.
cdn
forge/world
Package s4wave_forge_world registers Forge ObjectTypes in the Space World.
Package s4wave_forge_world registers Forge ObjectTypes in the Space World.
git
org
sql
sshhost
SSH host-key trust pins parse and fingerprint authorized_keys via golang.org/x/crypto/ssh, which pulls reflect through its wire codec.
SSH host-key trust pins parse and fingerprint authorized_keys via golang.org/x/crypto/ssh, which pulls reflect through its wire codec.
vm
Package s4wave_vm implements the VM block types and world operations.
Package s4wave_vm implements the VM block types and world operations.
vm/world
Package s4wave_vm_world registers VM ObjectTypes in the Space World.
Package s4wave_vm_world registers VM ObjectTypes in the Space World.
web

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL