An app that allows you to do blogging, in a local first, p2p way.
This is the app you can interact with:
The CLI code is defined in ./cli.
Install from npm:
npm install @peerbit/blog -g
Launch it:
blog
Data will persist in /HOME_DIR/peerbit-blog-platform
To set a custom working directory
blog --directory DIRECTORY
To run from a local build, do the following:
First, navigate to ./cli:
yarn
yarn build
node ./lib/esm/bin.js
In the library folder, you can find all the code that handles file data. The CLI app uses this library to provide functionality.
To keep the state available for peers when only a few peers are online, you might want to host a dedicated server for this. With the Peerbit CLI, it looks something like this:
npm install -g @peerbit/server
peerbit remote spawn aws --count 1 --size medium --name "blog-platform"
Wait for the server to become ready, then do:
peerbit remote connect blog-platform-1
install @peerbit/blog-sdk
program open --variant blog-posts
Now, you have launched a server on your AWS account in the default region. This node will maintain whatever posts others have created and will be available when new peers want to read posts, but no others are online, except this server.
This package is not necessary to interact with the platform. It is just a demostration how you can wrap it with an Express server.
See ./server for more information.