https://github.com/notebox/nb-crdt
A block based Conflict-free Replicated Data Type
https://github.com/notebox/nb-crdt
crdt nb-editor nbfm notebox typescript
Last synced: 5 months ago
JSON representation
A block based Conflict-free Replicated Data Type
- Host: GitHub
- URL: https://github.com/notebox/nb-crdt
- Owner: notebox
- License: agpl-3.0
- Created: 2024-04-23T05:00:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-23T07:28:16.000Z (about 2 years ago)
- Last Synced: 2025-10-10T04:15:05.875Z (8 months ago)
- Topics: crdt, nb-editor, nbfm, notebox, typescript
- Language: TypeScript
- Homepage: https://notebox.cloud
- Size: 193 KB
- Stars: 19
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# nb-crdt
[](https://codecov.io/gh/notebox/nb-crdt)
[](https://github.com/sponsors/notebox)
A block based Conflict-free Replicated Data Type that enables collaborative editing across multiple participants allowing for flexible data sharing across spreadsheets, boards, rich text, and more.
## Development
### Prerequisites
```
npm install
```
### Test
```
npm test
```
## Checkout Points
for synchronization, just investigate
- `domain/entity/block`
- `domain/entity/contribution`
for making an editor, all the interfaces you need are in
- `domain/usecase/replica`
## Key Concepts
- `replicaID`
- is an identifier for writers or devices
- `note`
- consists of `blocks`
- `block`
- `block-props`
- nested json object for block properties
- each leaf has its own stamp
- `replicaID`
- `timestamp`
- `text`
- consists of `spans`
- `span`
- `point`
- position identifier
- `content`
- `attrs`
- length
- `text-props`
- flat json object
- `stamp`
- string (UTF16)
- `version`
- per `replicaID`
- `block-props` version
- `text-points` or `DB_RECORD-point` version