Coumpler Guide

This comprehensive guide details the JSON configuration for all Coumpler UI components and explains how to interact with the mobile app.


Table of Contents

System Architecture Overview

🧩️

The App Builder

This web interface where you design layouts, configure URLs, and define IDs.

πŸ“±

The Mobile App

The native app (iOS*/Android) that scans your QR code and renders the UI.
* iOS is under development...

☁️

Your Server

Your own hosting. The app polls it for JSON data and sends POST requests for interactions.

πŸš€ Quick Start

Get up and running with Coumpler in less than 5 minutes. Watch the tutorial below to create your first dashboard.

  1. Click New Project in the builder sidebar.
  2. Drag a Header and a LED onto the canvas.
  3. Open Settings (βš™οΈ), add some visual changes (optional) and paste your Data URL (e.g., https://mysite.com/data.json).
  4. Select the LED and copy its ID.
  5. Save the project.
  6. Open the Coumpler Mobile App on your phone. Follow the arrows to open the menu and select Scan QR Code.
  7. Update your LED properties in your JSON file. Enjoy the results!

Simple Example: "Hello World" Dashboard

Copy this JSON into your project file to instantly create a layout with a Header and a Text block.

[
  {
    "id": "item_1767459742427_xuxwr",
    "type": "header",
    "col": 0, "row": 0, "w": 6, "h": 8,
    "props": {
      "text": "My First Dashboard",
      "align": "center",
      "bg": "#6366f1",
      "color": "#ffffff"
    }
  },
  {
    "id": "item_1767459745410_at884",
    "type": "Status",
    "props": {
      "isOn": "true",
    }
  }
]

Global Item Structure

Every element in the project JSON array follows this wrapper structure.

{
  "id": "item_unique_id",  // Unique ID
  "type": "header",      // Component Type
  "col": 0,              // X Position (0-5)
  "row": 0,              // Y Position
  "w": 6,                // Width (1-6)
  "h": 8,                // Height
  "props": { ... }       // Properties go here
}

Large text element for titles.

PropertyTypeDescription
textStringContent text.
colorHexText color.
bgHexBackground color.
sizePxFont size (e.g. "24px").
alignEnumleft, center, right.

JSON Example

"props": {
  "text": "Dashboard",
  "color": "#ffffff",
  "bg": "#6366f1",
  "size": "24px",
  "align": "center"
}

ΒΆ Text

Standard body text.

PropertyTypeDescription
textStringContent text.
colorHexText color.
sizePxFont size.
alignEnumleft, center, right.

JSON Example

"props": {
  "text": "System operating normally.",
  "color": "#a1a1aa",
  "size": "14px",
  "align": "left"
}

I Text Field

Single-line input.

updateTrigger: Can be set to immediate update (change) once checked, or on button press (button)
Please refer to linkedIds section of a Button element.

Please refer to Agent Script to send data from the app back to your server.
PropertyTypeDescription
textStringLabel text.
placeholderStringGhost text.
updateTriggerEnumchange (immediate) or button.

JSON Example

"props": {
  "text": "Username",
  "placeholder": "Enter ID...",
  "updateTrigger": "change"
}

T Text Box

Multi-line input.

updateTrigger: Can be set to immediate update (change) once checked, or on button press (button)
Please refer to linkedIds section of a Button element.

Please refer to Agent Script to send data from the app back to your server.
PropertyTypeDescription
textStringLabel text.
placeholderStringGhost text.
updateTriggerEnumchange or button.

JSON Example

"props": {
  "text": "Feedback",
  "placeholder": "Type your comments here...",
  "updateTrigger": "button"
}

β˜‘ Check Box

Single toggle boolean.

Default Value: This component defaults to unchecked. To set a default state, you must currently handle it in your external data source or use a Switch component if an 'On' state is required by default.

updateTrigger: Can be set to immediate update (change) once checked, or on button press (button)
Please refer to linkedIds section of a Button element.

Please refer to Agent Script to send data from the app back to your server.
PropertyTypeDescription
textStringLabel text.
alignEnumleft, center, right.
updateTriggerEnumchange or button.

JSON Example

"props": {
  "text": "I agree to terms",
  "align": "left",
  "updateTrigger": "change"
}

⚏ Check Group

Multiple selection list.

Default Value: Options are generated from the CSV string. All options default to unchecked in the layout configuration.

updateTrigger: Can be set to immediate update (change) once checked, or on button press (button)
Please refer to linkedIds section of a Button element.

Please refer to Agent Script to send data from the app back to your server.
PropertyTypeDescription
textStringGroup label.
optionsCSVList of options (comma separated).
updateTriggerEnumchange or button.

JSON Example

"props": {
  "text": "Select Days",
  "options": "Mon, Tue, Wed, Thu, Fri",
  "updateTrigger": "change"
}

β—‹ Radio Group

Single selection from list.

Default Value: Options are generated from the CSV string. No option is selected by default in the layout configuration.

updateTrigger: Can be set to immediate update (change) once checked, or on button press (button)
Please refer to linkedIds section of a Button element.

Please refer to Agent Script to send data from the app back to your server.
PropertyTypeDescription
textStringGroup label.
optionsCSVList of options (comma separated).
updateTriggerEnumchange or button.

JSON Example

"props": {
  "text": "Priority Level",
  "options": "Low, Medium, High",
  "updateTrigger": "change"
}

Compact single selection.

Setting Default Value: The first item in the options string is automatically selected as the default. To change the default selection, simply reorder your CSV string so your desired option appears first.

updateTrigger: Can be set to immediate update (change) once checked, or on button press (button)
Please refer to linkedIds section of a Button element.

Please refer to Agent Script to send data from the app back to your server.
PropertyTypeDescription
textStringLabel text.
optionsCSVList of options. First option is default.
updateTriggerEnumchange or button.

JSON Example

"props": {
  "text": "Destination",
  // "London" is the default because it is first
  "options": "London, New York, Tokyo",
  "updateTrigger": "change"
}

S Switch

Modern toggle.

updateTrigger: Can be set to immediate update (change) once checked, or on button press (button)
Please refer to linkedIds section of a Button element.

Please refer to Agent Script to send data from the app back to your server.
PropertyTypeDescription
textStringLabel text.
colorHexActive (On) color.
updateTriggerEnumchange or button.

JSON Example

"props": {
  "text": "Main Power",
  "color": "#ef4444",
  "updateTrigger": "change"
}

βŽ―β—‹βŽ― Slider

Range selector.

updateTrigger: Can be set to immediate update (change) once checked, or on button press (button)
Please refer to linkedIds section of a Button element.

Please refer to Agent Script to send data from the app back to your server.
PropertyTypeDescription
textStringLabel text.
minNumberMinimum value.
maxNumberMaximum value.
valueNumberDefault value.
colorHexTrack color.
updateTriggerEnumchange or button.

JSON Example

"props": {
  "text": "Volume",
  "min": 0,
  "max": 100,
  "value": 50,
  "color": "#3b82f6",
  "updateTrigger": "change"
}

πŸ’‘ LED

Status light indicator.

PropertyTypeDescription
textStringLabel text.
colorOnHexColor when active.
colorOffHexColor when inactive.
isOnBooleanInitial state.

JSON Example

"props": {
  "text": "Server Status",
  "colorOn": "#22c55e",
  "colorOff": "#333333",
  "isOn": true
}

⏲ Gauge

Speedometer style display.

PropertyTypeDescription
textStringLabel text.
valueNumberCurrent value.
minNumberMinimum scale.
maxNumberMaximum scale.
unitStringSuffix (e.g. "RPM").
colorHexArc color.

JSON Example

"props": {
  "text": "Temperature",
  "value": 72,
  "min": 0,
  "max": 100,
  "unit": "Β°F",
  "color": "#ef4444"
}

πŸ“ˆ Line Graph

Historical data chart.

PropertyTypeDescription
textStringChart title.
dataCSVY-axis values.
xLabelsCSVX-axis text labels.
xValuesCSVX-axis numeric values (optional).
colorHexLine color.
bgColorHexBackground color.
gridBooleanShow grid lines.

JSON Example

"props": {
  "text": "Monthly Sales",
  "data": "120, 150, 180, 90, 200",
  "xLabels": "Jan, Feb, Mar, Apr, May",
  "color": "#f59e0b",
  "bgColor": "#18181b",
  "grid": true
}

πŸ—ΊοΈ Map

Geographical display.

PropertyTypeDescription
textStringMap title.
latStringLatitude coordinate.
longStringLongitude coordinate.
zoomStringZoom delta level.

JSON Example

"props": {
  "text": "HQ Location",
  "lat": "37.7749",
  "long": "-122.4194",
  "zoom": "0.05"
}

πŸ–ΌοΈ Image

Static image.

PropertyTypeDescription
srcStringImage URL.

JSON Example

"props": {
  "src": "https://via.placeholder.com/600x400"
}

πŸ“· Video / Webcam

HLS Stream or Video File.

PropertyTypeDescription
urlStringSource URL (.m3u8, .mp4).
autoplayBooleanStart automatically.
mutedBooleanStart muted.
controlsBooleanShow playback controls.

JSON Example

"props": {
  "url": "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
  "autoplay": true,
  "muted": true,
  "controls": false
}

🌐 Web View

Embed external site.

PropertyTypeDescription
addressStringTarget URL.
scrollableBooleanAllow user scrolling.

JSON Example

"props": {
  "address": "https://www.google.com/maps",
  "scrollable": true
}

ℹ️ Info Display

System widgets.

PropertyTypeDescription
modeEnumdatetime or battery.
colorHexText color.
sizePxFont size.
alignEnumAlignment.

JSON Example

"props": {
  "mode": "datetime",
  "color": "#ffffff",
  "size": "16px",
  "align": "right"
}

Modal dialog. Invisible element.

This element shows popup dialog when its show property is set to true.

Please note to disable its show property to false to prevent modal to re-appear.
PropertyTypeDescription
titleStringHeader text.
messageStringBody text.
typeEnuminfo, warning, error.
buttonStringClose button text.
showBooleanTrigger to open.

JSON Example

"props": {
  "title": "Critical Error",
  "message": "Connection lost to sensor A4.",
  "type": "error",
  "button": "Retry",
  "show": false
}

⚑ Button

Action trigger.

PropertyTypeDescription
textStringButton label.
colorHexText color.
bgHexBackground color.
linkedIdsCSVIDs of other inputs to include in payload.

JSON Example

"props": {
  "text": "Save Settings",
  "color": "#ffffff",
  "bg": "#22c55e",
  "linkedIds": "input_user, switch_power"
}

πŸ”Œ Agent Script

To enable sending data from the phone back to your server, use the Agent Script.

When you interact with the app, it sends a POST request. This PHP script receives it and updates your JSON file.

Installation:
  1. Create coumpler_relay.php using the code below.
  2. Upload it to your server in the same folder as your data.json.
  3. In this Agent Script, ensure it refers to your Data JSON (i.e. $jsonFile = 'data.json';).

Example `coumpler_relay.php` Code:

<?php
// Allow access from anywhere (CORS)
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Content-Type");

$jsonFile = 'data.json';
$input = json_decode(file_get_contents('php://input'), true);

if (isset($input['id']) && isset($input['value'])) {
    if(!file_exists($jsonFile)) file_put_contents($jsonFile, '{}');
    
    $data = json_decode(file_get_contents($jsonFile), true);
    $data[$input['id']] = $input['value']; // Update the specific key
    
    file_put_contents($jsonFile, json_encode($data));
    echo json_encode(["status" => "success"]);
}
?>