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.
- Click New Project in the builder sidebar.
- Drag a Header and a LED onto the canvas.
- Open Settings (βοΈ), add some visual changes (optional) and paste your Data URL (e.g.,
https://mysite.com/data.json). - Select the LED and copy its ID.
- Save the project.
- Open the Coumpler Mobile App on your phone. Follow the arrows to open the menu and select Scan QR Code.
- 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
}
Header
Large text element for titles.
| Property | Type | Description |
|---|---|---|
| text | String | Content text. |
| color | Hex | Text color. |
| bg | Hex | Background color. |
| size | Px | Font size (e.g. "24px"). |
| align | Enum | left, center, right. |
JSON Example
"props": {
"text": "Dashboard",
"color": "#ffffff",
"bg": "#6366f1",
"size": "24px",
"align": "center"
}
Text
Standard body text.
| Property | Type | Description |
|---|---|---|
| text | String | Content text. |
| color | Hex | Text color. |
| size | Px | Font size. |
| align | Enum | left, center, right. |
JSON Example
"props": {
"text": "System operating normally.",
"color": "#a1a1aa",
"size": "14px",
"align": "left"
}
Text Field
Single-line input.
| Property | Type | Description |
|---|---|---|
| text | String | Label text. |
| placeholder | String | Ghost text. |
| updateTrigger | Enum | change (immediate) or button. |
JSON Example
"props": {
"text": "Username",
"placeholder": "Enter ID...",
"updateTrigger": "change"
}
Text Box
Multi-line input.
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.
| Property | Type | Description |
|---|---|---|
| text | String | Label text. |
| placeholder | String | Ghost text. |
| updateTrigger | Enum | change or button. |
JSON Example
"props": {
"text": "Feedback",
"placeholder": "Type your comments here...",
"updateTrigger": "button"
}
Check Box
Single toggle boolean.
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.
| Property | Type | Description |
|---|---|---|
| text | String | Label text. |
| align | Enum | left, center, right. |
| updateTrigger | Enum | change or button. |
JSON Example
"props": {
"text": "I agree to terms",
"align": "left",
"updateTrigger": "change"
}
Check Group
Multiple selection list.
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.
| Property | Type | Description |
|---|---|---|
| text | String | Group label. |
| options | CSV | List of options (comma separated). |
| updateTrigger | Enum | change or button. |
JSON Example
"props": {
"text": "Select Days",
"options": "Mon, Tue, Wed, Thu, Fri",
"updateTrigger": "change"
}
Radio Group
Single selection from list.
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.
| Property | Type | Description |
|---|---|---|
| text | String | Group label. |
| options | CSV | List of options (comma separated). |
| updateTrigger | Enum | change or button. |
JSON Example
"props": {
"text": "Priority Level",
"options": "Low, Medium, High",
"updateTrigger": "change"
}
Drop-down
Compact single selection.
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.
| Property | Type | Description |
|---|---|---|
| text | String | Label text. |
| options | CSV | List of options. First option is default. |
| updateTrigger | Enum | change or button. |
JSON Example
"props": {
"text": "Destination",
// "London" is the default because it is first
"options": "London, New York, Tokyo",
"updateTrigger": "change"
}
Switch
Modern toggle.
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.
| Property | Type | Description |
|---|---|---|
| text | String | Label text. |
| color | Hex | Active (On) color. |
| updateTrigger | Enum | change or button. |
JSON Example
"props": {
"text": "Main Power",
"color": "#ef4444",
"updateTrigger": "change"
}
Slider
Range selector.
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.
| Property | Type | Description |
|---|---|---|
| text | String | Label text. |
| min | Number | Minimum value. |
| max | Number | Maximum value. |
| value | Number | Default value. |
| color | Hex | Track color. |
| updateTrigger | Enum | change or button. |
JSON Example
"props": {
"text": "Volume",
"min": 0,
"max": 100,
"value": 50,
"color": "#3b82f6",
"updateTrigger": "change"
}
LED
Status light indicator.
| Property | Type | Description |
|---|---|---|
| text | String | Label text. |
| colorOn | Hex | Color when active. |
| colorOff | Hex | Color when inactive. |
| isOn | Boolean | Initial state. |
JSON Example
"props": {
"text": "Server Status",
"colorOn": "#22c55e",
"colorOff": "#333333",
"isOn": true
}
Gauge
Speedometer style display.
| Property | Type | Description |
|---|---|---|
| text | String | Label text. |
| value | Number | Current value. |
| min | Number | Minimum scale. |
| max | Number | Maximum scale. |
| unit | String | Suffix (e.g. "RPM"). |
| color | Hex | Arc color. |
JSON Example
"props": {
"text": "Temperature",
"value": 72,
"min": 0,
"max": 100,
"unit": "Β°F",
"color": "#ef4444"
}
Line Graph
Historical data chart.
| Property | Type | Description |
|---|---|---|
| text | String | Chart title. |
| data | CSV | Y-axis values. |
| xLabels | CSV | X-axis text labels. |
| xValues | CSV | X-axis numeric values (optional). |
| color | Hex | Line color. |
| bgColor | Hex | Background color. |
| grid | Boolean | Show 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.
| Property | Type | Description |
|---|---|---|
| text | String | Map title. |
| lat | String | Latitude coordinate. |
| long | String | Longitude coordinate. |
| zoom | String | Zoom delta level. |
JSON Example
"props": {
"text": "HQ Location",
"lat": "37.7749",
"long": "-122.4194",
"zoom": "0.05"
}
Image
Static image.
| Property | Type | Description |
|---|---|---|
| src | String | Image URL. |
JSON Example
"props": {
"src": "https://via.placeholder.com/600x400"
}
Video / Webcam
HLS Stream or Video File.
| Property | Type | Description |
|---|---|---|
| url | String | Source URL (.m3u8, .mp4). |
| autoplay | Boolean | Start automatically. |
| muted | Boolean | Start muted. |
| controls | Boolean | Show 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.
| Property | Type | Description |
|---|---|---|
| address | String | Target URL. |
| scrollable | Boolean | Allow user scrolling. |
JSON Example
"props": {
"address": "https://www.google.com/maps",
"scrollable": true
}
Info Display
System widgets.
| Property | Type | Description |
|---|---|---|
| mode | Enum | datetime or battery. |
| color | Hex | Text color. |
| size | Px | Font size. |
| align | Enum | Alignment. |
JSON Example
"props": {
"mode": "datetime",
"color": "#ffffff",
"size": "16px",
"align": "right"
}
Popup
Modal dialog. Invisible element.
show property is set to true.
Please note to disable its
show property to false to prevent modal to re-appear.| Property | Type | Description |
|---|---|---|
| title | String | Header text. |
| message | String | Body text. |
| type | Enum | info, warning, error. |
| button | String | Close button text. |
| show | Boolean | Trigger to open. |
JSON Example
"props": {
"title": "Critical Error",
"message": "Connection lost to sensor A4.",
"type": "error",
"button": "Retry",
"show": false
}
Button
Action trigger.
| Property | Type | Description |
|---|---|---|
| text | String | Button label. |
| color | Hex | Text color. |
| bg | Hex | Background color. |
| linkedIds | CSV | IDs 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.
- Create
coumpler_relay.phpusing the code below. - Upload it to your server in the same folder as your
data.json. - 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"]);
}
?>