Using an Extensible Web-Based Command Line Interface to Administrate a Backend Platform

Ami Turgman

Recently my team developed a backend platform for processing medical documents in the Genomics space. Details about this project can be found here. This platform consists of a number of services that together make a pipeline in which data flows from one service to the next. The pipeline uses queues to send tasks for processing, so that one service output is the next service input.

The problem

The backend platform required a mechanism to control and manage the different pipeline services and support scenarios such as triggering the pipeline processing, processing a specific document and query application logs.

Usually developing a backend platform requires developing a dedicated administration UI in which administrators can manage and control the platform. For this project, our team didn’t have the capacity to develop a dedicated administration tool, so we decided to go with a different approach.

The solution

Instead of developing our own dedicated UI, we leveraged the web-cli library which provides an extensible web-based command line interface environment (ie. console) for managing backends. Extending the console is done by implementing a simple REST API (ie. plugin). The REST API is annotated with metadata that is used to describe how to trigger the different actions that the REST-API exposes. This metadata is used to compile commands that can be triggered from the console.

By implementing a few plugins, we were able to provide full support for controlling the backend platform without the need to create our own administration tool. Having said that, the web-cli targets developers or people with technical background that are familar and comfartable with a command line environment.

Sample screenshot with a few command executions: Demo

The following screenshot is an example for the pipeline status ---live 5 command, in which the console keeps triggering the relevant API every 5 seconds. The API returns HTML result which you can see on the Pin Panel to the right. This was an easy solution for getting “live updates” of the current status of the pipeline: Demo

The pipeline plugin implementation can be found here.

Sample usages: Demo

How do I start using the web-cli?

A bootstrap console sample application (Node.js) is available here. The sample includes a few basic features like authentication, authorization, user management and log viewer. The user management and log features are implemented as plugins so it is easy to use it as a reference for creating your own plugins. Additional detailed documentation for how to use and extend the console can be found in the documentation folder.

Opportunity for reuse

I’ve been using the console for every project I worked on recently. I always start by first setting it up, and only then work on the actual project related components. By implementing simple plugins I’m able to control my backend from day 1.

The console can be used as the only solution to control your platform, or as a quick solution on early stages of development, in parallel to developing a dedicated UI.

The console can be used as is to leverage existing functionality, or extended with more features as needed. We encourage you to contribute by submitting pull requests to the relevant repositories.


Discussion is closed.

Feedback usabilla icon