Hi Jon

> I'd like to run TiddlyWiki as a CouchApp

Great, this is something I'd like to see, too.

> I need to make a syncadaptor

Yes, that would be the most straightforward way to get things working.
There is some documentation on the interface that sync adaptors need to
provide:

http://tiddlywiki.com/static/SyncAdaptorModules.html

(Documentation feedback is particularly welcome; it's a bit of a nightmare
keeping everything up to date!)

What's happening behind the scenes is fairly simple: the core syncer.js
module keeps track of the change count of each tiddler, and listens for
tiddler change events. It calls asynchronous methods on the current
syncadaptor to create, update and delete remote tiddlers to mirror the
local store.

The sync logic is used both to sync to TW5's own HTTP server and to sync to
TiddlyWeb. Things are working OK at the moment, but it's possible that
you'd run into wrinkles that will need fixing in the store - as I say, I'd
be interested to help get this working.

Hopefully you'll also be able to make things so that the original TW5 HTML
file is also served from CouchDB. The approach we use with TiddlyWeb/Tank
is to server an empty TW5 HTML file that syncs with the server on startup.

> find a way to register that adaptor for use by, e.g., empty.html

If you go down the sync adaptor route then you should be able to get
started by cloning the edition for Tank:

https://github.com/Jermolene/TiddlyWiki5/tree/master/editions/tw5tank

Just substitute your couchDB plugin for the tiddlywiki/tiddlyweb plugin.

I wish you luck with this, do fire any questions at me here or on GitHub or
Twitter.

> *What*: An experiment to see what it would take to make the web truly
Peer to Peer

This is of course an area of great interest to me.

My own belief is that we developers tend to jump to the assumption that the
only way to be a peer-to-peer participant in the web is to run a server (or
to rent a chunk of a server). With TiddlyWiki, the barrier to participation
is the ability to host a static HTML document. I think that the distinction
is important: static web hosting can be thousands of time faster and more
reliable than hosting a dynamic app. The web has always been based on a
conceptual model of static documents, and the mechanics of the web
(caching, encryption etc) works particularly effectively on static
documents.

There are obviously many important scenarios that require a conventional
server architecture, but I think that the ability to work well without a
server is hard to engineer back into a server-based application. Or, to put
it another way, apps need to be designed for offline first.

Best wishes

Jeremy



On Mon, Mar 3, 2014 at 5:46 PM, Jon Udell <jud...@gmail.com> wrote:

> With a bit more research I can be a bit more specific. A CouchApp relies
> on CouchDB's own httpd, there's no Node.js in the picture. So I believe
> what I need to do (at least) is a) make a CouchDB-oriented version of the
> FileSystemAdaptor that reads-from/saves-to the filesystem, using CouchDB
> APIs rather than Node.js APIs, and b) find a way to register that adaptor
> for use by, e.g., empty.html, which as I understand it does not normally
> use a syncadaptor.
>
>
> On Monday, March 3, 2014 6:06:30 AM UTC-5, Jon Udell wrote:
>>
>> I'd like to run TiddlyWiki as a CouchApp (http://couchapp.org/page/index),
>> reading tiddlers from and saving to CouchDB. This would enable replication
>> and, in the context of the project I'm working on -- Thali (
>> http://thali.codeplex.com/) -- also powerful identity and security
>> mechanisms.
>>
>> A naive implementation would do what download.js does but redirect to a
>> CouchDB attachment. But of course it would be better to represent tiddlers
>> as individual (versioned) CouchDB docs. The TW5 architecture is impressive!
>> I think I can see that I need to make a syncadaptor and/or a plugin but
>> would appreciate advice on what exactly would be needed and how things
>> should fit together.
>>
>> Cheers,
>>
>> Jon
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWikiDev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tiddlywikidev+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywikidev@googlegroups.com.
> Visit this group at http://groups.google.com/group/tiddlywikidev.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Jeremy Ruston
mailto:jeremy.rus...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to