Back to Library

Deploy Service Bot + Dashboard

salesiq_bot/DEPLOY_ALL.md document
Updated: 2026-03-07 02:45
# Deploy Service Bot + Dashboard

## Quick Deploy All

```bash
# Copy all files
cp /root/.openclaw/workspace/salesiq_bot/service_agent.py /opt/kb_website/service_agent.py
cp /root/.openclaw/workspace/salesiq_bot/dashboard.py /opt/kb_website/dashboard.py

# Install requests (for dashboard health checks)
cd /opt/zoho-extract && source venv/bin/activate
pip install requests

# Create Service Agent service (port 5004)
cat > /etc/systemd/system/service-agent.service << 'EOF'
[Unit]
Description=ROLLerUP Service AI Agent
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/opt/kb_website
Environment=PATH=/opt/zoho-extract/venv/bin
ExecStart=/opt/zoho-extract/venv/bin/python service_agent.py
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

# Create Dashboard service (port 5005)
cat > /etc/systemd/system/bot-dashboard.service << 'EOF'
[Unit]
Description=ROLLerUP Bot Dashboard
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/opt/kb_website
Environment=PATH=/opt/zoho-extract/venv/bin
ExecStart=/opt/zoho-extract/venv/bin/python dashboard.py
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

# Start services
systemctl daemon-reload
systemctl enable service-agent bot-dashboard
systemctl start service-agent bot-dashboard

# Check status
systemctl status service-agent
systemctl status bot-dashboard
```

## Add DNS Records (in Kinsta)

| Host | Type | Value |
|------|------|-------|
| service | A | 68.183.198.0 |
| dashboard | A | 68.183.198.0 |

## Update Caddy

```bash
nano /etc/caddy/Caddyfile
```

Add:
```
service.rollerup.ca {
    reverse_proxy localhost:5004
}

dashboard.rollerup.ca {
    reverse_proxy localhost:5005
}
```

Then:
```bash
systemctl reload caddy
```

## Test

```bash
# Service bot
curl http://localhost:5004/health
curl -X POST http://localhost:5004/webhook/salesiq \
  -H "Content-Type: application/json" \
  -d '{"message":{"text":"my shutter is stuck"}}'

# Dashboard
curl http://localhost:5005/health
curl http://localhost:5005/api/stats

# After DNS propagates
curl https://service.rollerup.ca/health
curl https://dashboard.rollerup.ca/health
```

## Configure SalesIQ Webhook for Service Bot

Create a SEPARATE bot in SalesIQ for service, with webhook:
```
https://service.rollerup.ca/webhook/salesiq
```

## Port Map (Updated)

| Port | Service | Domain |
|------|---------|--------|
| 5000 | kb-website | kb.rollerup.ca |
| 5001 | onboarding | - |
| 5002 | sales-agent | bot.rollerup.ca |
| 5003 | fsm | fsm.rollerup.ca |
| 5004 | service-agent | service.rollerup.ca |
| 5005 | dashboard | dashboard.rollerup.ca |

## Database Tables Created

- `zoho.bot_conversations` - Sales bot chats
- `zoho.service_conversations` - Service bot chats

## Dashboard Features

- **Auto-refresh** every 60 seconds
- **Service health** monitoring
- **Chat volume** (today, week, total)
- **Lead conversion rate** tracking
- **Recent conversations** list
- **Alerts** for services down

Access at: https://dashboard.rollerup.ca