Skip to content

IADev-Channel/zuno

Zuno Logo

Zuno

Universal, event-driven state synchronization with strong consistency.

Client, server, and multiple runtimes — perfectly in sync.


Zuno is a distributed state engine built on a simple premise:

"State is not local — it is distributed, versioned, and observable."

It ensures that every mutation across your ecosystem (tabs, background workers, node servers, even different runtimes like Bun or Elysia) is deterministic and consistent.

🚀 Key Features

  • ⛓️ Deterministic Ordering: Versioned events prevent stale overwrites and race conditions.
  • 🔄 Multi-Runtime Sync: Seamlessly sync state between Browser Tabs, Node.js, Express, and Elysia.
  • 📡 Lightweight Transport: Uses SSE (Server-Sent Events) and BroadcastChannel for low-latency, proxy-friendly updates. No WebSocket complexity or lock-in.
  • ⚛️ React Ready: First-class support for React with deep useSyncExternalStore integration.
  • 🔌 Thin Adapters: Transparent, lightweight adapters for your favorite frameworks.

📦 Monorepo Packages

Package Purpose Docs
@iadev93/zuno Core state engine & sync primitives README
@iadev93/zuno-react React hooks & state bindings README
@iadev93/zuno-express Server adapter for Express README
@iadev93/zuno-elysia Server adapter for Elysia (Bun) README

🏎️ Quick Start

1. Define your store (Client)

import { createZuno } from "@iadev93/zuno";

const zuno = createZuno();
export const counter = zuno.store("counter", () => 0);

// Use it anywhere!
await counter.set(v => v + 1);

2. Connect to React

import { createZunoReact } from "@iadev93/zuno-react";

// Use the React-enhanced instance
const zuno = createZunoReact();
const counter = zuno.store("counter", () => 0);

function Counter() {
  const value = counter.use();
  return <button onClick={() => counter.set(v => v + 1)}>{value}</button>;
}

3. Sync with Server (Express)

import express from "express";
import { createZunoExpress } from "@iadev93/zuno-express";

const app = express();
const zuno = createZunoExpress();

app.get("/zuno/sse", zuno.sse);
app.post("/zuno/sync", zuno.sync);
app.get("/zuno/snapshot", zuno.snapshot);

app.listen(3000);

📖 Deep Dive


🛠️ Development

This is a monorepo powered by pnpm.

pnpm install
pnpm build

📄 License

MIT © Ibrahim Aftab

About

Universal State Management

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published