Skip to main content

Backup System

The backup system proactively refreshes all cache entries to ensure data stays fresh even when the dashboard isn’t actively being viewed.

How it works

  1. An external cron script (apps/app/scripts/backup-cron.ts) periodically POSTs to /api/backup
  2. The backup endpoint iterates over all projects and their integrations
  3. Each service fetcher is called with forceRefresh: true to bypass the cache
  4. Rate-limit-aware delays are applied between calls:
    • RevenueCat: 15 seconds between tasks (5 req/min limit)
    • App Store Connect: 2 seconds between tasks
    • All others: 500ms between tasks

Configuration

.env.local
Generate a secret with:

API endpoint

Response

Running the cron

The cron script runs independently of the Next.js app:
For production, set this up as a system cron, PM2 process, or cloud scheduler (e.g., Vercel Cron, Railway scheduled tasks).