Rust implementation of NextGraph, a Decentralized and local-first web 3.0 ecosystem
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Niko PLP fd5c2a50e2 added rocksdb in readme 5 months ago
.github donation widget 1 year ago
ng-app fix windows build 6 months ago
ng-sdk-js automatic including of sdk in web app 6 months ago
ng-wallet rename some pazzle categories and implement logout 6 months ago
ngaccount added accept cookie on web version of BSP registration page 6 months ago
ngcli fix list-users 7 months ago
ngd fix broker choice when creating wallet on public BSP 6 months ago
ngone added dist.tar.gz in ngone 7 months ago
p2p-broker fix broker choice when creating wallet on public BSP 6 months ago
p2p-client-ws login 8 months ago
p2p-net added accept cookie on web version of BSP registration page 6 months ago
p2p-repo import wallet file 6 months ago
p2p-verifier reorganize crates 1 year ago
stores-lmdb switching to rocksdb as storage backend 7 months ago
stores-rocksdb new version of rocksdb + fs_Sync 7 months ago
.gitignore refactor log macros, ngd master key taken from args or file 9 months ago
Cargo.lock import wallet file 6 months ago
Cargo.toml import wallet file 6 months ago
LICENSE-APACHE2 full apache2 license 1 year ago
LICENSE-MIT cargo, nix flake and licenses 1 year ago added rocksdb in readme 5 months ago
package.json raname sdk to ng-sdk-js 9 months ago
pnpm-lock.yaml automatic including of sdk in web app 6 months ago
pnpm-workspace.yaml dev env is ready 9 months ago


Rust implementation of NextGraph

This repository is in active development at, a Gitea instance. For bug reports, issues, merge requests, and in order to join the dev team, please visit the link above and create an account (you can do so with a github account). The github repo is just a read-only mirror that does not accept issues.


NextGraph brings about the convergence between P2P and Semantic Web technologies, towards a decentralized, secure and privacy-preserving cloud, based on CRDTs.

This open source ecosystem provides solutions for end-users and software developers alike, wishing to use or create decentralized apps featuring: live collaboration on rich-text documents, peer to peer communication with end-to-end encryption, offline-first, local-first, portable and interoperable data, total ownership of data and software, security and privacy. Centered on repositories containing semantic data (RDF), rich text, and structured data formats like JSON, synced between peers belonging to permissioned groups of users, it offers strong eventual consistency, thanks to the use of CRDTs. Documents can be linked together, signed, shared securely, queried using the SPARQL language and organized into sites and containers.

More info here


Documentation can be found here

And our community forum where you can ask questions is here

How to use NextGraph

NextGraph is not ready yet. You can subscribe to our newsletter to get updates, and support us with a donation.

For developers

Read our getting started guide.

For contributors

until this PR is accepted, will have to install wasm-pack this way:

cargo install wasm-pack --git --rev c2b663f25abe50631a236d57a8c6d7fd806413b2
cargo install cargo-watch
// optionally, if you want a Rust REPL: cargo install evcxr_repl
git clone
// or if you don't have a git account: git clone
cd nextgraph-rs
cargo build


The crates are organized as follow :

  • p2p-repo : NextGraph repositories common library
  • p2p-net : P2P network common library
  • p2p-broker : the broker code (as server and core node)
  • p2p-client-ws : the client connecting to a broker with WebSocket, used by the apps and verifier
  • p2p-verifier : the code of the verifier
  • stores-lmdb : lmdb backed stores (not used anymore)
  • stores-rocksdb : RocksDB backed stores. see repo here
  • ngcli : CLI tool to manipulate the repos and administrate the server
  • ngd : binary executable of the daemon (that can run a broker, verifier and/or Rust services)
  • ng-wallet : keeps the secret keys of all identities of the user in a safe wallet
  • ng-sdk-js : contains the JS SDK, with example apps: web app, react app, or node service.
  • ng-app : all the native apps, based on Tauri, and the web app.
  • ngone : server for (helps user bootstrap into the right app)
  • ngaccount : server for nextgraph's Broker Service Provider account manager.


Build & run debug executables:

// runs the daemon
cargo run --bin ngd

// runs the client
cargo run --bin ngcli

For the web apps, see the README


Test all:

cargo test --all --verbose -- --nocapture

Test a single module:

cargo test --package p2p-repo --lib -- branch::test --nocapture

Test end-to-end client and server:

cargo test --package ngcli -- --nocapture

Test WASM websocket

cd ng-sdk-js
wasm-pack test --chrome --headless

Test Rust websocket

cargo test --package p2p-client-ws --lib -- remote_ws::test::test_ws --nocapture

Build release binaries

First you will need to have the production build of the frontend. If you do not want to setup a whole development environment for the frontend, you can use the precompiled release of the frontend available in dist-file.tar.gz

cd ng-app
tar -xzf dist-file.tar.gz
cd ..

Otherwise, build from source the single-file release of ng-app

npm install -g pnpm
cd ng-sdk-js
wasm-pack build --target bundler
cd ../ng-app
pnpm install
pnpm webfilebuild
cd ..

then build the ngd daemon

cargo build -r -p ngd

you can then find the binary ngd in target/release

The CLI tool can be obtained with :

cargo build -r -p ngcli

you can then use the binary target/release/ngcli

For usage, see the documentation here.

For building the apps, see this documentation.


On OpenBSD, a conflict between the installed LibreSSL library and the reqwest crate, need a bit of attention. Before compiling the daemon for OpenBSD, please comment out lines 32-33 of p2p-repo/Cargo.toml. This will be solved soon in a more appropriate way.

#[target.'cfg(target_arch = "wasm32")'.dependencies]
#reqwest = { version = "0.11.18", features = ["json","native-tls-vendored"] }

to use the app on OpenBSD, you need to run the daemon locally.

ngd -l 14400 --save-key

then open chrome (previously installed with doas pkg_add chrome)

env ENABLE_WASM=1 chrome --enable-wasm --process-per-site --new-window --app=http://localhost:14400

Generate documentation

Generate documentation for all packages without their dependencies:

cargo doc --no-deps

The generated documentation can be found in target/doc/<crate-name>.

Contributions license

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as below, without any additional terms or conditions.


Licensed under either of

SPDX-License-Identifier: Apache-2.0 OR MIT

NextGraph received funding through the NGI Assure Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 957073.