boilerplate for swarmlog-connected webapps
basically just a cobbled-together mush of substack's views (as received) on life, the internet, and everything, in code form. let's all be hyperminimalist hackertrons.
no but seriously, i needed to find a calm place with web frontend technology and decentralization. this is that place.
npm install -g signalhub
signalhub listen -p 8080
- start another terminal sesh
npm start
(also inits a keypair)- start another terminal sesh
npm run serve-broadcaster
this gets you to a couple of swarmlog peers, one of which pushes data once per second and runs in a headless electron session. the other one runs in your browser and reactively updates with new data from the swarmlog, including data you input through a text box.
checkout the "bootable" branch to see how it works. substack is changing hyperboot pretty quickly, but you can ship a bundled webapp with the current version like so:
npm install -g hyperboot
cd src
browserify -d index.js > bundle.js
- bump the
<meta>
version tag in index.html html-inline index.html > app.html
- modify the bundled copy of the GSS engine as detailed in gss#206 so your browser can parse it
hyperboot commit app.html
- serve the
./hyperboot
directory:ecstatic --cors -p 8000 .hyperboot
a working example is in the bootable
branch, under the ./hyperboot
directory. you can also pull the bundled app from
this gist and test with
hyperboot alone.
- UI
- main-loop: fast app state updater
- virtual-dom: virtual DOM without extra junk
- virtual-hyperscript: because HTML is tiring/tired
- GSS: constraint-based styling
- Data
- level-browserify: bundled levelup and leveldown
- subleveldown: 'namespaced' sub-levels
- hyperkv: p2p key-value store that wraps around a hyperlog
- swarmlog: p2p webrtc-based hyperlog
- memdb: easy to use in-memory DB for testing
- Crypto
- Shippin
- html-inline: bundles HTML
src
directives into inline content - hyperboot: versioned webapp bootloader with offline storage
- html-inline: bundles HTML
i'm not planning on adding a router, but if you need a minimal one, something trie-based might be cool.
- hook up hyperkv
- stub controls
- input+put
- add stream multiplexing (multiplexing!) w/ dataplex
- add simple gss styling
- build hyperbooted version