In Beaker 0.7.2, we made policy updates that enable an application model we call “Self-mutating websites.” In this post, I’ll explain what they are and how to get the most out of them.
What are self-mutating websites?
Self-mutating websites are Dat websites that can modify their own files.
When you first visit a self-mutating website, it’s in read-only mode. In order to make changes, you’d need to fork the site to make an editable copy. Then your forked copy will be able to write changes to itself.
In the example above, the site writes to its own
index.html to persist its changes.
How do self-mutating websites work?
Self-mutating websites are Dat websites that use the
DatArchive Web API to modify their own files. These modifications can include anything from storing user data to modifying the application’s own code.
Self-mutation is a very convenient way to do personal storage and publishing, e.g., on a Wiki or TODO list. For example, a self-mutating TODO application would write the user’s data to its own archive files, which would then be stored on the user’s device.
How can I build a self-mutating site?
The fastest way to get started is to view the source of this example application in Beaker or fork it to create your own editable copy. This app includes everything you need to know about building a self-mutating website.All posts