A React & Typescript blog that uses 3Box decentralized storage and authentication
yarn
yarn startThis 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.
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;