Skip to content

QuickStart

Rob Dobson edited this page May 3, 2026 · 2 revisions

Raft Quick Start

Install RaftCLI

To get started quickly you will need to first install the Raft command-line-interface. To do this follow the steps described at https://github.com/robdobsn/RaftCLI

The executable program is called raft

$> raft new {ProjectFolder}

This creates a new raft app in the folder {ProjectFolder} - change {ProjectFolder} to your choice of folder for the new project. You will be asked a series of questions including the name of your app, target chip, etc. See the documentation for RaftCLI for further details

A folder structure like this:

├───components
│   └───MySysMod
├───main
└───systypes
    ├───Common
    │   ├───FSImage
    │   └───WebUI
    └───SysTypeMain

In a raft application the main app funcitonality is built in the components folder. In this example, the MySysMod folder contains file MySysMod.cpp:

void MySysMod::setup()
{
    // Code to setup your app - like Arduino setup()
}

void MySysMod::loop()
{
    // Called frequently - like Arduino loop()
}

This should be reasonably familiar to anyone who has programmed an Arduino. However this is no ordinary Arduino program:

  • app initialisation including WiFi and Bluetooth Low-Energy connectivity, WebServer, etc are all taken care of and configured using the JSON document defined by the SysType which can be found in the systypes/SysTypeMain folder in this example
  • the setup function has access to a powerful JSON-based configuration system
  • multiple SysMods can be added to split-up application functionality and inter-SysMod communication is also available
  • REST API endpoints can be registered by any SysMod and these enable sophisticated communications functionlity over WiFi, BLE, ethernet and serial connections

Next: build your first SysMod

Ready to put real behaviour behind that empty setup() / loop()? Head to Writing Your First SysMod for an end-to-end walkthrough — registering a REST endpoint, reading typed values out of the JSON configuration, publishing state through StatePublisher, and wiring the SysMod into your SysType so it builds and runs on the device. From there, Architecture at a Glance and the SysMods reference fill in the bigger picture.

Clone this wiki locally