FlowFuse / FlowFuse/device-agent

Device Agent onboarding from scratch

Open
#678 5 comments 0 reactions 1 assignee Claimed by @knolleary View on GitHub
initiative:release-2.33
Dominant language
JavaScript
Stars
20
Forks
10
Avg merge
9d 4h
Merged PRs (30d)
9

Description

As a user, I want to get started with FlowFuse as easily as possible, starting with installing Node-RED locally to start building.

Currently, to achieve this, I first need to sign-up for a FF account. Find the 'remote instance' section. Learn about the device agent. Create a new remote instance in the platform, copy its connection details. Run the device agent installer and provide it the signup code to get it connected.

We need to continue making the 'getting started with FlowFuse' experience much smoother for Remote Instances.

The goal here is to identify substantive improvements to the one-line installer that helps get you signed up and connected in as few steps as possible.

There are growing numbers of examples of one-liner setup scripts that walk the user through a sign-up and onboarding experience. For example Claude Code CLI.

---

The existing installer makes some opinionated choices that the user has no control over.
- Installs node.js
- Sets up a service to run the device agent automatically
- It expects you to provide a OTC for a device in order to automatically configure its connection, otherwise, leaves it to you to run

It also suffers from resulting in a wall of text.

### Requirements:

- Improve the visual UX of the installer.
- Use text effects (bold) and colour to help format and structure the output
- When moving between questions, erase now irrelevant text - leave behind what's useful to see
- Improve the visual UX of the Device Agent's own setup questions
- Currently, the installer passes over to the device agent to complete setup. The visual output changes in subtle ways - doesn't feel as joined up. They need to be consistent.
- Ask more guided questions to make certain parts optional
- **Include a step to interactively get the agent registered on their platform** - delivered in DA 4.2.0
- This is the headline of this feature. If they don't provide a OTC on the command-line, it needs to help them get setup.

### Installer steps

When the user runs the installer for the first time (without a OTC token), this is the sequence they should be taken through.

The Device Agent registration part was delivered in 4.2.0. The remain work is to make the installer wrapper less opinionated and more helpful.

```mermaid
flowchart TD
subgraph "installer"
direction TB
A[Welcome] --> INSTALL_LOCATION
INSTALL_LOCATION{ASK\n Install location\n 1. default\n 2. custom} --> B{CHECK\nIs node.js on path and what version?}
B -->|< Node 22| C[Old Node.js version] --> G
B -->|>= Node 22 | D[Existing Node.js version] --> F
B -->|none| E[No Node.js version] --> G
F{ASK\n 1. Use existing version\n 2.Install dedicated version}
G{ASK\nInstall dedicated version?}
G --> |no| Exit
G --> |yes| H[Install node.js in local dir]
F --> |2. Install| H --> J
F --> |1. use existing| J
J[Install Device Agent] --> RUNDA
RUNDA[Run Device Agent] --> OTCCHECK
subgraph "device agent"
OTCCHECK{CHECK\nOTC Provided on command-line}
OTCCHECK --> | yes | N
OTCCHECK --> | no | K
K{ASK\nFlowFuse Platform login\n1. Connect to FF account\n2. I have a setup code }
K --> |1. Connect to FF account| GetURL
K --> |2. Setup code| M
M[Enter setup code] --> N
N[Connect using code and complete setup]
GetURL{ASK: Get FF URL \n default: app.flowfuse.com}
GetURL --> StartLogin[HTTP POST /something/auth/device-registration]
StartLogin --> | RESP: loginUrl, doneUrl | DirectToLogin[Show loginUrl\n Open in browser]
DirectToLogin -.-> PollDone[Poll doneUrl until 200 response]
PollDone --> | RESP: deviceOTC | N
end
N-->O
O{ASK\nRun Device Agent as a service?}
O --> |yes| P
O --> |no| Q
P[Setup service] --> R
R[Show instructions on using service] --> END
Q[Show instructions on standalone running] --> END
END[Show final summary\nInclude URL of device on FF platform]
end
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.