Skip to content

Getting Started

  • Node.js 18+ (LTS recommended)
  • pnpm 9+ (npm install -g pnpm)
  • Git
Terminal window
git clone https://github.com/crs48/xNet.git
cd xNet
pnpm install
Terminal window
pnpm build

This builds all packages in dependency order (crypto → identity → storage → sync → data → react → etc.).

Terminal window
# All tests (~350)
pnpm test
# Single package
pnpm --filter @xnet/sync test
pnpm --filter @xnet/data test
# Single file
pnpm --filter @xnet/sync vitest run src/clock.test.ts
# Watch mode
pnpm --filter @xnet/sync test:watch
Terminal window
pnpm typecheck
Terminal window
pnpm lint
Terminal window
cd apps/electron && pnpm dev

This starts the Vite dev server, signaling server, and Electron app. The app is available at http://localhost:5177 for debugging.

Terminal window
cd apps/electron && pnpm dev:both

Launches two Electron windows connected to the same signaling server for testing real-time sync.

packages/ # Core libraries (@xnet/*)
crypto/ # BLAKE3, Ed25519, XChaCha20
identity/ # DID:key, UCAN tokens
storage/ # IndexedDB adapter
sync/ # Lamport clocks, Change<T>, Yjs security
data/ # Schema system, NodeStore, 16 property types
react/ # useQuery, useMutate, useNode hooks
plugins/ # 4-layer plugin system
canvas/ # Infinite canvas with spatial indexing
editor/ # TipTap rich text editor
network/ # libp2p, WebRTC, peer security
devtools/ # Debug panels (7 panels)
apps/
electron/ # Desktop app (full features)
web/ # PWA (pages only)
site/ # Documentation site (Astro + Starlight)
  1. Create a feature branch from main
  2. Make changes in the relevant package(s)
  3. Run tests for affected packages
  4. Run pnpm typecheck and pnpm lint
  5. Commit with a descriptive message following conventional commits
  6. Open a pull request
CommandDescription
pnpm installInstall all dependencies
pnpm buildBuild all packages
pnpm testRun all tests
pnpm typecheckType check all packages
pnpm lintLint all packages
pnpm --filter @xnet/sync testTest a single package
pnpm --filter @xnet/sync test:watchWatch mode for a package