hub Svelte Themes

Hub

Personal dashboard — trigger agents, run tools, and manage your workflows. Built with Go + Svelte

Hub

Your personal dashboard — a local web UI for triggering AI agents, running calculations, monitoring markets, and whatever else you need. Organized by topic, extensible by design.

Stack

Layer Technology
Backend Go — HTTP server, WebSocket streaming, process management
Frontend Svelte + Tailwind CSS — reactive UI, dark mode
Containerization Docker + Docker Compose

Features

  • Topic-based sidebar — collapsible groups with subtopics on the left panel
  • Live output streaming — agent stdout/stderr streamed line-by-line via WebSocket into a terminal display
  • Work Time Calculator — calculate worked hours with break deduction (no agent needed)
  • Market Analysis — trigger Claude to analyze commodities and gold markets
  • Free-form Agent Runner — run any prompt against Claude or Codex
  • Single binary deployment — Go serves both the API and the built Svelte frontend

Project Structure

hub/
├── ANALYSIS.md             # Architecture decisions and design notes (for agents)
├── README.md               # This file
├── Dockerfile              # Multi-stage build: Node → Go → Alpine
├── docker-compose.yml      # One-command run
├── Makefile                # Local dev commands
│
├── backend/
│   ├── main.go             # HTTP server, routes
│   ├── go.mod / go.sum
│   ├── api/
│   │   ├── agents.go       # POST /api/agents/trigger, GET /api/agents
│   │   └── ws.go           # WebSocket /ws/agents/:id
│   └── agent/
│       ├── runner.go       # os/exec wrapper, streams stdout/stderr
│       └── manager.go      # Tracks agent state (pending/running/done/error)
│
└── frontend/
    ├── src/
    │   ├── App.svelte              # Root layout
    │   ├── topics.js               # Sidebar registry — add new topics here
    │   ├── components/
    │   │   ├── Sidebar.svelte      # Collapsible left panel
    │   │   ├── ContentArea.svelte  # Dynamic right panel
    │   │   └── OutputTerminal.svelte # Live streaming terminal UI
    │   ├── lib/
    │   │   ├── api.js              # Fetch wrappers for Go API
    │   │   └── websocket.js        # WebSocket stream manager
    │   └── topics/
    │       ├── market/Commodities.svelte
    │       ├── market/Gold.svelte
    │       ├── work/WorkTime.svelte
    │       └── agents/AgentRunner.svelte
    └── package.json

Requirements: Docker, Docker Compose

# Build and start
docker compose up --build

# Start in background
docker compose up --build -d

# Stop
docker compose down

App will be available at http://localhost:8080

Running locally (dev mode)

Requirements: Go 1.22+, Node.js 18+

# 1. Install frontend dependencies
make install

# 2. Start backend (terminal 1)
make dev-backend     # runs on :8080

# 3. Start frontend dev server (terminal 2)
make dev-frontend    # runs on :5173, proxies /api and /ws to :8080

Open http://localhost:5173 for dev (hot reload enabled).

Production build (no Docker)

make build           # builds frontend + Go binary into dist/
./dist/dashboard     # serves everything on :8080

Adding a new topic

  1. Create a Svelte component in frontend/src/topics/<group>/<Name>.svelte
  2. Add an entry to frontend/src/topics.js:
import MyPage from './topics/mygroup/MyPage.svelte'

// Add to the topics array:
{
  id: 'mygroup',
  label: 'My Group',
  icon: '🔧',
  subtopics: [
    { id: 'mypage', label: 'My Page', component: MyPage },
  ],
}
  1. Rebuild (docker compose up --build or make build)

API Reference

Method Endpoint Description
POST /api/agents/trigger Trigger a new agent
GET /api/agents/ List all agents
GET /api/agents/:id Get agent by ID
WS /ws/agents/:id Stream agent output

Trigger request body:

{
  "name": "My Agent",
  "command": "claude",
  "args": ["-p", "Your prompt here"]
}

Requirements for AI agents

The claude and codex CLI tools must be installed and authenticated on the host machine (or inside the container) for the Market and Agent Runner pages to work.

  • Claude CLI: install via npm install -g @anthropic-ai/claude-code
  • Codex CLI: install via npm install -g @openai/codex

Top categories

Loading Svelte Themes