yomo-presence-backend
The backend for @yomo/presencejs
🔨
Dev on local
0. Prerequisites
1. Install YoMo CLI
$ go install github.com/yomorun/cli/yomo@latest
See YoMo CLI for details.
2. Start YoMo Zipper
$ yomo serve -c ./example/single-node/workflow.yaml
2022-01-13 16:44:28.015 [yomo:zipper] Listening SIGTERM/SIGINT...
2022-01-13 16:44:28.027 [core:server] ✅ [YoMoZipper] Listening on: [::]:9000, QUIC: [v1 draft-29], AUTH: [None]
3. Start Presence Websocket Server
$ PRESENCE_SENDER=localhost:9000 PRESENCE_RECEIVER=localhost:9000 go run ./cmd/main.go
2022/01/13 16:45:08 Starting websocket server 0.0.0.0:7000...
------------Receiver init------------ zipper=localhost:9000
2022/01/13 16:45:08 [core:client] has connected to yomo-source (localhost:9000)
[source] ✅ Connect to YoMo-Zipper
2022/01/13 16:45:08 [core:client] has connected to PresenceHandler (localhost:9000)
Cursor Chat
example in local
4. Run the Checkout yomo-react-cursor-chat-example and change the socketURL to ws://localhost:7000
.
Then run the example:
$ npm run dev
Deployment
1. Install YoMo CLI Binary on server.
$ curl -fsSL "https://bina.egoist.sh/yomorun/cli?name=yomo" | sh
2. Start the Presence Receiver&Sender servers
2.1 Upload the config files to server
The following steps are based on Ubuntu for instance.
Upload the folders example/mesh-nodes
and deploy/systemd
to your server.
2.2 Start Presence-Reciever Server
$ sudo systemctl enable /home/ubuntu/presence-backend/systemd/presence-receiver.service
$ sudo systemctl start presence-receiver.service
2.3 Start Presence-Sender Server
Note: you have to upload the
Mesh config
file to your webserver (or S3), see deploy/dev.json for example.
$ sudo systemctl enable /home/ubuntu/presence-backend/systemd/presence-sender.service
$ sudo systemctl start presence-sender.service
3. Start the Presence WebSocket Server
presenced
binary and upload it to your server
3.1 Build the $ make build-linux
3.2 Start Presence-WebSocket Server
$ sudo systemctl enable /home/ubuntu/presence-backend/systemd/presenced.service
$ sudo systemctl start presenced.service