╔══════════════════════════════════════════════════════════════╗ ║ EXPERIMENT: External App Analytics ║ ║ KEY METRIC: Sidecar fills gaps, DRY queries ║ ║ workway.co ║ ╚══════════════════════════════════════════════════════════════╝
Show analytics from an external app in the main dashboard. Don't duplicate code.
We built fn.workway.co on Cloudflare Pages. Great for UI. Terrible for scheduled jobs. Pages doesn't support cron triggers. Our auto-sync was supposed to run every hour. It never ran.
The fix: add a sidecar. A tiny Cloudflare Worker that wakes up hourly and pokes the Pages app. One file. One job. Problem solved.
We needed analytics: how many syncs ran, how many succeeded, when was the last one. First instinct: add tracking. New tables. New events. Duplicate logic.
Wrong instinct. The app already stored this in sync_jobs. Every execution was already a row. We just had to ask. Analytics was just a new query.
Once the Worker existed, we added more: analytics endpoints, bulk operations, admin team views. The Pages app stays focused on user experience. The sidecar handles platform-level stuff. Same database. Two concerns. Clean separation.
Regular users want their own stats. Admins want the team view. We tried making the UI flexible. Show team data if you're an admin. Hide it if you're not.
Simpler: check who's asking. Return different shapes. Config-driven. Adding a new admin is one line. No code changes.
| User | Total Synced | Auto-Sync | Success Rate |
|---|---|---|---|
| Viv | 1,063 | ✓ | 86% |
| Joel | 34 | ✓ | 50% |
Admin view aggregates both. Zero extra tracking code.
Sidecars fill infrastructure gaps without migration. Query what exists instead of duplicating tracking. External apps can be first-class citizens in the marketplace.