Skip to content
/ box Public
forked from keyvan-m-sadeghi/box

Client-server stack for Web3! Turn your Raspberry Pi to a NAS server in minutes and enjoy the freedom of decentralized Web with a superior user experience!

License

Notifications You must be signed in to change notification settings

kitty2121/box

 
 

Repository files navigation

example workflow

box

Client-server stack for Web3

Intro blog

Flagship App: Photos

client-server resemblance

box server demo

Motivation

There are currently two ways to interact with Web3 storage solutions:

  1. Through a pinning service and a gateway: the advantage is that files are served through URLs, an app can then access the files with conventional methods, e.g. simply putting a picture in <img src="gateway.example.com/Qm...">. The disadvantage is that there is a subscription payment associated with pinning services. Also this is not really decentralized!
  2. Turn the device to a full IPFS node: this model works beautifully in Brave desktop browser as an example, and makes sense for laptop and PC since they normally have large HDDs. It's much harder on mobile devices, however, biggest hurdle is to have Apple on board with the idea of relaxing file system access in iOS! Even if all goes well, a mobile device is NOT a good candidate for hosting the future Web! They get lost easily and are resource constrained (battery, memory).

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:

  • File Protocol: Send and receive files in a browser or an app (stage: prototype)
  • Data Protocol: Database interface over at client-side; facilitates describing linked JSON documents and having them saved/retrieved (stage: design draft)
  • AI Protocol: Map-Reduce stack for distributed processing (stage: ideation)

Architecture

box architecture

An app talks with the server(s) by invoking APIs from @functionland/graph library. The Graph library abstracts away the protocols and libp2p connection, instead exposes APIs similar to MongoDB for data persistance 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.

Packages

Name Description
protocols Libp2p protocols for the box stack
server Reference server implementation in Node.js
graph Client library for using the protocols from browser and react native
cli fx CLI for developers and sys admins

License

MIT

About

Client-server stack for Web3! Turn your Raspberry Pi to a NAS server in minutes and enjoy the freedom of decentralized Web with a superior user experience!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 74.5%
  • JavaScript 23.9%
  • HTML 1.6%