molekilla / y-fdp-storage-demo-app

demo app

Home Page:https://y-fdp-storage-demo-app.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

y-fdp-storage demo app

How to execute demo app

Untitled_.Mar.24.2023.10_32.AM.webm
  1. Configure environment variables in a .env file and then run fdp-play. If you need a postage stamp, run unit tests found in y-fdp-storage and enable postage stamps seed in jest setup.
# example
REACT_APP_BEE_URL=http://localhost:1633
REACT_APP_BEE_POSTAGE=1c082c5e642e15d49b6689f5437c2eb9e6aa9c546a8ed1d11d0024b043bca371
  1. Install demo with npm i
  2. Run react app with npm run start
  3. Open http://localhost:3000 in two different tabs
  4. Fill in Private Key and Document Name value and click Connect
  5. Write anything in text editor
  6. Wait a few seconds and watch editors being synchronized

How it works

y-fdp-storage uses Yjs as CRDT sync mechanism while storing data in Swarm using a Swarm Sequence Feed. To grab the latest updates, y-fdp-storage long-polls setLastUpdate on the sequence feeds and auto updates inside a setInterval to the swarm feed.

Requirements

A fdp-play environment or a Bee RPC url plus its batch id.

About

demo app

https://y-fdp-storage-demo-app.vercel.app


Languages

Language:TypeScript 60.3%Language:HTML 25.8%Language:CSS 13.9%