One OAuth flow, two jobs
Auth.js with GitHub as the only provider. The same sign-in that creates the session also grants the repo scope the poller needs, so there is no second “paste a token” step. GitHub offers nothing narrower that still reads private repositories, and the landing page says so.
Tokens encrypted at rest
Each user’s GitHub token is stored AES-256-GCM encrypted, packed as iv:tag:ciphertext in one opaque column. The key comes from the environment and is checked for length at boot. A database leak alone does not leak anyone’s GitHub access.
Teams, not users, own things
Eight tables: users, orgs, memberships, GitHub connections, repos, run status, webhooks, invites. Every repo, webhook and invite belongs to an org, and every server action re-checks membership and role for that org before touching a row.
The poller is not on Vercel Cron
Vercel’s free tier runs cron once a day; the product needs every five to fifteen minutes. So polling is a secret-guarded endpoint that any external scheduler can call, with a GitHub Actions workflow as the default caller.The Ship Log entry has the reasoning.
Cheap requests, polite backoff
Ported from the CLI and extended: each check sendsIf-None-Match with the last ETag, so an unchanged repo costs a 304 that does not count against the rate limit. A 403 or 429 raises a typed error carrying the reset time, and the batch stops instead of hammering.
Alerts only on the transition
The poller stores the previous status and fires a webhook only when a repo goes from passing to failing. Webhook URLs are validated against the real Slack and Discord hosts, so the server will not POST to an internal address someone typed into a form.