Written by Vinoyang, EdgeX Technical Contributor and Tencent Big Data Engineer
This is a two-part blog that introduces a User Interface project in the incubation area of the EdgeX Foundry. This first blog post will disclose some of the work that was recently completed. The second blog will detail the latest developments and plans for this UI project in the future.
edgex-ui-go Refactoring
First, I’d like to thank Huaqiao Zhang from VMware for providing a Java version of the implementation of EdgeX UI. This was a huge milestone as it provided EdgeX with its first user interface:
Based on discussions with him, we decided to follow the EdgeX Foundry direction and use GoLang for the backend EdgeX UI’s operations. This allows it to more easily operate in more resource constrained IoT edge environments. In fact, Huaqiao recently completed work on an initial GoLang implementation. A screenshot from Github of the initial Go implementation is below.
This version basically matches the capabilities provided by the original Java version. After he provided the initial version, I made a holistic and comprehensive review of the entire project. There were some areas for improvement with the initial version and work that needed be done before the work is ready to be accepted by the community. Here is a list of the improvements that needed to be made:
- The overall layout and directory structure of this project is not a general practice of GoLang
- There are common project code normative issues: such as hard-coded, annotated code, inconsistent code format, etc.
- The project’s README file does not have a detailed description of the project, such as installation, deployment, compilation, and operation instructions
- Mixed use of console printing and logging
- Relevant information is stored in memory (volatile storage) and does not provide a database-based implementation
- Missing a real login verification implementation
- Lack of continuous integration to support validation of PR validity
Much of the work came from the fact that we first concentrated on simply converting the Java version to GoLang version. As with much of the EdgeX development team, Huaqiao has just begun to learn the Go language and there was also work to do in order to bring the code into alignment with standard Go idioms, design and practices.
Overall, we corrected more than 25 issues (there are still more than 15 issues that are not outstanding). Now the code base looks like this:
Importantly, we also worked to simplify the getting, building and running of the new UI. Now even a new EdgeX UI user, one who is completely unfamiliar with GoLang, can run a local version of EdgeX-UI by using a series of make commands.
This simplicity was not there in the initial version.
This blog focused on providing a version of the Golang implementation for edgex-ui and refactoring it so that it matches the functionality of the original Java version but looks more like a Golang project. We’ve made significant progress but the work isn’t over yet. In part 2 of this article, which will post next week, I’ll introduce where we are now and where we’re headed with the next code release named Delhi later this year.
If you have questions or comments, visit the EdgeX Rocket.Chat and share your thoughts in the #community channel.