| Crates.io | ankurah |
| lib.rs | ankurah |
| version | 0.5.4 |
| created_at | 2025-01-20 00:27:45.89721+00 |
| updated_at | 2025-08-06 17:56:02.38199+00 |
| description | Observable, event-driven state management for native and web |
| homepage | https://github.com/ankurah/ankurah |
| repository | https://github.com/ankurah/ankurah |
| max_upload_size | |
| id | 1523373 |
| size | 101,498 |
Ankurah is a state-management framework that enables real-time data synchronization across multiple nodes with built-in observability.
It supports multiple storage and data type backends to enable no-compromise representation of your data.
This project is in the early stages of development, and is not yet ready for production use.
cargo run -p ankurah-example-server
# or dev mode
cargo watch -x 'run -p ankurah-example-server'
cd examples/wasm-bindings
wasm-pack build --target web --debug
# or dev mode
cargo watch -s 'wasm-pack build --target web --debug'
cd examples/react-app
bun install
bun dev
Then load http://localhost:5173/ in one regular browser tab, and one incognito browser tab and play with the example app. You can also use two regular browser tabs, but they share one IndexedDB local storage backend, so it's not as good of a test. In this example, the "server" process is a native Rust process whose node is flagged as "durable", meaning that it attests it will not lose data. The "client" process is a WASM process that is also durable in some sense, but not to be relied upon to have all data. The demo server currently uses the sled backend, but postgres is also supported, and TiKV support is planned.
// Create server and client nodes
let server = Node::new_durable(Arc::new(SledStorageEngine::new_test()?), PermissiveAgent::new());
server.system.create()it?; // Initialize a new "system" - something you only do once on the first startup.
let server = server.context(c)?;
let client = Node::new(Arc::new(SledStorageEngine::new_test()?), PermissiveAgent::new());
// Connect nodes using local process connection
let _conn = LocalProcessConnection::new(&server, &client).await?;
client.system.wait_system_ready().await; // Wait for the client to join the server "system"
let client = client.context(c)?;
// Subscribe to changes on the client
let _subscription = client.subscribe::<_,_,AlbumView>("name = 'Origin of Symmetry'", |changes| {
println!("Received changes: {}", changes);
}).await?;
// Create a new album on the server
let trx = server.begin();
let album = trx.create(&Album {
name: "Origin of Symmetry".into(),
year: "2001".into(),
}).await?;
trx.commit().await?;
Ankurah follows an event-sourced architecture where:
For more details, see the repository documentation. And join the Discord server to be part of the discussion!