Introduction

In the realm of distributed systems and microservices architectures, the NATS message bus stands out as a robust, high-performance solution. Its inherent simplicity combined with powerful features makes it a favorite among developers for building scalable and resilient applications.

As a seasonend NATS user, i always rely on the rich-feature CLI tool for interacting with NATS servers, testing subscriptions, and also to explore and interact with streams and KV store buckets, but i always missed a GUI tool to streamline more complex operations and provide a visual representation of NATS resources…

…so why not to build one and call it NUI?

Main goals with NUI are to offer a seamless user experience for managing:

  • core messages
  • streams
  • consumers
  • key-value store
  • servers metrics

By providing an intuitive UI (both desktop and web), NUI empowers the way to interact with a NATS server / cluster, to visualize NATS infrastructure, monitor message flows, and configure resources with ease.

While there are existing open-source projects aimed at providing UI solutions for NATS, many of them suffer from being outdated (using deprecated NATS Streaming) or lacking in features.

NUI is also focused on allowing to connect to multiple NATS servers at the same time, to explore and compare messages and streams keeping all you need on the screen.

nui preview 1

Underlying stack

BE

The BE stack is based on a Golang application that uses the official NATS client to perform all the operations with the NATS servers. Fortunately the NATS client has a really complete interface that allows to easely interact with the NATS servers and auto-manage a lot of complex tasks like reconnections and validations.

NUI adds an additional layer to the NATS client that manages a pool of NATS connections, allowing the FE to communicate with a simple REST interface optimizing the resources and re-use of existing connections. Also websockets are used to aggregate and send connections statuses and manage subscriptions from the FE, proxing the requests to the NATS client.

The REST interface of NUI can also be used as a standalone tool to access NATS features without using a specific client.

Only a small set of data is stored by the BE using a local document storage DB, so no sensitive data is shared on the internet.

One of the goals was to target both web and desktop-app deploys, so we decided to leverage Wails to embed the application as a native desktop one. Wails is a really powerfull tool, that allows multi-platform build of web-based applications as a single, native binary. All the assets are embedded in a Golang application that is then build for Windows, Mac and Linux platforms.

FE

The FE stack is based on a standard React + Vite web application written in TypeScript. The application is structured as a deck of cards that works as indipendent, single units that can be created and updated in parallel.

This structure allow the user to setup his own interface and interact with different connections at the same time. IndexDb is the choice to persist all the layout settings and allow the user to recover the prev layout used. When the application is restarted, each stack card auto recover his status and re-open the connection with the server, always showing up to date infos.

Check out the article about the concepts and ideas behind the UI!

..S0?

we are really hungry for feedbacks and (why not) contributions! Check out both the demo instance and Github page and have fun!