• Stars
    star
    767
  • Rank 59,242 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 11 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NoFlo Development Environment

NoFlo Development Environment

The NoFlo Development Environment is an offline-capable, client-side web application that helps users to build and run flow-based programs built with FBP compatible systems such as NoFlo, MsgFlo, imgflo and MicroFlo. The NoFlo Development Environment is available under the MIT license.

This project was made possible by 1205 Kickstarter backers. Check the project ChangeLog for new features and other changes.

Hosted version

Flowhub is a hosted version of the NoFlo Development Environment.

If you just want to create applications, we recommend that you use this version instead of building your own from source.

Start Flowhub webapp

Usage with different FBP systems

Even though the UI itself is built with NoFlo, it isn't talking directly with NoFlo for running and building graphs. Instead, it is utilizing the FBP Network Protocol which enables it to talk to any compatible FBP system. Currently over 5 different runtimes are known to work.

By implementing the protocol in your runtime, you can program it with NoFlo UI. If you use WebSockets or WebRTC as the transport, you do not need to change anything on NoFlo UI. You can also add support other transports.

Registering runtime for a user

The easiest way to pass user the connection information of your runtime is through the live mode. With this, the connection details are passed to the app via URL parameters, like this:

http://app.flowhub.io#runtime/endpoint?protocol%3Dwebsocket%26address%3Dws%3A%2F%2F127.0.0.1%3A3569

The supported parameters for the endpoint include:

  • protocol: the FBP protocol transport to use for the connection. Possible values include websocket, iframe, and webrtc
  • address: URL to use for the connection. Can be for instance ws:// URL for WebSockets, or the signaller URL and connection identifier for WebRTC
  • secret: secret to use for communicating with the runtime

These URLs can be shown on command line output, or provided to user via other mechanism. See a video demonstration of opening the app in live mode via a NFC tag.

Adding new runtime information

One can optionally add component templates, syntax highlighting and a 'get started' link for new runtimes.

  1. Add a new YAML file with runtime info as ./runtimeinfo/myruntime.yaml. Example
  2. Include it in ./runtimeinfo/index.js
  3. Commit the changes
  4. Send a Pull Request, so everyone benefits!

Development of NoFlo UI

Only necessary if you want to hack on NoFlo UI itself. Not neccesary for making apps with FBP.

Via Docker

A Dockerfile has been provided that can be used to easily build/run the NoFlo UI. You can also get an automatically built image from Docker Hub.

Build

docker build -t noflo-ui .

Run

docker run -d -p 9999:80 noflo-ui

Once it is built and the server is running you can access the UI at http://localhost:9999/index.html

Directly

To be able to work on the NoFlo UI you need:

  • A checkout of this repository
  • A working Node.js installation
  • At least version 3 of the NPM package manager

Go to the checkout folder and run:

$ npm install

This will provide you with all the needed development dependencies. Now you can build a new version by running:

$ npm run build

You have to run this command as an administrator on Windows.

Serve the UI using a webserver, then open the URL it in a web browser. Example:

$ npm start

If you prefer, you can instead start a webpack dev server process that will do a rebuild whenever one of the files changes:

$ npm run dev

Once it is built and the server is running you can access the UI at http://localhost:9999/index.html

In addition to this project, the other repository of interest is the the-graph graph editor widget used for editing flows.

Architecture

On high level, the noflo-ui architecture follows Redux conventions adapted to NoFlo. Here is how the main data flow looks like:

Store OUT -> IN Middleware     # Store sends actions together with application state to middleware
Middleware NEW -> ACTION Store # Middleware can trigger new actions
Middleware PASS -> IN Reduce   # Actions go from middleware to reducers
Reduce OUT -> STATE Store      # Reducers produce a new state object that gets sent to store
Reduce OUT -> STATE View       # State also goes to the view
View ACTION -> ACTION Store    # View can trigger actions

The actual flow is more detailed. You can view and edit it in graphs/main.fbp.

