splash-media-co / server

Backend server for Splash
6 stars 0 forks source link


Splash Server Documentation

Overview

The Splash server is a backend system responsible for handling various commands from clients, such as posting messages, authentication, retrieving posts, and account creation. This document provides comprehensive documentation for each supported command, including usage instructions, parameters, examples, and potential errors.

[!WARNING]
This server is still in development. Expect breaking changes, bugs, and lots of unstable stuff.

Commands

1. direct

Description

The direct command enables clients to perform direct actions such as posting messages, deleting posts, or editing posts.

Parameters

Usage

Possible Errors

2. auth

Description

The auth command is used to authenticate a user.

Parameters

Usage

{
  "cmd": "auth",
  "val": {
    "pswd": "password123"
  }
}

Possible Errors

3. retrieve

Description

The retrieve command is used to retrieve posts.

Parameters

Usage

{
  "cmd": "retrieve",
  "val": {
    "type": "latest",
    "c": "chat_id",
    "o": 0
  }
}

Possible Errors

4. genaccount

Description

The genaccount command is used to generate a new user account.

Parameters

Usage

{
  "cmd": "genaccount",
  "val": {
    "pswd": "password123"
  }
}

Possible Errors

Usage

  1. Connect to the Server:

    • Utilize WebSocket connections to connect clients to the server.
  2. Send Commands:

    • Send JSON-formatted commands to the server using WebSocket communication.
  3. Handle Responses:

    • Handle server responses and status messages received via WebSocket.
  4. Error Handling:

    • Check for status messages in responses to handle errors gracefully.