Commit 73f72d0a95a4ea7cf876a36e77fa8fef0fd601d8
update documentation
Dominic Tarr committed on 9/6/2016, 11:25:58 PMParent: dc36ded7d6547bbdb3fb82171fb5fc305edd2556
Files changed
README.md | changed |
README.md | ||
---|---|---|
@@ -1,56 +1,19 @@ | ||
1 | 1 | # patchbay |
2 | 2 | |
3 | 3 | Prototype of a pluggable patchwork. |
4 | 4 | |
5 | -Patchbay uses [depject](https://npm.im/depject) to provide | |
6 | -a highly composable api. all scripts in the `./modules` directory | |
7 | -are loaded and combined using [depject](https://npm.im/depject) | |
5 | +`patchbay` is an secure-scuttlebutt client interface | |
6 | +that is fully compatible with [patchwork](https://github.com/ssbc/patchwork) | |
8 | 7 | |
8 | +I started `patchbay` to experiment with a different internal architecture | |
9 | +based on [depject](https://github.com/dominictarr/depject). The goal was | |
10 | +to make it easier to develop new features, and enable or disable features. | |
11 | +This has so far been quite successful! | |
12 | + | |
9 | 13 | This makes in very easy to create say, a renderer for a new message type, |
10 | 14 | or switch to a different method for choosing user names. |
11 | 15 | |
12 | -## overview | |
13 | - | |
14 | -Currently, the main module is `tabs.js` which plugs into | |
15 | -the `app` socket, and provides the `screen_view` socket. | |
16 | -when you click a link, `screen_view` socket with the link path, | |
17 | -which returns a html element which becomes a new tab. | |
18 | - | |
19 | -currently, `main.js` `feed.js` and `thread.js` plug into `screen_view` | |
20 | -and then in turn, call the `message_render` socket, which calls | |
21 | -`message_content` `avatar` `message_meta` `message_action` and `message_link`. | |
22 | - | |
23 | -`avatar.js` plugs into `avatar`, and provides the `avatar_name` socket. | |
24 | -it just returns a link to the public key, labled with what it gets back | |
25 | -from `avatar_name` socket. this is in turn provided by the `names.js` module. | |
26 | - | |
27 | -Two modules plug into `message_content`, `post.js` and `like.js` | |
28 | - | |
29 | -No plugs into the `message_action` socket have been implemented yet, | |
30 | -but whatever is returned from this will inserted into the dom at the bottom | |
31 | -of the message (by the `message` module) so this would be the plug to | |
32 | -use for implementing a like/+1/fav/dig/yup button, or a reply button. | |
33 | - | |
34 | -## other ideas | |
35 | - | |
36 | -Editable messages would probably need to plug into several sockets. | |
37 | -firstly they would render content differently, so probably use the `message_content` socket. | |
38 | -secondly they would need to show edit state, which would probably use `message_meta` | |
39 | -and finially they'd need to provide the ability to edit the message! | |
40 | -that would use `message_action` | |
41 | - | |
42 | -Implementing a "events" message type would be easy, just implement another | |
43 | -plug for `message_content`, that renders events. | |
44 | - | |
45 | -Instead of reading all the modules in a directory, it would be better | |
46 | -to load these from configuration. Then, modules could be distributed | |
47 | -as browserify bundles, and distributed over ssb. Configuration | |
48 | -could just be a list of hashes - but you could also disable specific | |
49 | -sockets or plugs if necessary (leaving them unconnected). | |
50 | - | |
51 | -Then, that configuration could be shared over ssb! | |
52 | - | |
53 | 16 | ## Running |
54 | 17 | |
55 | 18 | ``` |
56 | 19 | npm install scuttlebot@latest -g |
@@ -75,10 +38,21 @@ | ||
75 | 38 | npm run build |
76 | 39 | electro index.js |
77 | 40 | ``` |
78 | 41 | |
79 | -## modules | |
42 | +## how to add a feature | |
80 | 43 | |
44 | +To add a new message type, add add a js to `./modules/` that | |
45 | +exports a function named `message_content` (it should return an html element) | |
46 | +To add a new tab, export a function named `screen_view` (returns an html element) | |
47 | + | |
48 | +To add a new detail, that appears above a message, | |
49 | +export a function named `message_meta`. | |
50 | + | |
51 | +see the code for more examples. | |
52 | + | |
53 | +## module graph | |
54 | + | |
81 | 55 | patchbay uses [depject](http://github.com/dominictarr/depject) to manage it's modules. |
82 | 56 | here is a graph of the current connections between them. (round shows module, |
83 | 57 | square shows api, arrow direction points from user to provider) |
84 | 58 | |
@@ -86,4 +60,9 @@ | ||
86 | 60 | |
87 | 61 | ## License |
88 | 62 | |
89 | 63 | MIT |
64 | + | |
65 | + | |
66 | + | |
67 | + | |
68 | + |
Built with git-ssb-web