lobsterboard 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,156 +1,228 @@
1
1
  # 🦞 LobsterBoard
2
2
 
3
- A drag-and-drop dashboard builder for creating beautiful, customizable status boards.
3
+ A self-hosted, drag-and-drop dashboard builder with live system monitoring, dark theme, and 47 widgets. No cloud dependencies.
4
4
 
5
5
  ![LobsterBoard](lobsterboard-logo-final.png)
6
6
 
7
- ## Features
8
-
9
- - **Visual Builder**: Drag and drop widgets onto a grid
10
- - **47+ Widgets**: Weather, clocks, system stats, AI usage, and more
11
- - **Dark Theme**: Easy on the eyes, perfect for always-on displays
12
- - **Export to HTML**: Single-file dashboards that run anywhere
13
- - **No Backend Required**: Many widgets work with just a browser
14
-
15
7
  ## Quick Start
16
8
 
17
- 1. Open `index.html` in your browser
18
- 2. Drag widgets from the sidebar onto the canvas
19
- 3. Click widgets to edit their properties
20
- 4. Click **Export Dashboard** to download your dashboard
21
-
22
- ## Widget Categories
23
-
24
- ### ✅ Works Out of Box (No API Needed)
25
- These widgets work immediately with no configuration:
26
- - Weather (wttr.in)
27
- - Clock, World Clock
28
- - Countdown, Pomodoro Timer
29
- - Images (local, web, random rotation)
30
- - Quick Links
31
- - Iframe Embed
32
- - Release Tracker (GitHub public API)
33
-
34
- ### 🦞 OpenClaw Widgets
35
- These widgets connect to a running [OpenClaw](https://github.com/openclaw/openclaw) gateway:
36
- - Auth Status
37
- - OpenClaw Release
38
- - Activity List
39
- - Cron Jobs
40
- - System Log
41
- - Session Count
42
- - Token Gauge
43
-
44
- **See [Using OpenClaw Widgets](#using-openclaw-widgets) below.**
45
-
46
- ### 🔑 API Key Required
47
- These widgets need you to provide an API key:
48
- - News Ticker (NewsAPI)
49
- - Stock Ticker (Finnhub)
50
- - GitHub Stats (optional, for higher rate limits)
51
-
52
- ### ⚠️ Custom Backend Required
53
- These widgets need custom API endpoints:
54
- - AI Usage (Claude, GPT, Gemini)
55
- - CPU/Memory, Disk Usage
56
- - Docker Containers
57
- - And more...
58
-
59
- ---
60
-
61
- ## Using OpenClaw Widgets
62
-
63
- OpenClaw widgets fetch data from your local OpenClaw gateway. Due to browser CORS restrictions, you need to either:
64
-
65
- ### Option A: Use the Included Server (Recommended)
9
+ ### Option A: npm install
66
10
 
67
- The server proxies API requests to OpenClaw, solving CORS issues.
68
-
69
- 1. **Export your dashboard** from the builder (Download button)
70
-
71
- 2. **Extract the ZIP** to a folder
72
-
73
- 3. **`server.js` is included** in the exported ZIP
74
-
75
- 4. **Run the server**:
76
- ```bash
77
- cd your-dashboard-folder
78
- node server.js
79
- ```
80
-
81
- 5. **Open** http://localhost:8080 in your browser
82
-
83
- **Configuration** (environment variables):
84
11
  ```bash
85
- # Custom port for the dashboard server
86
- PORT=3000 node server.js
87
-
88
- # Custom OpenClaw gateway URL (if not on default port 18789)
89
- OPENCLAW_URL=http://localhost:YOUR_PORT node server.js
90
-
91
- # Expose to network (⚠️ only on trusted networks!)
92
- HOST=0.0.0.0 node server.js
12
+ npm install lobsterboard
13
+ cd node_modules/lobsterboard
14
+ node server.cjs
93
15
  ```
94
16
 
95
- > **⚠️ Non-Default Gateway Port?**
96
- >
97
- > If your OpenClaw gateway runs on a port other than `18789` (the default), you **must** set the `OPENCLAW_URL` environment variable. Check your gateway port:
98
- > ```bash
99
- > grep '"port"' ~/.openclaw/openclaw.json
100
- > ```
101
- > Then start the server with:
102
- > ```bash
103
- > OPENCLAW_URL=http://localhost:YOUR_PORT node server.js
104
- > ```
17
+ ### Option B: Clone & Run
105
18
 
106
- ### Option B: Run OpenClaw with CORS Headers
19
+ ```bash
20
+ git clone https://github.com/curbob/LobsterBoard.git
21
+ cd LobsterBoard
22
+ npm install
23
+ node server.cjs
24
+ ```
107
25
 
108
- If you control your OpenClaw config, you can add CORS headers directly.
26
+ Open **http://localhost:8080** press **Ctrl+E** to enter edit mode drag widgets from the sidebar → click **💾 Save**.
109
27
 
110
- ---
28
+ ## How It Works
111
29
 
112
- ## Exporting Dashboards
30
+ LobsterBoard runs as a single Node.js server (`server.cjs`) that:
113
31
 
114
- 1. Click the **💾 Export** button in the toolbar
115
- 2. Choose **Download Dashboard**
116
- 3. A ZIP file is created containing:
117
- - `index.html` - Your complete dashboard
118
- - `server.js` - Server for OpenClaw widgets (optional)
119
- - Any embedded images
32
+ - **Serves the dashboard** a vanilla JS single-page app (no build step, no frameworks)
33
+ - **Saves/loads config** — `GET/POST /config` persists your layout to `config.json`
34
+ - **Streams live system stats** CPU, memory, disk, network, and Docker container data via Server-Sent Events (`/api/stats/stream`) using [systeminformation](https://github.com/nicholasricci/systeminformation)
35
+ - **Proxies external feeds** — iCal calendars (`/api/calendar`), RSS feeds (`/api/rss`) fetched server-side to avoid CORS issues
36
+ - **Provides API endpoints** todos, cron jobs, system logs, auth status, release checks, and today's activity summary
120
37
 
121
- The exported HTML is self-contained and can be:
122
- - Opened directly in a browser (for non-API widgets)
123
- - Served via the included Node.js server
124
- - Hosted on any static web server
38
+ The server binds to `127.0.0.1:8080` by default. Configure with environment variables:
125
39
 
126
- ---
40
+ ```bash
41
+ PORT=3000 node server.cjs # Custom port
42
+ HOST=0.0.0.0 node server.cjs # Expose to network (trusted networks only!)
43
+ ```
127
44
 
128
- ## Development
45
+ ## Edit Mode
46
+
47
+ Press **Ctrl+E** (or click **Edit Layout**) to toggle edit mode:
48
+
49
+ - **Drag widgets** from the sidebar onto the canvas
50
+ - **Click a widget** to select it and edit properties in the right panel
51
+ - **Drag to reposition**, resize with the corner handle
52
+ - **20px snap grid** keeps things aligned
53
+ - **Canvas sizes** — 1920×1080, 2560×1440, or custom
54
+ - **Font scale** — adjust text size globally across all widgets
55
+ - Click **💾 Save** to persist, then exit edit mode for the live dashboard
56
+
57
+ In view mode, the canvas auto-scales to fit your browser window and all widget scripts run live.
58
+
59
+ ## Widgets (47)
60
+
61
+ ### 🖥️ System Monitoring
62
+ Live data via SSE — updates every 2–30 seconds automatically.
63
+
64
+ | Widget | Description |
65
+ |--------|-------------|
66
+ | 💻 CPU / Memory | Real-time CPU load and memory usage |
67
+ | 💾 Disk Usage | Disk space with ring gauge (configurable mount point) |
68
+ | 🌐 Network Speed | Upload/download throughput |
69
+ | 📡 Uptime Monitor | System uptime, CPU load, and memory summary |
70
+ | 🐳 Docker Containers | Container list with running/stopped status |
71
+
72
+ ### 🦞 OpenClaw Integration
73
+ For users running [OpenClaw](https://github.com/openclaw/openclaw).
74
+
75
+ | Widget | Description |
76
+ |--------|-------------|
77
+ | 🔐 Auth Status | Anthropic Max subscription vs. API key indicator |
78
+ | 🦞 OpenClaw Release | Auto-detects installed version, compares to latest GitHub release |
79
+ | 📋 Activity List | Today's activity from memory files, git commits, and cron runs |
80
+ | ⏰ Cron Jobs | Scheduled jobs with status and last-run times |
81
+ | 🔧 System Log | Parsed gateway log with level/category color coding |
82
+ | 💬 Active Sessions | Count of active OpenClaw sessions |
83
+ | 📊 Token Gauge | Visual gauge of token usage against a limit |
84
+
85
+ ### 🤖 AI / LLM Monitoring
86
+
87
+ | Widget | Description |
88
+ |--------|-------------|
89
+ | 🟣 Claude Usage | Anthropic API token/cost tracking |
90
+ | 🟢 GPT Usage | OpenAI API token/cost tracking |
91
+ | 🔵 Gemini Usage | Google API token/cost tracking |
92
+ | 🤖 AI Usage (All) | Combined multi-provider view |
93
+ | 💰 AI Cost Tracker | Total AI spending across providers |
94
+
95
+ ### ⏰ Time & Productivity
96
+
97
+ | Widget | Description |
98
+ |--------|-------------|
99
+ | 🕐 Clock | Digital clock (12h/24h) |
100
+ | 🌍 World Clock | Multiple time zones side by side |
101
+ | ⏳ Countdown | Days (and optionally hours/minutes) to a target date |
102
+ | 🎯 Pomodoro Timer | Focus timer with work/break intervals and audio alerts |
103
+ | ✅ Todo List | Persistent task list with checkboxes (saved to `todos.json`) |
104
+ | 📅 Calendar | Upcoming events from any iCal (.ics) feed URL |
105
+ | 📝 Notes | Editable text area on the dashboard |
106
+
107
+ ### 🌤️ Weather
108
+
109
+ | Widget | Description |
110
+ |--------|-------------|
111
+ | 🌡️ Local Weather | Current conditions via wttr.in (no API key needed) |
112
+ | 🌍 World Weather | Multiple cities side by side |
113
+
114
+ ### 💰 Finance
115
+
116
+ | Widget | Description |
117
+ |--------|-------------|
118
+ | 📈 Stock Ticker | Stock prices (requires Finnhub API key) |
119
+ | ₿ Crypto Price | Cryptocurrency prices from CoinGecko (free) |
120
+
121
+ ### 🏠 Smart Home
122
+
123
+ | Widget | Description |
124
+ |--------|-------------|
125
+ | 🏠 Indoor Climate | Temperature/humidity from sensor API |
126
+ | 📷 Camera Feed | Live MJPEG camera stream |
127
+ | 🔌 Power Usage | Real-time power consumption |
128
+
129
+ ### 📰 Media & Content
130
+
131
+ | Widget | Description |
132
+ |--------|-------------|
133
+ | 📰 RSS Ticker | Headlines from any RSS/Atom feed (server-side proxy) |
134
+ | 🎵 Now Playing | Currently playing track from Spotify/music API |
135
+ | 💭 Quote of Day | Random inspirational quotes |
136
+ | 📧 Unread Emails | Email count from API endpoint |
137
+
138
+ ### 🔗 Embeds & Media
139
+
140
+ | Widget | Description |
141
+ |--------|-------------|
142
+ | 🖼️ Image | Local/embedded image (base64 for portability) |
143
+ | 🎲 Random Image | Rotates through multiple images on a timer |
144
+ | 🌐 Image Embed | Display an image from a URL |
145
+ | 🔗 Quick Links | Bookmark grid with favicons |
146
+ | 📺 Iframe Embed | Embed any web page |
147
+
148
+ ### 📦 Utilities
149
+
150
+ | Widget | Description |
151
+ |--------|-------------|
152
+ | 📦 Release Tracker | Compare local version to latest GitHub release for any repo |
153
+ | 🔄 API Status | Health check indicators for multiple endpoints |
154
+ | 🐙 GitHub Stats | Public repo/follower/star counts for any user |
155
+ | 😴 Sleep Score | Sleep data ring gauge (health API integration) |
156
+
157
+ ### 🎨 Layout
158
+
159
+ | Widget | Description |
160
+ |--------|-------------|
161
+ | 🔤 Header / Text | Custom text with configurable font size, color, weight, and alignment |
162
+ | ➖ Horizontal Line | Divider line (adjustable color and thickness) |
163
+ | │ Vertical Line | Vertical divider |
164
+
165
+ ## Configuration
166
+
167
+ Widget properties are edited in the right-hand panel when a widget is selected in edit mode. Common options:
168
+
169
+ - **Title** — display name and header visibility toggle
170
+ - **Refresh Interval** — how often the widget polls for data (seconds)
171
+ - **Endpoint** — API URL for data-driven widgets
172
+ - **Location** — city name for weather widgets
173
+ - **iCal URL** — feed URL for the calendar widget (Google Calendar, Outlook, Apple Calendar all supported)
174
+ - **Feed URL** — RSS/Atom feed for the ticker widget
175
+
176
+ All configuration is saved to `config.json` in the project root.
177
+
178
+ ## API Endpoints
179
+
180
+ | Endpoint | Method | Description |
181
+ |----------|--------|-------------|
182
+ | `/config` | GET/POST | Load/save dashboard layout |
183
+ | `/api/stats` | GET | Current system stats (JSON snapshot) |
184
+ | `/api/stats/stream` | GET | Live system stats (SSE, max 10 connections) |
185
+ | `/api/todos` | GET/POST | Read/write todo list |
186
+ | `/api/calendar?url=&max=` | GET | Proxy + parse iCal feed |
187
+ | `/api/rss?url=` | GET | Proxy RSS/Atom feed |
188
+ | `/api/cron` | GET | OpenClaw cron job status |
189
+ | `/api/logs` | GET | Last 50 gateway log lines |
190
+ | `/api/system-log` | GET | Structured log entries with levels |
191
+ | `/api/auth` | GET | OpenClaw auth profile info |
192
+ | `/api/releases` | GET | OpenClaw version check (cached 1hr) |
193
+ | `/api/today` | GET | Today's activity summary |
194
+ | `/api/activity` | GET | Recent entries from memory file |
195
+
196
+ ## File Structure
129
197
 
130
- ### File Structure
131
198
  ```
132
199
  dashboard-builder/
133
- ├── index.html # Main builder UI
134
- ├── css/
135
- │ └── styles.css # Dashboard styles
200
+ ├── server.cjs # Node.js server (CommonJS)
201
+ ├── index.html # Single-page app
202
+ ├── config.json # Saved dashboard layout
203
+ ├── todos.json # Todo list data
136
204
  ├── js/
137
- │ ├── builder.js # Builder logic
138
- │ └── widgets.js # Widget definitions
139
- ├── server.js # Node.js server for exports
140
- └── WIDGETS-STATUS.md # Widget verification status
205
+ │ ├── builder.js # Canvas, drag-drop, edit mode, zoom, config I/O
206
+ │ └── widgets.js # All 47 widget definitions + SSE helpers
207
+ ├── css/
208
+ └── builder.css # Dark theme (CSS custom properties)
209
+ └── package.json # npm package config
141
210
  ```
142
211
 
143
- ### Adding New Widgets
212
+ ## npm Package
144
213
 
145
- See `js/widgets.js` for widget definitions. Each widget has:
146
- - `name`, `icon`, `category`
147
- - `description` - Shows in properties panel
148
- - `defaultWidth`, `defaultHeight`
149
- - `properties` - Configurable options
150
- - `generateHtml()` - Returns widget HTML
151
- - `generateJs()` - Returns widget JavaScript
214
+ LobsterBoard is published as `lobsterboard` on npm. The package exports:
152
215
 
153
- ---
216
+ ```js
217
+ // ESM
218
+ import { WIDGETS } from 'lobsterboard/widgets';
219
+ import { state } from 'lobsterboard/builder';
220
+
221
+ // UMD (browser)
222
+ <script src="https://unpkg.com/lobsterboard"></script>
223
+ ```
224
+
225
+ Requires Node.js ≥ 16.
154
226
 
155
227
  ## License
156
228
 
@@ -158,4 +230,4 @@ MIT
158
230
 
159
231
  ---
160
232
 
161
- Made with 🦞 by the LobsterBoard team
233
+ Made with 🦞 by [curbob](https://github.com/curbob)
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { fileURLToPath } from 'node:url';
4
+ import { dirname, join } from 'node:path';
5
+ import { fork } from 'node:child_process';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+ const packageDir = join(__dirname, '..');
10
+
11
+ const child = fork(join(packageDir, 'server.cjs'), {
12
+ cwd: packageDir,
13
+ env: { ...process.env },
14
+ stdio: 'inherit'
15
+ });
16
+
17
+ child.on('exit', (code) => process.exit(code ?? 0));