Static site generators

Hello beaker people,
I want to make a social app (when the new version of beaker is released) and gatsby with react makes my life easier.
Is a static generator (like gatsby) a good practice for creating dat sites on beaker?
Is there a known mechanism to build the site after adding content?
How will this work for people who want to fork?

Personally I use mdBook. One example in action is the very documentation for mdBook; my blog also uses mdBook. My last entry explains why I picked mdBook over jekyll, ghost, metalsmith, or rolling my own.

In short, mdBook was the simplest and most lightweight. I’m also a fan of the rust language. However, I have used jekyll & ghost successfully with dat (took more work than mdbook). I’ll let you draw your own conclusions.

2 Likes

Anything that spits out an index.html file should work for you. Afterall, DAT is just sharing files and Beaker is just rendering HTML :slight_smile:

2 Likes

What I don’t get, is how people will add their content after they fork my “builded” website.
Is there a way to trigger a build after someone adds their info?
Its probably a silly question that will be answered after I try stuff on the new version of beaker.

It sounds like you want to actually build a web app that is a centralized repository of aggregate data.

In that case, you’d probably want to understand how Beaker Social works. I can’t really say but maybe @pfrazee can clarify how you’d architect something like a Medium or a Discourse clone.

Thinking about this more, if you want to build something like twitter, you’d build a web app that is hosted from only your own dat archive.

All the users would access the web app via your dat link (they wouldn’t fork it themselves unless they really wanted to alter how the app worked).

Then you would have code something like the following inside your web app:

function postTweet() {
  // this would be a publicly readable file that is saved on the USERs dat archive
  // Your app would create this file for them automatically 
  var tweets = getTweetsFile || createTweetsFile 
  // add tweet onto the USERs tweets file
  addTweet(content, tweets)
}

Basically, all of the user data is accessed and saved on each users’ public dat archive. So each user retains ownership of their own app data.

The only thing your web app does is standardize the data format and handle the display / functionality.


Alternatively, you could create a decentralized web app with something like GUN db. Then you would get a decentralized CRDT style db and the actual code for the app would be decentralized along with the db.