Home

Awesome

d-chat

Decentralized messaging app based on IPFS and OrbitDB with peer-to-peer web page hosting

React-based chat app POC that demonstrates advantages of a decentralized architecture in a web context. It can serve as a reliable communication platform thanks to the IPFS-based OrbitDB, a distributed, serverless, peer-to-peer database.

By running an IPFS node in the service worker and pulling the web pages' source there, the app itself can be a server and contibute to hosting the website. This, besides offering efficient scaling, improves reliability, since new users can still load the page when the origin server is not available.

<img src="https://user-images.githubusercontent.com/22678054/64920429-55854200-d7c0-11e9-94f7-4efa1ca0b179.png" height="350">

How does it work?

<img src="https://user-images.githubusercontent.com/22678054/64920632-9716ec80-d7c2-11e9-83ac-b57653555538.png" width="500">

Run on local

Install with: npm install

Build with: npm run build-local

Install any tool for serving statically the built directory e.g. npm install -g node-static

Run it using: static -p <port> and go to localhost:<port>/d-chat

Deploy

To deploy dynamic content:

For static content:

For the moment, the latter is recommended since IPNS discovery seems to time out frequently.

Potential simplified usage of IPFS for webapps

The whole burden of running an IPFS implementation for the app can be avoided if the users happen to have the IPFS browser extentsion installed or when natively IPFS-compatible browsers will be available. https://github.com/brave/brave-browser/issues/819