# Dashboard & Kanban Server - Quick Start

## TL;DR

```bash
cd /home/isthekid/.openclaw/workspace
./start-server.sh
```

Then open in browser:
- Dashboard: http://localhost:8080/dashboard/
- Kanban: http://localhost:8080/kanban/

Stop with:
```bash
./stop-server.sh
```

---

## Why Use the Server?

**Problem:** Opening `index.html` directly (`file://`) fails to load updated `data.json` due to browser CORS restrictions.

**Solution:** Run a simple Python HTTP server. No rebuild steps needed—browser always fetches latest data.

---

## Commands

### Start server
```bash
./start-server.sh
```

### Check if running
```bash
ps aux | grep serve.py
```

### View logs
```bash
tail -f /tmp/workspace-server.log
```

### Stop server
```bash
./stop-server.sh
```

### Run in foreground (for debugging)
```bash
python3 serve.py
# Press Ctrl+C to stop
```

---

## Windows Desktop Shortcuts

Create these files on your Windows desktop for quick access:

### Dashboard.url
```ini
[InternetShortcut]
URL=http://localhost:8080/dashboard/
```

### Kanban.url
```ini
[InternetShortcut]
URL=http://localhost:8080/kanban/
```

Just double-click to open!

---

## Troubleshooting

### Port 8080 already in use
Edit `serve.py` and change `PORT = 8080` to another port (e.g., `8000`, `3000`, `8888`).

### Server won't start
Check logs:
```bash
cat /tmp/workspace-server.log
```

### Can't access from Windows browser
1. Make sure server is running in WSL: `ps aux | grep serve.py`
2. Test from WSL first: `curl http://localhost:8080/dashboard/`
3. Windows should auto-forward `localhost` to WSL

### Stale data in browser
Hard refresh:
- Chrome/Edge: `Ctrl+Shift+R`
- Firefox: `Ctrl+F5`

---

## Auto-Start Server (Optional)

Add to `~/.bashrc` to auto-start on WSL launch:

```bash
# Auto-start dashboard server
if ! pgrep -f "python3.*serve.py" > /dev/null 2>&1; then
  /home/isthekid/.openclaw/workspace/start-server.sh > /dev/null 2>&1
fi
```

---

## Alternative: Watch & Auto-Rebuild (File:// Workflow)

If you prefer `file://` for offline access:

```bash
./watch-and-rebuild.sh
```

This watches `data.json` files and auto-rebuilds HTML embeds.

**Note:** Requires `inotify-tools`:
```bash
sudo apt update && sudo apt install -y inotify-tools
```

---

## Files Reference

- `serve.py` - HTTP server (port 8080)
- `start-server.sh` - Start server in background
- `stop-server.sh` - Stop server
- `watch-and-rebuild.sh` - Alternative: auto-rebuild watcher
- `dashboard-kanban-review.md` - Full technical analysis

---

**Questions?** Check `dashboard-kanban-review.md` for detailed documentation.
