Skip to main content

signaloid-cli init web-app

Produce a new Signaloid web application with template project structure and configuration files.

Synopsis​

signaloid-cli init web-app [--json-input <path>] [--json-output <path>]

Options​

OptionDescription
--json-input <path>Read configuration from a JSON file instead of prompting interactively
--json-output <path>Write the configuration of the generated web application to a JSON file

Description​

Generates a graphical web interface for a C/C++ application that uses Signaloid's UxHw® API, to visualize how changes in input parameter distributions affect the distribution of the application's outputs. The generated web application interacts with the Signaloid Cloud Compute Engine to launch accelerated executions of the back-end application and return its results.

Requirements​

C/C++ Application Requirements​

To generate a web app, the back-end C/C++ application must:

  • Accept command-line arguments
  • Export output in JSON format
  • Be stored in a GitHub repository

Signaloid provides common utility routines, a small library that can parse arguments and prepare JSON output. See this minimal C code application for a working example.

Usage​

signaloid-cli init web-app

Follow the prompts. Default values are provided for all inputs.

For the default Signaloid C application, leave all options at their default values.

Prompts​

PromptDefaultDescription
Project namesignaloid-cli-demoLocal directory for the generated web app
Title—Title displayed at the top of the web app
Short description—Description displayed below the title
Core IDCore ID for C0Pro-M+Signaloid core type that runs the application. See signaloid-cli cores list --default
GitHub repository URLhttps://github.com/signaloid/Signaloid-CLI-Demo-C-TemplateHTTPS URL of the repository
CommitHEADGit commit to build
BranchmainGit branch to build
Build directorysrc/Directory in the repository containing the source code
Application arguments(empty)Optional command-line arguments passed to the application

Interactive Inputs​

Your web app can have one or more interactive inputs that dynamically pass data to the C/C++ application. For each input, specify:

  • Type: the front-end element and its data type
    • Basic slider: a single numeric value
    • Distributional slider: a numeric distribution
    • Number input: a box to enter a number
    • Multiple choice: a radio button to choose one of the defined options
  • Argument flag: the command-line option that passes this input to the C/C++ application

For the default Signaloid C application, create 1 input of type "distributional slider" with argument flag -k.

Running the Generated App​

cd <project-name>
npm start

Examples​

Interactive setup (recommended):

signaloid-cli init web-app

Non-interactive setup using a JSON config file:

signaloid-cli init web-app --json-input config.json

Save configuration to a JSON file for reuse:

signaloid-cli init web-app --json-output saved-config.json

See Also​