Skip to content

Latest commit

 

History

History
99 lines (64 loc) · 4.98 KB

README.md

File metadata and controls

99 lines (64 loc) · 4.98 KB

dWeb Blog - a Website for both Web and Decentralised Web

dWeb Blog is a blazing fast website that you can deploy to both the Web and decenralised Web (dWeb) in a single command. The code is open source (GPL3), so everything here is free to use and build on.

dWeb combines the advanced features from ReactJs for website design and development, with React-static's blazing fast, optimised website with just-in-time preloading.

This website's purpose is to show you how to do everything it does, and to provide a live tutorial for website development by documenting its evolution from capable demo and starting point for a pro website, to fully fledged CMS. Along the way it will also show other things I'm working on, such as Safe Drive, decentralised Git, and of course Solid.

With some help, this project can be developed into a full featured Wordpress style CMS, combining the interoperability and analytical capabilities of Solid with the security, privacy and freedom of Safe Network, and bridge the transition from the increasingly centralised web, to the a more robust user oriented decentralised web.

Current Status

dWeb already works so you can visit it live on web and Safe Network (see below) as well as use it as the basis for your own website. Posts and content are created in markdown, and automatically uploaded to the Web and to Safe Network with a single command.

Code and content versioning and backup are easily maintained under git. My intention is to build on this base to work with local headless CMS or cloud CMS, and other data types such as RDFa (Linked Data).

Workflow:

  1. Create and edit markdown files under ./content

If you build on dWeb Blog yourself, you can help build the future by submitting your enhancements in the form of pull requests via github/dweb-blog (owned by Microsoft) or safe://dweb.dgit via Safe Drive/safegit (owned by us). The latter is still in alpha, so for the time being both will be kept in sync.

dWeb is itself a fork of rs-blog-demo (shh, don't tell github), my playground for learning about React-static, and a live example of building blazing fast websites on web and dWeb (Safe Network). Some enhancements to dWeb will no doubt make it back into rs-blog-demo, which will remain a cleaner more basic starting point, but likely some way behind dWeb Blog. So for now best to fork dWeb Blog and start here.

Quick Start

Development

React-static uses yarn so if you don't have it, install without npm from yarnpkg.com or using npm with:

$ npm install -g yarn

Install React-static:

$ yarn global add react-static

Get dWeb and run the development server.

git clone https://github.com/happybeing/dweb-blog && \
cd dweb-blog && \
yarn  && \
yarn start

Visit http://localhost:3000 and start adding content (see below), or editing the code if you want to modify the look and feel, styles, colours and so on. See the React-static documention for how to customise the website code.

Test a production build

yarn stage
yarn serve # at http://localhost:3000

Deploy Website

Build for production (output in ./dist):

yarn build

Upload the contents of ./dist to your website's root HTML directory on the web or Safe Network.

Automated Deployment to Web

To automate build and upload by ftp, see the bash script ./script/deployweb.sh

Automated Deployment to Safe Network

You can upload the contents of your website from ./dist to Safe Network using a suitable application such as the Maidsafe Web Hosting Manager, or if you are using Safe Drive, on Linux you can upload the website on Safe Network as follows.

  • Start Safe Drive and connect to Safe Network so that your Safe Drive is mounted at ~/Safe

  • Execute the following command, substituting the destination path of your website storage on Safe Network. Note the trailing '/' on both source and destination paths.

   cp -ruv ./dist/ ~/Safe/_public/dweb/www-root/

There's script to automate this (scripts/deployweb.sh) which you can customise to upload both to web and Safe in one command.

Website Content

Create content as markdown files under /content. Later content will be derived from other sources such as Solid Linked Data (Turtle files) via LDP on clearweb or Safe Network.

Origin

Fork of rs-blog-demo.

LICENSE

  • Website content is Copyright (C) Mark Hughes 2019. All Rights Reserved.
  • Everything else is GPL3.0

'Content' includes everything under ./content and ./public.