Peerbit Example Library
## Examples
### [Chat room](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/one-chat-room/)
[
](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/one-chat-room/)
### [Lobby + chat rooms](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/many-chat-rooms/)
[
](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/many-chat-rooms/)
### [Collaborative text document](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/text-document/)
[
](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/text-document/)
### [Sync files](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/file-share/)
#### [React app](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/file-share/)
[
](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/file-share/)
#### [CLI](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/file-share/)
[
](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/file-share/)
### [Live video streaming](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/live-streaming/)
[
](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/live-streaming/)
### [Collaborative machine learning](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/collaborative-learning/)
[
](https://github.com/dao-xyz/peerbit-examples/blob/master/./packages/collaborative-learning/)
## How to run the examples
1.
```sh
yarn
yarn lerna bootstrap
yarn build
```
2.
Go into an example. If it is a frontend app, you can run it locally (if you have a node running (see below)) with
```sh
yarn start
```
and remotely on a test relay
```sh
yarn start-remote
```
## How to setup a local relay node
(This is just a basic libp2p-js node)
1.
Install Node >= 16
2.
Install CLI
```sh
npm install -g @peerbit/server
```
3.
```sh
peerbit start
```
Ending with '&' to start a background process
For more complete instructions on how to run a node in a server center that can be accessed remotely [see this](https://github.com/dao-xyz/peerbit-examples/blob/master/https://github.com/dao-xyz/peerbit/tree/master/packages/clients/peerbit-server).