Skip to content

Move Orbit from EKS to Vercel and Supabase - #85

Merged
pulkitxm merged 4 commits into
mainfrom
migrate-to-vercel-supabase
Jul 30, 2026
Merged

pulkitxm merged 4 commits into
mainfrom
migrate-to-vercel-supabase

Conversation

@pulkitxm

Copy link
Copy Markdown
Member

Run the web app on Vercel's Bun runtime against Supabase Postgres and retire the CodeBuild pipeline.

pulkitxm added 3 commits July 28, 2026 17:33
The EKS deploy pipeline goes away with the move to Vercel. Image builds
and rollouts are handled by the platform now, so the buildspec has no
remaining consumer.
The Vercel project builds green once the Orbit configuration reaches it,
so this reads the prd config and writes each value to the project. Redis
is skipped by default because the Doppler value addresses the in-cluster
service, and a replacement is passed with --set.
The server code imports Bun built-ins directly: SQL and drizzle-orm/bun-sql
in packages/db, RedisClient in the realtime publisher, S3Client in storage,
password in auth, and randomUUIDv7 across services. On the Node runtime
every request failed with 'Cannot find module bun'. Selecting the Bun
runtime keeps all of that working, and the build script already passes
--bun so nothing else changes.
@vercel

vercel Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
orbit Ready Ready Preview Jul 30, 2026 9:55am

Request Review

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pulkitxm has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@pulkitxm

Copy link
Copy Markdown
Member Author

preview on the bun runtime, hitting supabase

GET /                        200  "Orbit: the free, realtime, keyboard-first work tracker"
GET /login                   200  "Sign in · Orbit"
GET /api/health              200  {"status":"ok","service":"web"}
GET /api/auth/get-session    200  null
GET /api/auth/list-sessions  401  {"code":"UNAUTHORIZED"}
POST /api/auth/sign-in/email 401  {"code":"INVALID_EMAIL_OR_PASSWORD"}

that last one is the one that matters: better-auth read the user table in supabase and
returned the right domain error rather than a 500. on the node runtime every route was
500 with Cannot find module 'bun', since packages/db imports SQL from bun.

data restored from the 24 jul dump, diffed against a local reference restore:

                 local  supabase
tables              67        67
issues            1278      1278
users               22        22
teams/projects     6/6       6/6
comments/docs   122/60    122/60
indexes            200       200

pg_trgm had to be installed by hand: the four gin trigram indexes on issue.title,
issue.description, doc.title and doc.content failed to restore without it.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 366b0c21-32a0-4038-bef6-b948abc602b7

📥 Commits

Reviewing files that changed from the base of the PR and between c29c037 and 8a73c52.

📒 Files selected for processing (1)
  • scripts/sync-vercel-env.ts

📝 Walkthrough

Walkthrough

Vercel runtime configuration was added, the deployment buildspec was removed, and a CLI was introduced to fetch filtered Doppler secrets, resolve credentials, and upsert encrypted environment variables in Vercel across selected targets.

Changes

Vercel deployment configuration

Layer / File(s) Summary
Secret and environment payload contracts
scripts/sync-vercel-env.ts
Defines supported Vercel targets, filters internal secrets, and validates Doppler and Vercel API payloads.
CLI options and credential resolution
scripts/sync-vercel-env.ts
Parses credentials, targets, overrides, and dry-run options, with AWS Secrets Manager fallback for the Doppler build token.
Doppler-to-Vercel synchronization
scripts/sync-vercel-env.ts, apps/web/vercel.json
Fetches filtered secrets, checks existing keys, upserts encrypted values, configures Bun 1.x for Vercel, and adds top-level error handling. The prior buildspec.yml deployment pipeline is removed.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant AWSSecretsManager
  participant Doppler
  participant Vercel
  CLI->>AWSSecretsManager: Resolve DOPPLER_TOKEN_BUILD when needed
  CLI->>Doppler: Fetch filtered computed secrets
  CLI->>Vercel: List existing keys for selected targets
  CLI->>Vercel: Upsert encrypted environment values
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main shift from EKS to Vercel and Supabase.
Description check ✅ Passed The description matches the changes by mentioning Vercel Bun runtime, Supabase Postgres, and retiring CodeBuild.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch migrate-to-vercel-supabase

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
scripts/sync-vercel-env.ts (1)

