- FlowFuse User Manuals
- Using FlowFuse
- Getting Started
- FlowFuse Concepts
- Changing the Stack
- DevOps Pipelines
- Environment Variables
- FlowFuse File Nodes
- FlowFuse Persistent Context
- FlowFuse Project Nodes
- High Availability mode
- Instance Settings
- Shared Team Library
- FlowFuse API
- Migrating a Node-RED project to FlowFuse
- Device Agent
- Device Agent
- Hardware Guides
- FlowFuse Cloud
- FlowFuse Cloud
- FlowFuse Self-Hosted
- Installing FlowFuse
- Configuring FlowFuse
- DNS Setup
- Docker install
- Email configuration
- First Run Setup
- FlowFuse File Storage
- Install FlowFuse on Kubernetes
- Local Install
- Upgrading FlowFuse
- Administering FlowFuse
- Administering FlowFuse
- Administrator configuration for SSO
- User Management
- Community Support
- Premium Support
- Debugging Node-RED issues
- Contributing to FlowFuse
# Contributing to FlowFuse
This guide will help you get setup to contribute to the FlowFuse project.
The core of the FlowFuse platform is available under the Apache-2.0 license and we welcome contributions from the community.
# Software Requirements
This guide assumes you have a working development environment including:
- Node.js 16
- Platform build tools
apt-get install build-essential
- Windows: installed as part of the official node.js installer
- ☑️ Automatically install the necessary tools must be checked
# Project Repositories
There are a number of repositories under the FlowFuse GitHub organisation that make up the platform.
|FlowFuse||This is the core of the platform.|
|forge-ui-components||Common UI components used in the forge platform.|
|installer||The installer for the platform|
|flowforge-driver-localfs||The LocalFS driver. This deploys projects to the local system.|
|flowforge-driver-docker||The Docker driver. This deploys projects as containers in a Docker-managed environment.|
|flowforge-driver-k8s||The Kubernetes driver. This deploys projects as containers in a Kubernetes-managed environment.|
|flowforge-nr-launcher||The launcher application used to start and monitor an individual instance of Node-RED in the FlowFuse platform.|
|flowforge-nr-audit-logger||A Node-RED logging plugin that captures audit log events and sends them back to the FlowFuse platform.|
|flowforge-nr-auth||A Node-RED authentication plugin that controls access to a Node-RED instance based on FlowFuse access controls.|
|flowforge-nr-storage||A Node-RED storage plugin that stores Node-RED state in the FlowFuse platform|
|flowforge-nr-theme||A custom Node-RED theme|
# Setting Up A Development Environment
With the project split across multiple repositories, setting up a development environment manually takes quite a lot of steps to ensure everything is checked out and configured properly.
To make it easier, you can use the FlowFuse Development Environment project to get set up.
The following steps will get your development environment setup in no time:
git clone https://github.com/FlowFuse/flowforge-dev-env.git
npm run init
This clones all of the main project repositories, installs their dependencies and builds the repositories that need it.
All of the repositories are cloned under the
More details on using the FlowForge Development Environment are available in its documentation.
# FlowFuse Code Structure
FlowFuse/flowforge repository is the core of the platform and where you'll likely want to begin.
├── config - build config files
├── etc - FlowFuse platform configuration files
├── forge - Platform core code
│ ├── config
│ ├── containers
│ ├── db
│ ├── ee
│ ├── lib
│ ├── licensing
│ ├── monitor
│ ├── postoffice
│ ├── routes
│ └── settings
├── frontend - Frontend code
│ ├── dist - build output - created by `npm run build`
│ ├── public - static assets
│ └── src - vue src
│ ├── api
│ ├── components
│ ├── pages
│ ├── routes
│ └── store
├── test - tests for FlowFuse
└── var - where the database and localfs project directories are created
# Development Setup
# Create a Stack
You will need to setup the version(s) of Node-RED you want to use in your stacks.
flowforge directory run
npm run install-stack --vers=3.0.2
3.0.2 is the version of Node-RED you want to use in the stack.
# Running FlowFuse
A number of
npm tasks are defined in the
package.json file of this repository. To get started from the
flowforge directory use:
npm run serve
This does a couple things in parallel:
- Starts the core FlowFuse application and watches the source code for any changes - triggering a restart if needed.
- Builds the frontend application using WebPack and watches for any changes - triggering a rebuild as needed.
When running like this, the
NODE_ENV environment variable gets set to
Note: if you have not used the FlowFuse Development Environment, then you will need to run
npm run build
to build the platform before you can use
npm run serve.
# Configuring FlowFuse
When running in development mode, the core app will use
etc/flowforge.yml for its configuration. As you may want to have local configuration that you don't want to commit back to git, you can create a file called
etc/flowforge.local.yml and it will use that instead. That filename is setup to be ignored by git so it won't be accidentally committed.
# Mocking email
If you are developing locally and need to enable external email sending, you can either:
- Setup a local test SMTP server. For example the Nodemailer project provides a useful app that does the job: https://nodemailer.com/app/
- Alternatively, set the
truein your configuration file and the app will print all emails to its log.
# Configuring billing
If you need to develop features covered by the Billing EE feature, you will need to configure the platform with a set of valid Stripe API keys and an EE license.
The development-only EE licence is provided in
flowforge/forge/licensing/index.js. This licence is not valid for production usage.
For FlowForge Inc. employees the configuration is provided in 1Password as 'Stripe Testing Configuration'.
You will also need to install the Stripe CLI in order to handle webhook callbacks properly. Install the CLI following their documentation, then run the following command, with the API key using the value of
billing.stripe.key from above.
stripe listen --forward-to localhost:3000/ee/billing/callback --api-key ***
Note that due to the way Stripe works, you will receive events for all activity in the configured Stripe account. That means if someone else is actively developing with billing enabled on the same account, you will see their events arrive.
# Free Trials
Free trials are implemented as a Stripe Credit that is applied when a FlowFuse user creates their first team and completed billing sign up.
To enable trials, set the
billing.stripe.new_customer_free_credit value to a credit amount in cents. For a totally free trial, this amount should match the cost of the Stripe product for the project type to be trialed to be trialed.
The Stripe webhook forwarder must be running as the credit is handled as part of the webhook handling.
Our testing philosophy follows the principle of:
Write tests. Not too many. Mostly integration 
We create both unit tests and system level tests. The former is suitable for well-contained components that need to provide a stable api and behaviour to the rest of the code base. The latter is for testing the external behaviour of the platform as a whole with as little internal mocking as possible.
We use code coverage reporting as one aspect of assessing our testing coverage. We do not treat 100% coverage as an imperative goal - that can often lead to busy work writing tests that don't provide any real value in understanding the overall quality of the system.
Unit tests should provide sufficient coverage to give us confidence that a component's behaviour does not unexpectedly change.
# Running tests
To run the tests for the project, you can use the following npm tasks:
npm run test- runs the whole test suite, covering code linting, unit and systems tests.
npm run lint- runs the linting tests
npm run test:unit- runs the unit tests
npm run test:system- runs the system tests
npm run test:docs- checks validity of links in the documentation
# Testing against PostgreSQL
By default, the tests use an in-memory sqlite database to test against. This is the most self-contained way of testing the platform. But it is also necessary to test against PostgreSQL. To enable the use of PostgreSQL in the tests:
Ensure you have an instance of PostgreSQL running locally. For example, via docker:
docker run -it -p 5432:5432 --name ff-postgres -e POSTGRES_PASSWORD=secret postgres:14
Enable PostgreSQL mode by setting the following environment variable:
The database connection can be set using the following env vars (default values shown)
export FF_TEST_DB_POSTGRES_HOST=localhost export FF_TEST_DB_POSTGRES_PORT=5432 export FF_TEST_DB_POSTGRES_USER=postgres export FF_TEST_DB_POSTGRES_PASSWORD=secret export FF_TEST_DB_POSTGRES_DATABASE=flowforge_test
# Reporting code coverage
test:* tasks have corresponding code coverage tasks. These tasks run the tests using
nyc to generate code coverage information.
npm run cover- runs the whole test suite (excluding linting) with code coverage enabled and generates a report (via the
npm run cover:unit- runs the unit tests with code coverage enabled. It does not generate the report.
npm run cover:system- runs the system tests with code coverage enabled. It does not generate the report.
npm run cover:report- generates a report of the code coverage. This is printed to the console and generates a browsable HTML copy under
# VSCode Tips
To step debug in VSCode
Start-Watchfrom the "Run and Debug" menu
- Press ▶️ or F5 to start debugging
There are 2 other "Run and Debug" entries in the menu...
- "Attach by Process ID" - this will allow you to attach to a launched driver
- "Debug Current Test" - this will enable you to step debug a test (starts debugging the currently open test file)
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"command": "npm run start-watch",
"name": "Attach by Process ID",
"name": "Debug Current Test",
"bdd",// set to bdd, not tdd