Skip to content
CAI
Software that uses CAICheck a score

alekras/erl.mqtt.server

47.6

Weak · 2 October 2026

2k

lines of production code

Erlang

with JavaScript

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is an Erlang-based MQTT broker that supports both MQTT 3.1.1 and v5 protocols, offering WebSocket connectivity and configurable storage backends like Mnesia. It includes a dedicated REST API server for managing user accounts, authentication, and session monitoring, accompanied by a React-based web interface for administration. The platform is designed for flexible deployment in standalone or distributed cluster modes via Docker, with comprehensive test coverage for protocol compliance and API functionality.

How it got here

2017 — Project restructuring and cleanup

6 changes.

This period focused on establishing the foundational project structure, including Docker configurations and build scripts, while simultaneously removing legacy MQTT server components and bundled TLS certificates. The work involved refactoring the application layout to support newer OTP versions and updating the development environment to enable testing for the v5 protocol version.

2019–2026 — REST API and deployment scaffolding

13 changes.

This period focused on establishing the foundational infrastructure for the MQTT server, including initial configuration files, build scripts, and deployment automation for standalone and distributed modes. It introduced a new REST API application for user management and monitoring, complete with an OpenAPI specification, Swagger UI, and a React-based web interface. Concurrently, the core MQTT server was updated to support Mnesia storage, WebSocket connections, and MQTT v5 protocol features, accompanied by comprehensive test suites for both the server and the new API.

Features

Add Swagger UI for REST API documentation

The application now serves a static Swagger UI interface for the REST API. This includes the main index page, OAuth2 redirect handling, and the necessary JavaScript/CSS bundles, allowing users to view and interact with the API specification directly via the browser.

_apps/mqtt\rest/priv/dist · high confidence

Added deployment scripts for standalone and distributed MQTT server modes

New shell scripts have been added to support deploying the MQTT server in both standalone and distributed configurations. For standalone operation, scripts are provided to start, stop, and access the console of a single node, as well as to run it via Docker. For distributed operation, specific scripts allow managing individual cluster nodes (node\_0 and node\_1) locally or within Docker containers, handling environment variables for ports, TLS certificates, and Mnesia database paths to facilitate clustering.

_deployment\scripts · high confidence

Initial REST API server scaffolding for MQTT management

This change introduces the foundational structure for a new Erlang-based REST server application within the \apps/mqtt\_rest\ directory. It includes an OpenAPI specification (v3) defining endpoints for user management (login, get, create, update, delete) and connection status monitoring, alongside generated server stubs and configuration files (rebar.config) that establish dependencies on Cowboy and Jesse. This provides the backend API surface for managing the MQTT server's user database and monitoring user sessions.

_apps/mqtt\rest · high confidence

Initial configuration files for MQTT server deployment

Added configuration files (sys.config, sys\_dev.config.src, sys\_prod.config.src, vm\_dev.args.src, vm\_prod.args.src) that define the runtime settings for the MQTT server. These files configure logging via Lager, set default ports for MQTT, REST, and WebSocket connections, specify TLS certificate paths, and configure Mnesia as the default storage backend. The production and development variants use environment variable placeholders (e.g., ${PORT\_REST}, ${CERT\_FILE}) to allow flexible deployment across different environments.

config · high confidence

Initial project structure and configuration

This change establishes the foundational project structure, including the addition of a Dockerfile, Docker Compose configurations for cluster deployment, release build scripts, and an Apache 2.0 license. It also introduces a Code of Conduct, updates the README with comprehensive documentation on architecture and deployment, and refactors the build configuration (rebar.config) to support OTP 27+, version 2.2.0 releases, and a new application layout with separate apps for the MQTT server and REST API.

(repo-wide) · high confidence

Introduce standalone REST API server for MQTT user management

A new \mqtt\_rest\ application has been added to provide a RESTful API for managing the MQTT server's user database. This server, built on Cowboy and generated from an OpenAPI specification, exposes endpoints for user lifecycle operations (create, read, update, delete), login, and status checks, as well as server configuration and session status. It includes JSON schema validation via Jesse, API key authentication, and serves a Swagger UI for documentation. The implementation supports configurable storage backends (MySQL, Dets, Mnesia) and runs on a dedicated port (default 8080).

_apps/mqtt\rest/src · high confidence

New React-based MQTT Server Monitor web interface

The MQTT REST server now includes a built-in web application for monitoring and management, built with React 17. This interface provides a login page for authentication, a configuration page to view server settings, and a users page that allows administrators to add, update, and remove user accounts. The UI is responsive, adapting its layout for mobile devices, and includes a help section explaining system features and roles.

_apps/mqtt\rest/priv/www · high confidence

Removals

Removal of legacy MQTT server application and TCP/SSL listeners

The \mqtt\_server\ application module, its source definition file, and the \mqtt\_server\_connection\ handler have been deleted. This removes the previous implementation that started the \lager\ logging service, configured storage backends (MySQL or Dets), and launched TCP (port 18883) and SSL/TLS (port 18483) listeners via Ranch. Users relying on this specific application entry point and its hardcoded listener configuration will no longer have these services started by this module.

src · high confidence

Behavioural changes

Added helper scripts and updated build archive configuration

