README.mdView |
---|
| 1 … | +# Patchbay |
| 2 … | + |
| 3 … | +`patchbay` is a secure-scuttlebutt client interface that is fully compatible with [patchwork](https://github.com/ssbc/patchwork). |
| 4 … | + |
| 5 … | +![](./screenshot.png) |
| 6 … | + |
| 7 … | +Patchbay is built using [patchcore](https://github.com/ssbc/patchcore) + [depject](https://github.com/dominictarr/depject). The goal is to make it easier to develop new features, and enable or disable features. This has so far been quite successful! |
| 8 … | + |
| 9 … | +This makes in very easy to create say, a renderer for a new message type, or switch to a different method for choosing user names. |
| 10 … | + |
| 11 … | + |
| 12 … | +## Setup |
| 13 … | + |
| 14 … | +Libsodium has some build dependencies. On *ubuntu systems the following might help: |
| 15 … | + |
| 16 … | +```sh |
| 17 … | +sudo apt-get install m4 libtool eclipse-cdt-autotools |
| 18 … | +``` |
| 19 … | + |
| 20 … | +Install Scuttlebot (your gossip server) |
| 21 … | + |
| 22 … | +```sh |
| 23 … | +npm install scuttlebot@latest -g |
| 24 … | + |
| 25 … | +# make sure you have secure-scuttlebutt@15.5.2 |
| 26 … | +npm ls secure-scuttlebutt -g |
| 27 … | + |
| 28 … | +sbot server |
| 29 … | + |
| 30 … | +# then in another tab (these must be separate commands) |
| 31 … | +sbot plugins.install ssb-links |
|
| 32 … | +sbot plugins.install ssb-query |
| 33 … | +sbot plugins.install ssb-ws |
| 34 … | +sbot plugins.install ssb-fulltext # for faster searches (optional) |
| 35 … | + |
| 36 … | +# restart sbot server (go back to previous tab and kill it) |
| 37 … | +``` |
| 38 … | + |
| 39 … | +Restart your sbot, then (optionally) use an invite code. This will give you your first friend, from which point you can find others: |
| 40 … | +``` |
| 41 … | + sbot invite.accept LONG_INVITE_CODE_MAYBE_IN_QUOTES |
| 42 … | +``` |
| 43 … | + |
| 44 … | +Install Patchbay (an interface for the your scuttlebutt database) |
| 45 … | + |
| 46 … | +```sh |
| 47 … | +git clone https://github.com/ssbc/patchbay.git |
| 48 … | +cd patchbay |
| 49 … | +npm install |
| 50 … | +``` |
| 51 … | + |
| 52 … | + |
| 53 … | +## Running the desktop app |
| 54 … | + |
| 55 … | +From inside the patchbay repo folder, |
| 56 … | + |
| 57 … | +```sh |
| 58 … | +npm run rebuild |
| 59 … | +npm start |
| 60 … | +``` |
| 61 … | + |
| 62 … | + |
| 63 … | +## Running in the browser |
| 64 … | + |
| 65 … | +Make sure scuttlebot is allowing private connections. Stop any running sbot server, restart it with the `--allowPrivate` option and create a new modern invite: |
| 66 … | + |
| 67 … | +```sh |
| 68 … | +sbot server --allowPrivate |
| 69 … | +sbot invite.create --modern |
| 70 … | +``` |
| 71 … | + |
| 72 … | +From inside the patchbay repo folder, run `npm run lite`. |
| 73 … | + |
| 74 … | +Lastly open `build/index.html` in a browser and append the invite |
| 75 … | +created above using: index.html#ws://localhost:8989.... |
| 76 … | + |
| 77 … | + |
| 78 … | +## How to add a feature |
| 79 … | + |
| 80 … | +To add a new message type, add add a js to `./modules/` that exports a function named `message_content` (it should return an HTML element). To add a new tab, export a function named `screen_view` (returns an html element). |
| 81 … | + |
| 82 … | +To add a new detail, that appears above a message, export a function named `message_meta`. |
| 83 … | + |
| 84 … | +See the code for more examples. |
| 85 … | + |
| 86 … | + |
| 87 … | +## Module graph |
| 88 … | + |
| 89 … | +patchbay uses [depject](http://github.com/dominictarr/depject) to manage it's modules. Here is a graph of the current connections between them (round shows module, square shows api, arrow direction points from user to provider). |
| 90 … | + |
| 91 … | +[module graph](./graph.svg) |
| 92 … | + |
| 93 … | + |
| 94 … | +## License |
| 95 … | + |
| 96 … | +MIT |
| 97 … | + |
| 98 … | + |