docs: document Railway preview env + per-scope Vercel API URL#234
Merged
docs: document Railway preview env + per-scope Vercel API URL#234
Conversation
Vercel previews now point at a dedicated Railway `preview` environment (deploys from a `preview` branch you fast-forward) instead of sharing production. Captures the dual-env setup, which Railway vars to isolate vs. share between prod and preview, and the `git push <branch>:preview` workflow for testing full-stack PRs against the matching backend. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Free-tier Upstash is one database per account, so the preview Railway env reuses prod's Redis. Move UPSTASH_* into the "should match" list and call out the trade-off: test-side share-snapshots and refresh tokens accumulate in prod's hashes, but collisions are bounded (random share IDs, per-user refresh-token keys). Flag it as the first thing to revisit if Upstash gets upgraded. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Split the one-time `git push origin main:preview` seed (no force needed, ref doesn't exist yet) from the ongoing `<your-branch>:preview --force-with-lease` overwrite, and rename the placeholder so it's obvious it isn't a literal branch name. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
previewenvironment (deploys from apreviewbranch) alongsideproduction(deploys frommain).NEXT_PUBLIC_API_URLinto per-scope values so Vercel previews hit Railway's preview env instead of prod (https://itinly-preview.up.railway.app/api/v1).UPSTASH_*,SENTRY_DSN) vs. share (GOOGLE_CLIENT_*,ANTHROPIC_API_KEY,VAPID_*,TOKEN_ENCRYPTION_KEY) between the two envs.git push <feature-branch>:preview --force-with-leaseworkflow for testing full-stack PRs against the matching backend.Why
Vercel was already building per-PR previews, but every preview talked to production's Railway API. That made it impossible to test server-side changes from a PR without merging to
mainfirst, and any test data (share links, refresh tokens) leaked into prod's Upstash hashes. A single dedicated preview env is cheaper than per-PR Railway environments and avoids the OAuth redirect-URI mess that per-PR envs would have caused.Notes for reviewer
CORS_ORIGIN_PATTERN, OAuth relay viaNEXT_PUBLIC_PROD_ORIGIN) was already in place.NEXT_PUBLIC_API_URL, seeding thepreviewbranch, creating a separate Upstash DB) needs to happen before the docs are accurate. Doing that out-of-band.Test plan
NEXT_PUBLIC_API_URLpoints atitinly-preview.up.railway.app, sign-in still works (OAuth relay), and trip CRUD works against the preview backend.🤖 Generated with Claude Code