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
| Option | Description |
|---|---|
--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
- A Signaloid API key. Sign in to the Signaloid Cloud Developer Platform and go to
Settings > Cloud Engine API. - A GitHub Access Token with
repoandread:packagesscopes. See GitHub docs. - To run applications from private repositories, sign in to GitHub from the Signaloid Cloud Developer Platform.
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
| Prompt | Default | Description |
|---|---|---|
| Project name | signaloid-cli-demo | Local directory for the generated web app |
| Title | — | Title displayed at the top of the web app |
| Short description | — | Description displayed below the title |
| Core ID | Core ID for C0Pro-M+ | Signaloid core type that runs the application. See signaloid-cli cores list --default |
| GitHub repository URL | https://github.com/signaloid/Signaloid-CLI-Demo-C-Template | HTTPS URL of the repository |
| Commit | HEAD | Git commit to build |
| Branch | main | Git branch to build |
| Build directory | src/ | 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
- signaloid-cli cores list - List available cores
- signaloid-cli repos connect - Connect a repository
- signaloid-cli builds create:repo - Create a build from a repository