Note: the priciples outlined below are the architecture we're aiming towards. We're refactoring parts of the system to fit this architecture as we modify them. All new functionality should be implemented following this architecture.

Store

The Store component keeps track of the latest application state. When it receives new actions, it sends the out to the middleware and reducer chain together with the latest application state.

Middleware

noflo-ui middleware are components or graphs that can interact with particular actions. Each action passes through the chain of middlewares, and each middleware has two options on dealing with an action:

  1. Pass the action along without modifying it
  2. Capture the action and trigger new action(s)

Middleware are where side effects related to the application state are handled. This can include talking to external web services, FBP runtime communications, and loading or saving data to the local IndexedDB. Middleware do receive the current application state and can read from it, but they only manipulate state by the way of creating new actions.

Some middleware can also act as generators, creating new actions based on external input.

The middleware approach is explained further in this blog post.

Reducers

The job of the reducers is to receive actions and make changes to application state. The reducers must in effect be pure functions, where the same input state and action combination always produces the same new state.

View

The application's view layer is implemented as Polymer elements. The application view receives the state object produced by the reducers.

User interactions in the application view must not make direct state changes. Instead, the application view can trigger new actions by firing Polymer events. These then get processed by the middleware and reducers, causing the state to change.

Authentication and custom URLs

NoFlo UI is using GitHub for authentication. We have a default application configured to work at http://localhost:9999. If you want to serve your NoFlo UI from a different URL, you need to register your own OAuth application with them. Make sure to match GitHub's redirect URL policy.

To enable your own OAuth application, set the following environment variables and rebuild NoFlo UI:

  • $NOFLO_OAUTH_CLIENT_ID: Client ID of your GitHub OAuth application
  • $NOFLO_OAUTH_CLIENT_REDIRECT: Redirect URL of your GitHub OAuth application

OAuth secrets

For handling the OAuth Client Secret part of the login process, there are two options:

Built-in OAuth secret

This is the easy option for local NoFlo UI development. Simply build the OAuth client secret into the NoFlo UI app by setting it via the $NOFLO_OAUTH_CLIENT_SECRET environment variable.

Note: this means anybody with access to this NoFlo UI build will be able to read your client secret. Never do this with a world-accessible URL. It is fine for local-only development builds, though.

Gatekeeper

You can deploy an instance of the Gatekeeper Node.js app to handle the OAuth token exchange for you. Configure the Gatekeeper location to your NoFlo UI build with $NOFLO_OAUTH_GATE environment variable.

This is the more secure mechanism, since only the Gatekeeper server needs to know the Client Secret.

More Repositories

1

noflo

Flow-based programming for JavaScript
JavaScript
3,497
star
2

noflo-jekyll

Flow-based reimplementation of the Jekyll static site generator
CoffeeScript
214
star
3

noflo-nodejs

Command-line tool for running NoFlo programs on Node.js
JavaScript
91
star
4

noflo-ui-server

DEPRECATED, see README
JavaScript
63
star
5

noflo.github.io

The NoFlo website
HTML
54
star
6

dataflow-noflo

DEPRECATED prototype. To see the current work:
JavaScript
54
star
7

noflo-browser-app

Template for NoFlo browser applications
JavaScript
45
star
8

noflo-core

Core components for NoFlo
JavaScript
38
star
9

noflo-flow

Flow Control for NoFlo
JavaScript
29
star
10

noflo-react

Facebook React components for NoFlo
JavaScript
20
star
11

noflo-assembly

Industrial approach to writing NoFlo applications
JavaScript
19
star
12

noflo-canvas

Generative Canvas 2D drawing with NoFlo.
CoffeeScript
18
star
13

noflo-cad

CAD solid modelling components for NoFlo
CoffeeScript
18
star
14

noflo-github

GitHub components for NoFlo
CoffeeScript
15
star
15

visualize

Simple FBP visualizer
JavaScript
15
star
16

noflo-polymer

Polymer components for NoFlo
JavaScript
15
star
17

