Skip to content

gelic-idealab/komodo-relay

Repository files navigation

Komodo Relay Server

Learn more about the Komodo Platform

What is it?

The relay server facilitates client communication during multiplayer sessions. It allows clients to join session namespaces or 'rooms', propagates client updates (including positions within the VR scene and interactions with entities or other clients), coordinates chat sessions (including text and voice/video/screen) [1], maintains session state (including active clients, entity and scene state, session properties), and captures data during session recording.


Development

Getting started

You will need Node.js installed on your machine.

  1. Clone this repository

    • git clone https://github.com/gelic-idealab/komodo-relay.git
    • cd komodo-relay/
  2. Configure the Docker container

    • cp config.template.js config.js
    • Edit config.js:
      • db: connection information for komodo-db or a comparable MySQL server
      • azure: Microsoft Speech SDK credentials
      • capture: local file directory for capture files
  3. Install dependencies

    • npm install
  4. Run the relay server

    • node serve.js
Dependencies (Production) Usage
Microsoft Speech SDK [1] Processing client audio for speech-to-text
mkdirp Creating directories for writing capture files
mysql2 Connecting to komodo-db for connection, capture records
object.fromentries Polyfill for turning a map into an object
socket.io Managing session namespaces, joining clients to sessions, listening for and emitting custom events (such as position updates), portal text & speech-to-text chat [1]
winston Logging
Dependencies (Development) Usage
Mocha Unit testing
Instanbul Code coverage
Should.JS Easy-to-read assertions

Footnotes

[1] NOTE: The chat namespace is experimental and not ready for production usage.


Testing

The test directory contains scripts which use and validate relay functionality. Please run tests during development, and especially before submitting pull requests.

npm run test

OR

nyc mocha --debug-brk --exit


Deployment

The recommended Komodo deployment uses Docker and docker-compose.