Streamr Engine + Editor web app
50K+
Web application containing and serving the Streamr Engine and Editor. Streamr Engine is an event processing system for real-time data. Streamr Editor is a visual programming environment for creating processes (called Canvases) that run on the Engine.
Streamr Engine and Editor is built on top of the Java VM and Grails web framework. The current implementation runs on the centralised (cloud) version of Streamr infrastructure, detailed in the section Dependencies (below).
A convenient way of installing and managing multiple versions of Grails is SDKMAN!. And for node.js there is nvm.
Additional services are required to run this web application. The easiest way to get them up and running (for development purposes) is to use the streamr-docker-dev tool we provide.
Ensure you have the dependencies listed under Dependencies > Tools installed.
You need to place the chromedriver executeble in your PATH, and set an environment variable CHROMEDRIVER to point to the executable.
Clone this repo
Fetch all git submodules
git submodule update --init --recursive
npm install
Run streamr-docker-dev start 1 if you are using the recommended tool streamr-docker-dev. Otherwise make sure all services dependencies are running and the the web applications is properly configured to connect to them.
Start the web application
grails run-app
A Docker image is automatically built and pushed to DockerHub when commits
are pushed to branch master.
Currently project has no CI system configured nor are any .jar artifacts published to central repositories.
We provide sensible default configurations for IntelliJ IDEA but project can be developed with other IDEs as well.
grails test-appnpm testgrails test-app -unitgrails test-app -integrationgrails test-app -functionalThese are also available as pre-shared run configurations if you use IntelliJ IDEA.
The UI is increasingly implemented with JavaScript libraries React and Redux and compiled with Webpack. The source files must first be transpiled and compiled into bundle file(s). This happens by running npm run build in the root directory. Normally, when running the Grails app the build command is run automatically, and needs not to be cared of.
When developing the UI, it's much more handy to run the development server in the background. This happens with npm run dev.
The dev server updates bundle files on-the-fly as changes are detected in source files.
Normally the bundles are always written into files, where Grails knows to take them from. However, if you want to use the files straight from the memory of the Webpack dev server (for increased building speed), is that possible with the following commands:
grails run-app -Dwebpack.bundle.location=http://localhost:9000 (9000 is the default port of the dev server)NO_FILES=true npm run dev to prevent it from writing the filesThe back-end consists of two logical parts. The Engine is written mostly in Java and is responsible for executing arbitrary user-defined Canvases that process, analyze and act upon real-time event data. The Editor, on the other hand, is responsible for API(s), rendered web pages and other front-facing functionality. It is mostly written in Groovy and utilizes facilities provided by the Grails framework.
When you run the Engine+Editor web app with grails run-app or grails test run-app, most changes to source code files are automatically hot reloaded into the running JVM process.
There are already modules that allow running code on canvas, e.g. JavaModule and Javascript module. They are, however, "last resort" patches for cases where the existing modules don't offer the required functionality, but the functionality also isn't reusable enough to warrant developing a custom module.
If the required functionality is complex, or if it depends on libraries or external code, you'll need to set up the development environment following the above steps. Upside is of course, after it's done, you also get IDE support (we use IntelliJ IDEA), and you can write unit tests etc.
A module is as simple as a Java class that extends AbstractSignalPathModule and implements the critical module-specific functionality (sendOutput and clearState). The code is going to look the same as in a JavaModule, only wrapped in a Java class. Please take a look at the XOR module for a simple example / boilerplate / starting point. For unit testing a module, see the XorSpec unit test class.
You also need to add your module to the module table in the MySQL database so that Editor finds your module, and you can add it on the canvas.
We want to integrate quality module contributions to the project. To get your custom module to the master, the following is required:
We'll be happy to help with completing these steps. Best way to reach the Streamr developer community is the Streamr Chat
This software is open source, and dual licensed under AGPLv3 and an enterprise-friendly commercial license.
Content type
Image
Digest
Size
237.6 MB
Last updated
over 5 years ago
docker pull streamr/engine-and-editor:sha-9646a94