Skip to content

Vercel

Abacus is designed to run on Vercel with a Postgres database. This guide covers production deployment and automated syncing.

Deployment

  1. Deploy via the button in the README or connect your fork to Vercel
  2. Add a Postgres database via the Vercel Marketplace:
    • Go to Storage tab in your Vercel project
    • Click Connect DatabaseNeon Postgres
    • Follow the prompts to create or link a database
    • This automatically sets POSTGRES_URL in your environment
  3. Set environment variables (see Environment Variables)
  4. Deploy - migrations run automatically on build

Automated Syncing

Abacus uses Vercel cron jobs to keep data current. These run automatically once deployed.

Cron Schedule

EndpointSchedulePurpose
/api/cron/sync-anthropicDaily at 6 AM UTCSync recent Claude Code usage
/api/cron/sync-cursorHourlySync recent Cursor usage
/api/cron/backfill-anthropicEvery 6 hoursBackfill historical Claude Code data
/api/cron/backfill-cursorEvery 6 hoursBackfill historical Cursor data
/api/cron/backfill-githubEvery 6 hoursBackfill GitHub commits (90 days)
/api/cron/sync-github-mappingsDailySync GitHub user mappings

Cron Authentication

All cron endpoints require CRON_SECRET. Vercel automatically includes this in cron requests.

Terminal window
# Generate a secure secret
openssl rand -hex 32

Manual Triggering

Trigger cron jobs manually for testing:

Terminal window
curl -X POST https://your-app.vercel.app/api/cron/sync-anthropic \
-H "Authorization: Bearer $CRON_SECRET"

Or use the CLI:

Terminal window
pnpm cli sync anthropic --days 7

Vercel Configuration

Cron jobs are defined in vercel.json:

{
"crons": [
{
"path": "/api/cron/sync-anthropic",
"schedule": "0 6 * * *"
},
{
"path": "/api/cron/sync-cursor",
"schedule": "0 * * * *"
}
]
}

Monitoring

Vercel Dashboard

Check the Vercel dashboard for:

  • Cron execution history
  • Success/failure rates
  • Execution duration

Abacus Status Page

The /status page shows:

  • Last sync time for each provider
  • Backfill progress
  • Any sync errors

Database

Abacus works with:

  • Vercel Postgres (recommended)
  • Neon (compatible)

Migrations run automatically on vercel build. For manual migrations:

Terminal window
pnpm cli db:migrate