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 (~4,700)
pnpm test
# Single package
pnpm --filter @xnetjs/sync test
pnpm --filter @xnetjs/data test
# Single file
pnpm --filter @xnetjs/sync vitest run src/clock.test.ts
# Watch mode
pnpm --filter @xnetjs/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 (@xnetjs/*)
crypto/ # BLAKE3, Ed25519, XChaCha20
identity/ # DID:key, UCAN tokens
storage/ # SQLite adapter
sync/ # Lamport clocks, Change<T>, Yjs security
data/ # Schema system, NodeStore, 15 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

If your change alters an architectural invariant — a protocol/wire contract, a package boundary, a security or trust rule, a storage or sync decision — add or supersede a record on the Architecture Decisions page in the same PR. Decisions are usually worked out first as an exploration in docs/explorations/; the ADR page is the distilled, immutable outcome.

CommandDescription
pnpm installInstall all dependencies
pnpm buildBuild all packages
pnpm testRun all tests
pnpm typecheckType check all packages
pnpm lintLint all packages
pnpm --filter @xnetjs/sync testTest a single package
pnpm --filter @xnetjs/sync test:watchWatch mode for a package