Client Developer Guide

Overview

OnRabbleClient is a lightweight, extensible chat client designed for real-time communication over secure WebSocket connections. It is part of the OnRabble suite and integrates with a Go-based backend along with PostgreSQL and Keycloak for persistent data and user authentication.

This guide offers a high-level overview of the core architecture, message flow, and types exposed to QML for declarative UI development.

Architecture Overview

OnRabbleClient follows a modular and event-driven architecture, structured around views, models, and manager classes. These components communicate via signals and are created dynamically based on the current authentication and connection state.

The application separates responsibilities into layers:

  • Discovery and authentication are handled in the main window
  • Active chat sessions run in independent chat windows
  • Session state, connection logic, and exposed models are encapsulated in ClientManager

This design promotes:

  • Clear separation between discovery, authentication, and messaging concerns
  • Stateless QML views that react to model and signal updates
  • Support for multiple concurrent chat windows with isolated session state

See keyprocesses.html for a detailed walkthrough of how discovery, authentication, and chat windows are initialized.

Key Processes

These pages describe the core operations that govern the OnRabbleClient lifecycle, from selecting a server to authenticating and establishing a real-time connection.

Each phase corresponds to a distinct part of the overall flow:

Core Components

These classes form the backbone of the system and are available to QML:

  • DiscoveryManager — Initiates discovery of valid chat server configurations
  • AuthManager — Manages authentication flow and the provision of the access token
  • ClientManager — Manages connection state, access tokens, and provides access to proxies
  • MessageBroker — Parses inbound messages and emits typed signals and model updates

Payload Types

Payloads are small, structured data types deserialized from JSON. They represent messages, channels, user identity, and other server-side entities.

See payloads.html for a categorized overview of all payload types.

Data Models

Models in OnRabbleClient serve as reactive data sources for QML views. These are all subclasses of QAbstractListModel or QSortFilterProxyModel, and expose access to chat messages, channels, and filtered message views.

Models do not handle validation or persistence; their sole responsibility is to represent and organize in-memory data for UI components to display. Data is inserted into these models by controller components such as ClientManager or MessageBroker.

See models.html for a categorized breakdown of all models.

Extending the System

To support new behaviors or message types:

  • Add parsing logic to MessageBroker::processMessage()
  • Create a new payload struct if needed
  • Update a model or emit a new signal
  • Expose the result to QML if appropriate

Note: QML views automatically react to changes in exposed models and signals when bound properly.

See also ClientManager, MessageBroker, DiscoveryManager, payloads.html, and authenticationflow.html.