New helper scripts have been added to the helper\_scripts directory to support building and running the MQTT server on both Unix and Windows environments, including a build properties file specifying version 2.1.0 and Erlang 23.0, shell command reference documentation, and startup scripts for the MQTT REST server and MQTT server. The build archive configuration (archive.xml) has been updated to include additional source files such as edoc and Erlang source files, configuration files, shell scripts, and the users-db-srv.bin file, while excluding build artifacts.

_helper\scripts · high confidence

MQTT server version 2.2.0 with Mnesia storage and WebSocket support

The MQTT server application has been updated to version 2.2.0, introducing Mnesia as a supported storage backend alongside existing options. It now includes a new WebSocket handler (\mqtt\_ws\_handler\) to allow MQTT clients to connect via websockets, and automatically creates default 'admin', 'echo', and 'guest' user accounts upon startup if they do not already exist in the storage layer.

_apps/mqtt\server/src · high confidence

Removal of bundled TLS certificates and private key

The \tsl/ca.crt\, \tsl/server.crt\, and \tsl/server.key\ files have been removed from the repository. This eliminates the previously bundled self-signed CA certificate, server certificate, and RSA private key, meaning the application no longer ships with these specific hardcoded credentials and will require external configuration or generation of TLS assets to establish secure connections.

tsl · high confidence

Reorganization of MQTT server static assets

Static assets, specifically the CSS file (my.css) and the .gitignore configuration, have been moved from the project root priv directory into the apps/mqtt\_server/priv directory. This change reflects a structural reorganization to better align static resources with the MQTT server application module.

_apps/mqtt\server/priv · high confidence

Updated Erlang backend version and added v5 test directory

The Erlang development environment configuration has been updated to use backend version 22.0 (up from 20.0) and the source directory list now includes the new test/v5 folder, enabling testing for the v5 protocol version.

.settings · high confidence

Test coverage

Added EUnit test suite for the MQTT REST service; Added MQTT v5 test suite; Removed MQTT server start test module; Updated MQTT client test suite for protocol changes and multi-client scenarios.

Dependencies

Initial MQTT server build configuration

The MQTT server application now includes a Rebar3 build configuration file that defines its source directories, test setup, and dependencies on Cowboy 2.16.0 and the mqtt\_common library. This configuration also enables Erlang compiler parse transforms for logging and sets up EUnit test execution options.

_apps/mqtt\server · high confidence

Housekeeping

Initial EDoc documentation for mqtt\_server

Added generated EDoc documentation for the mqtt\_server application, including an overview of the MQTT 3.1.1 protocol support, architecture, and configuration, as well as API reference pages for the core modules: mqtt\_server, mqtt\_server\_sup, mqtt\_server\_connection, mqtt\_rest\_handler, and mqtt\_ws\_handler.

doc · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 43 → 48 (+4.3)
  • Rubric changed (rubric-2026.09.12 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 63 → 62 (-0.2)
  • Architecture 100 → 100 (+0.0)
  • Maturity 65 → 69 (+3.5)
  • Readiness 17 → 24 (+7.9)
  • Security 68 → 70 (+1.4)

Resolved (5)

  • Coverage not measured — no coverage collector is wired up
  • Documentation: no usage examples (apps/mqtt_rest/README.md)
  • High IaC: WD-COMPOSE-0002 (docker-compose.yml)
  • High IaC: WD-COMPOSE-0002 (docker-compose.yml)
  • Medium IaC: WD-COMPOSE-0002 (docker-compose.yml)

New (14)

  • Dependency hygiene PARTLY measured — rebar3 pinning read, dependency currency not (no rebar.lock-pinned Hex declaration to grade)
  • Documentation: no project overview (README.md)
  • Floating source dependency: mqtt_common
  • High IaC: WD-COMPOSE-0002 (compose-dev.yaml)
  • High IaC: WD-COMPOSE-0002 (compose-dev.yaml)
  • High IaC: WD-COMPOSE-0002 (compose.yaml)
  • High IaC: WD-COMPOSE-0002 (compose.yaml)
  • Hotspot: apps/mqtt_rest/priv/www/js/AddUserBox.js (apps/mqtt_rest/priv/www/js/AddUserBox.js)
  • Hotspot: apps/mqtt_rest/priv/www/js/BoardUsers.js (apps/mqtt_rest/priv/www/js/BoardUsers.js)
  • Medium IaC: WD-COMPOSE-0002 (compose-dev.yaml)
  • Medium IaC: WD-COMPOSE-0002 (compose.yaml)
  • No dependency lockfile committed (apps/mqtt_rest/rebar.config)
  • No dependency lockfile committed (apps/mqtt_server/rebar.config)
  • app.browserType (cognitive 20) (apps/mqtt_rest/priv/www/js/app.js)

Changes since last survey

  • 4 commits — 3 feature/other, 1 fixes

By area

  • (root) — 3 commits
  • apps/mqtt_rest — 1 commit

Notable commits

  • fix: fix up SSL configuration
  • change: Improvement: FF issue and others
  • change: Update code for docker compose sim release
  • change: update docker configuration

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

alekras/erl.mqtt.server was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 2 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 2fb22c58383a0608392284423cc28c32f1a58968 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.