unstoppabledomains / 3box-blog-example

A React & Typescript blog that uses 3Box decentralized storage and authentication

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3Box React Blog

A React & Typescript blog that uses 3Box decentralized storage and authentication

How to use

yarn
yarn start

This will run the website with whatever blog is specified in public/config.json.

To create a new blog you will have run src/utils/createThread.ts and then update public/config.json with the new domain, threadAddress, spaceName, & adminWallet.

How It Works

Make sure the blogConfig.json is set up properly

The app use's React useContext & useReducer function to maintain a global app state.

// State:
interface AppState {
  box: any;
  space: any;
  thread: any;
  user: {
    loggedIn: boolean;
    walletAddress?: string;
    profileImg?: string;
  };
  posts?: BlogPost[];
}

// Actions:
type ActionTypes =
  | typeof ADD_BOX
  | typeof LOG_IN
  | typeof LOG_OUT
  | typeof ADD_POST
  | typeof SET_POSTS
  | typeof DELETE_POST;

Libraries

About

A React & Typescript blog that uses 3Box decentralized storage and authentication


Languages

Language:TypeScript 97.7%Language:HTML 0.9%Language:CSS 0.9%Language:Shell 0.5%