noflo-graphviz

NoFlo visualization tools for GraphViz
JavaScript
14
star
18

noflo-image

Image processing components for NoFlo.
CoffeeScript
13
star
19

polymer-noflo

Polymer Web Components wrapper for NoFlo
HTML
12
star
20

noflo-webserver

Web server components for NoFlo
CoffeeScript
12
star
21

noflo-runtime-base

Base library for building NoFlo runtimes
JavaScript
11
star
22

noflo-gnome

NoFlo runtime for GNOME development
JavaScript
11
star
23

noflo-runtime

FBP runtime components for NoFlo
CoffeeScript
11
star
24

noflo-ardrone

UNMAINTAINED ARDrone components for NoFlo
CoffeeScript
11
star
25

react-example

CoffeeScript
11
star
26

noflo-runtime-msgflo

NoFlo runtime for AMQP/MQTT
CoffeeScript
10
star
27

grunt-init-noflo

grunt-init template for scaffolding NoFlo projects
JavaScript
10
star
28

noflo-math

Mathematical operations for NoFlo
JavaScript
9
star
29

noflo-browser

NoFlo build for the browser used as default runtime in Flowhub
JavaScript
9
star
30

noflo-clmtrackr

Noflo face feature tracking with auduno/clmtrackr
JavaScript
8
star
31

noflo-physics

Physics components for NoFlo
CoffeeScript
8
star
32

noflo-seriously

(not fully working yet)
CoffeeScript
8
star
33

noflo-interaction

User interaction components for NoFlo
CoffeeScript
7
star
34

noflo-adapters

Packet Format Conversion for NoFlo
CoffeeScript
7
star
35

noflo-3dprint

NoFlo components for interacting with 3d printing services
CoffeeScript
7
star
36

noflo-strings

String Utilities for NoFlo
JavaScript
7
star
37

noflo-routers

Routing Packets in NoFlo
JavaScript
7
star
38

noflo-objects

Object Utilities for NoFlo
JavaScript
7
star
39

noflo-html

HTML handling components for NoFlo
CoffeeScript
6
star
40

noflo-dom

Document Object Model components for NoFlo
CoffeeScript
6
star
41

noflo-graph

Graph manipulation components for NoFlo
JavaScript
6
star
42

noflo-ccv

ccv face detection for noflo
CoffeeScript
6
star
43

noflo-couchdb

CouchDB components for NoFlo
CoffeeScript
6
star
44

noflo-xml

XML handling components for NoFlo
JavaScript
6
star
45

noflo-xpress

High-level Express.js components for NoFlo
JavaScript
6
star
46

noflo-filesystem

Filesystem components for NoFlo
JavaScript
5
star
47

noflo-test

DEPRECATED: Use fbp-spec instead. Fluent test framework for NoFlo components
CoffeeScript
5
star
48

noflo-websocket

WebSocket components for NoFlo
CoffeeScript
5
star
49

noflo-runtime-websocket

NoFlo runtime for execution on Node.js over WebSockets
JavaScript
5
star
50

noflo-css

Cascading Style Sheets components for NoFlo
CoffeeScript
5
star
51

noflo-thegrid

TheGrid components for NoFlo
CoffeeScript
4
star
52

noflo-amqp

Advanced Message Queuing Protocol components for NoFlo
CoffeeScript
4
star
53

noflo-tween

Timeline components for NoFlo
JavaScript
4
star
54

noflo-packets

Packet Utilities for NoFlo
CoffeeScript
4
star
55

noflo-localstorage

HTML5 LocalStorage components for NoFlo
CoffeeScript
4
star
56

noflo-sharp

Fast image resizing components for NoFlo.
CoffeeScript
4
star
57

noflo-ipfs

IPFS components for NoFlo
CoffeeScript
4
star
58

noflo-knex

Knex.js database query components for NoFlo
CoffeeScript
4
star
59

noflo-groups

Group Utilities for NoFlo
CoffeeScript
4
star
60

