Skip to content
/ rdb Public

Hexalts Realtime Database handler on serverside

Notifications You must be signed in to change notification settings

hexalts/rdb

Repository files navigation

OSSAR CodeQL

Hexalts Realtime Database (server side)

To use the RDB Client Side, please refer to this link.

Requirements

  • MongoDB with replica set or sharded cluster enabled. See here.
  • PM2 for process management. See here.
  • NodeJS 14+ or LTS.
  • MQTT Broker.

Installation

Clone project from Hexalts official GitHub repository.

git clone https://github.com/hexalts/rdb.git

Move to RDB directory

cd rdb

Edit your configuration inside ecosystem.config.js

module.exports = {
  apps: [
    {
      name: 'Hexalts - Realtime Database',
      script: 'yarn build && yarn start:prod',
      env: {
        BROKER_HOSTNAME: 'change with your configuration',
        BROKER_USERNAME: 'change with your configuration',
        BROKER_PASSWORD: 'change with your configuration',
        BROKER_PORT: 'change with your configuration',
        DB_PORT: 'change with your configuration',
        DB_HOST: 'change with your configuration',
        DB_USERNAME: 'change with your configuration',
        DB_PASSWORD: 'change with your configuration',
        DB_PROTOCOL: 'change with your configuration',
        DB_ARGS: 'change with your configuration',
        INSTANCE_ID: 'Random UUIDv4',
      },
    },
  ],
};

You can try to generate an UUID v4 on this page, and make sure the client knows your instanceId. Otherwise, they cannot communicate with your RDB Server.

Start the RDB server via PM2

pm2 start

And that is how you set up the Hexalts RDB!