Client-server stack for Web3
There are currently two ways to interact with Web3 storage solutions:
<img src="https://github.com/functionland/fula-archived/raw/main/gateway.example.com/Qm...">
. The disadvantage is that there is a subscription payment associated with pinning services. Also this is not really decentralized!box aims to address these issues by creating a third alternative: Personal Server
A personal server is a commodity hardware (PC, Raspberry Pi, etc.) that's kept at home vs. in pocket. It helps with actual decentralization, also saves money since people pay once for HDDs and own them forever, no monthly charge! From privacy perspective, it guarantees that data doesn't leave the premise unless user specifically wants to (e.g. sharing).
To achieve this, we are developing protocols to accommodate client-server programming with minimal effort on developer's side:
An app talks with the server(s) by invoking APIs from @functionland/fula
library. The Fula library abstracts away the protocols and libp2p
connection, instead exposes APIs similar to MongoDB for data persistence and S3 for file storage.
On the server side, data or file will be saved on a private IPFS instance. There is also a public IPFS instance which comes to play in sharing: when the end user requests to share some data, an encrypted copy will be saved on the public IPFS network, anyone with whom the key has been shared can access the data.
The box stack can provide backup guarantees by having the data pinned on multiple servers owned by the user. However, in cases that the user needs absolute assurance on data longevity, e.g. password records in a password manager app or scans of sensitive documents, the encrypted data can be sent over at Filecoin blockchain.
Name | Description |
---|---|
protocols | Libp2p protocols for the box stack |
server | Reference server implementation in Node.js |
fula | Client library for using the protocols from browser |
rn-fula | Client library ported for react native |
Name | Description |
---|---|
react | Example of using fula client and box server |
react-native | Example of using fula client in react-native and box server |
To get started in development with this monorepo use the following steps.
$ rush update && rush build
$ cd apps/box && rushx start
$ cd examples/react-cra && rushx start
$ cd examples/react-do-app && rushx start
$ docker-compose -f docker-compose.dev.yaml up
Open a browser and navigate to http://localhost:3000
and http://localhost:3001