noflo-webaudio

Web Audio API for NoFlo.
CoffeeScript
4
star
61

grunt-noflo-browser

Grunt plugin for easier browser builds of NoFlo
JavaScript
4
star
62

noflo-liquid

Liquid Templating components for the NoFlo flow-based programming environment
JavaScript
4
star
63

noflo-gestures

Gesture recognition library for NoFlo
CoffeeScript
3
star
64

noflo-mirobot

Components for Mirobot.io
CoffeeScript
3
star
65

noflo-ajax

AJAX components for NoFlo
CoffeeScript
3
star
66

noflo-component-loader

NoFlo Component Loader generator for WebPack and other module bundlers
JavaScript
3
star
67

noflo-runtime-iframe

IFRAME runtime for NoFlo
CoffeeScript
3
star
68

grunt-noflo-manifest

DEPRECATED: Grunt plugin for updating NoFlo manifest files. Use fbp-manifest instead
JavaScript
3
star
69

noflo-diffbot

Diffbot components for NoFlo
CoffeeScript
3
star
70

noflo-gpio

GPIO components for Embedded Linux (RPi/BBB etc)
JavaScript
3
star
71

noflo-mandrill

Mandrill email API components for NoFlo
CoffeeScript
2
star
72

noflo-video

Video handling components for NoFlo
CoffeeScript
2
star
73

noflo-helper-arrayable

Helper for building components that can work on arrays or individual inputs
JavaScript
2
star
74

noflo-ducksboard

Ducksboard components for NoFlo
CoffeeScript
2
star
75

noflo-swagger-client

Generate NoFlo components for accessing a Swagger/OpenAPI service
JavaScript
2
star
76

noflo-amd

Asynchronous Module Definition components for NoFlo
CoffeeScript
2
star
77

noflo-redis

Redis components for NoFlo
JavaScript
2
star
78

noflo-git

Git components for NoFlo
CoffeeScript
2
star
79

noflo-markdown

Markdown processing components for NoFlo
JavaScript
2
star
80

noflo-gravatar

Gravatar components for NoFlo
JavaScript
2
star
81

noflo-mqtt

MQTT components for NoFlo
CoffeeScript
2
star
82

noflo-subprocess

NoFlo library to execute commands as subprocess
JavaScript
2
star
83

noflo-yaml

YAML handling components for NoFlo
JavaScript
2
star
84

noflo-google

Google API components for NoFlo
CoffeeScript
1
star
85

noflo-assembly-db

Reusable database components for NoFlo Assembly Lines
JavaScript
1
star
86

noflo-s3

S3 components for NoFlo
CoffeeScript
1
star
87

noflo-mclighting

NoFlo components for interacting with McLighting
JavaScript
1
star
88

noflo-mq

Message Queue components for NoFlo
CoffeeScript
1
star
89

noflo-hackrf

HackRF components for NoFlo
CoffeeScript
1
star
90

noflo-lint

NoFlo project linting tool
CoffeeScript
1
star
91

noflo-facebook

Facebook components for NoFlo
CoffeeScript
1
star
92

noflo-stanbol

Apache Stanbol components for NoFlo.
CoffeeScript
1
star
93

noflo-peer

NoFlo wrapper for peers/peerjs P2P audio, video, and data via WebRTC.
CoffeeScript
1
star
94

grunt-noflo-lint

Grunt plugin for linting NoFlo projects
JavaScript
1
star
95

noflo-stripe

Stripe payment processing components for NoFlo
CoffeeScript
1
star
96

component-fetcher

Utility for fetching the public list of NoFlo components and component libraries
CoffeeScript
1
star
97

noflo-blockchain

blockchain.info components for NoFlo
CoffeeScript
1
star
98

noflo-color

Color manipulation for NoFlo.
CoffeeScript
1
star
99

finance-tracker

Finance tracker API example for NoFlo Assembly line
JavaScript
1
star
100

noflo-svg

(WIP)
CoffeeScript
1
star