📄 SKILL.md

← Vault

name: comercialrs-local-deploy

description: Build and deploy ComercialRS (TanStack Start/Vite) on the VPS — this machine IS the webserver, so dist files go directly to /var/www/comercialrs/dist and nginx reloads to publish.

category: devops


ComercialRS — Build & Deploy (Local = VPS)

Context

The agent environment (this machine) shares the same public IP as the ComercialRS webserver:

Common Bug: Tasks/Sales filter crashes on null dueDate/createdAt

The date filters do .split('T') on dueDate or createdAt without checking for null.

Fix pattern:

`typescript

// ANTES — crasha em tasks com dueDate=null

if (dateFrom) {

const taskDate = t.dueDate.split('T')[0];

if (taskDate < dateFrom) return false;

}

// DEPOIS

if (dateFrom) {

if (!t.dueDate) return false;

const taskDate = t.dueDate.split('T')[0];

if (taskDate < dateFrom) return false;

}

`

Alert Timer Change

In useMeetingAlerts.ts, change interval from 30000 (30s) to 150000 (2h30min):

`typescript

const interval = setInterval(check, 150000); // 2h30min

`