198-278: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

No retry/backoff around Doppler or Vercel calls.

Both APIs document rate limiting, and this script runs unattended as part of the deploy flow; a single transient 429/5xx aborts the whole sync mid-way. Consider a small retry-with-backoff wrapper around fetch in readDoppler/existingEnv/vercel for resiliency.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/sync-vercel-env.ts` around lines 198 - 278, Introduce a shared
retry-with-backoff fetch wrapper and route all Doppler and Vercel requests
through it, including calls from readDoppler, existingEnv, and vercel. Retry
transient 429 and 5xx responses with a small bounded backoff, while returning
other responses immediately and preserving the existing response-status error
handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/sync-vercel-env.ts`:
- Around line 87-113: Update dopplerTokenFromAws to capture the AWS subprocess
stderr instead of configuring stderr as 'ignore'. Read the captured diagnostics
and include them in the error thrown when proc.exited is nonzero, while
preserving the existing success parsing and fallback guidance.
- Around line 16-53: Replace the manual payload validation in isRecord,
dopplerSecrets, and vercelEnvEntries with Zod schemas that validate the complete
Doppler and Vercel response shapes before transformation. Use the parsed Zod
results to build the existing Map<string, string> and VercelEnvEntry[] outputs,
preserving the current malformed-payload error behavior where practical.
- Around line 228-240: Update existingEnv to retain every matching Vercel
environment-entry ID rather than collapsing records by key alone. Track IDs per
key and target, or otherwise return all entries whose targets overlap
options.targets, then update the deletion flow to remove every matching ID
before recreating replacements.
- Around line 263-274: Update the environment-variable replacement flow to avoid
deleting the existing variable before a successful replacement. In the block
guarded by previous, replace the DELETE request and subsequent create-only flow
with an in-place PATCH to /v9/projects/{projectId}/env/{previous}, preserving
the key, value, type, and target fields; alternatively use the supported POST
upsert behavior. Keep error handling for unsuccessful requests and retain
creation behavior when previous is undefined.

---

Nitpick comments:
In `@scripts/sync-vercel-env.ts`:
- Around line 198-278: Introduce a shared retry-with-backoff fetch wrapper and
route all Doppler and Vercel requests through it, including calls from
readDoppler, existingEnv, and vercel. Retry transient 429 and 5xx responses with
a small bounded backoff, while returning other responses immediately and
preserving the existing response-status error handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 971a6500-f278-4d6d-b75f-ea607ba26f1f

📥 Commits

Reviewing files that changed from the base of the PR and between 084755f and c29c037.

📒 Files selected for processing (3)
  • apps/web/vercel.json
  • buildspec.yml
  • scripts/sync-vercel-env.ts
💤 Files with no reviewable changes (1)
  • buildspec.yml

Comment thread scripts/sync-vercel-env.ts Resolved
Comment thread scripts/sync-vercel-env.ts Resolved
Comment thread scripts/sync-vercel-env.ts Resolved
Comment thread scripts/sync-vercel-env.ts Resolved
Delete then create left a window where a failed POST removed a live
variable outright. Vercel also returns one entry per key and target, so
collapsing the lookup by key alone deleted only one of a pair and left
the other stale. Posting with upsert lets Vercel match on key and target
and never removes anything first. The AWS lookup now surfaces stderr so a
credential failure says why.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pulkitxm has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@pulkitxm
pulkitxm merged commit 13515f3 into main Jul 30, 2026
8 checks passed
@pulkitxm
pulkitxm deleted the migrate-to-vercel-supabase branch July 30, 2026 10:00
imshashank added a commit that referenced this pull request Aug 9, 2026
scripts/sync-vercel-env.ts pulls secrets from Doppler and pushes them
into Vercel. It arrived with the move from EKS to Vercel in #85 and has
never been referenced since: no package script, no workflow, no doc. The
only match for "doppler" anywhere in the repository is the file itself.

Orbit's environment is set directly in Vercel. Leaving a script that
describes a different process is worse than having no script, because it
reads as documentation. It cost me exactly that: I read it, concluded
env flowed through Doppler, and told the owner a secret had to be added
there. It did not. It went straight into Vercel, where everything else
already lives.

This branch was successfully deployed

1 active deployment
Preview — 8a73c522 Deployed Jul 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant