How to write your fist decentralized "facebook feeds" app on blockstack

in blockchain •  7 years ago 

Multi-player Storage Tutorial
In this tutorial, we're going to build a decentralized micro-blogging application using multi-player Gaia storage.

This app will be a React.js application that is completely decentralized and server-less. Identity and storage services will be provided by blockstack.js

The app will be able to do the following:

Authenticate users using Blockstack
Post new statuses
Display statuses in the user profile
Lookup other users and see their profile and statuses

We will be using the following tools:

npm to manage dependencies and scripts
yo to generate boilerplate for a Blockstack React app
blockstack.js to authenticate the user and access Gaia storage
For experienced Blockstack developers, the TL;DR:

Add the publish_data scope to sign in requests

Use getFile('filename.json', { username: 'username.id' }) to read a file from another user
Use lookupProfile('username.id') to lookup user profiles
Use putFile('filename.json', file) as before
Installation & Generation
First, install Yeoman along with the Blockstack App Generator:

npm install -g yo generator-blockstack

Next, create a directory for our application. We will call our app Publik:

mkdir publik && cd publik

Then, use the Blockstack React App Generator to generate a simple Blockstack app:

yo blockstack:react

After you respond to the prompts, the app generator will create all of the app files and then install all dependencies.

To run the app locally:

npm start

And open your browser to http://localhost:8080. You should now see a simple React app that you can sign in to using your Blockstack ID.

then, continue with these tutorial as followed :
https://blockstack.org/tutorials/multi-player-storage

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!