dignity.js 0.5.4 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,8 +6,8 @@
6
6
  [![npm version](https://img.shields.io/npm/v/dignity.js?color=cb3837&label=npm)](https://www.npmjs.com/package/dignity.js)
7
7
  [![npm downloads](https://img.shields.io/npm/dm/dignity.js?color=blue)](https://www.npmjs.com/package/dignity.js)
8
8
  [![CI](https://github.com/jose-compu/dignity.js/actions/workflows/ci.yml/badge.svg)](https://github.com/jose-compu/dignity.js/actions/workflows/ci.yml)
9
- ![tests](https://img.shields.io/badge/tests-150%2B%20passing-brightgreen)
10
- ![coverage](https://img.shields.io/badge/coverage-99%25-brightgreen)
9
+ ![tests](https://img.shields.io/badge/tests-213%2B%20passing-brightgreen)
10
+ ![coverage](https://img.shields.io/badge/coverage-92%25-brightgreen)
11
11
  ![license](https://img.shields.io/badge/license-Apache%202.0-black)
12
12
 
13
13
  REST-like P2P object API for decentralized JavaScript applications.
@@ -41,6 +41,10 @@ REST-like P2P object API for decentralized JavaScript applications.
41
41
  npm install dignity.js
42
42
  ```
43
43
 
44
+ ## Tutorial
45
+
46
+ **New to dignity.js?** Start with [TUTORIAL.md](./TUTORIAL.md) — eight short lessons from two in-memory peers to browser PeerJS and PeerGroup spectators. The [docs site tutorial](https://jose-compu.github.io/dignity.js/#tutorial) covers the same path.
47
+
44
48
  ## Quick Start
45
49
 
46
50
  ```js
@@ -120,6 +124,24 @@ await node.create('matches', { mode: 'coop' }, {
120
124
 
121
125
  Peers with a different password for `coop:red` cannot decrypt that broadcast traffic.
122
126
 
127
+ ## PeerGroup Gossip (scalable PubSub)
128
+
129
+ For high-fanout object updates (millions of subscribers per published object), use multiplexed gossip groups. Each peer keeps a bounded number of active transports (`maxActivePeers` per group, `globalMaxOpenConnections` per node).
130
+
131
+ ```js
132
+ // Follow 200 accounts = 200 joined groups, few connections each
133
+ await node.joinPeerGroup('feed:alice', {
134
+ bootstrapPeerIds: ['publisher-peer-id'],
135
+ fanout: 3,
136
+ maxActivePeers: 8
137
+ });
138
+
139
+ await node.publishRecordToPeerGroup('feed:alice', 'posts', 'post-1');
140
+ await node.leavePeerGroup('feed:alice');
141
+ ```
142
+
143
+ Small collaborations (chess players, document co-editing) should keep using direct `connectToPeers` mesh. Large read-only audiences (chess spectators, public timelines) should use PeerGroup gossip. See the [docs PeerGroup section](https://jose-compu.github.io/dignity.js/#peer-groups).
144
+
123
145
  ## Room / Team Discovery
124
146
 
125
147
  Use scoped discovery to find active peers in a room (for example `main`, `team:red`, `raid-42`).
@@ -360,7 +382,7 @@ If 4173 is busy, `docs:dev` auto-picks the next free port (4174, 4175, …) and
360
382
 
361
383
  - **Documentation:** [jose-compu.github.io/dignity.js](https://jose-compu.github.io/dignity.js/)
362
384
  - Docs site source: `docs/index.html` (local: `npm run docs:dev`)
363
- - **3D Chess demo:** `docs/chess/` → [local chess demo](http://127.0.0.1:4173/chess/) when `docs:dev` is running
385
+ - **3D Chess demo:** `docs/chess/` — PeerJS mesh, dual-signed resume links, IndexedDB → [local chess demo](http://127.0.0.1:4173/chess/) when `docs:dev` is running
364
386
  - API metadata: `docs/openapi-like.json`
365
387
  - Minimal demos:
366
388
  - `examples/decentralized-tictactoe.js`