Skip to content

docs: document Railway preview env + per-scope Vercel API URL#234

Merged
justmarks merged 4 commits intomainfrom
claude/interesting-lichterman-793b80
May 8, 2026
Merged

docs: document Railway preview env + per-scope Vercel API URL#234
justmarks merged 4 commits intomainfrom
claude/interesting-lichterman-793b80

Conversation

@justmarks
Copy link
Copy Markdown
Owner

@justmarks justmarks commented May 8, 2026

Summary

  • Documents the new Railway preview environment (deploys from a preview branch) alongside production (deploys from main).
  • Splits NEXT_PUBLIC_API_URL into per-scope values so Vercel previews hit Railway's preview env instead of prod (https://itinly-preview.up.railway.app/api/v1).
  • Captures which Railway env vars to isolate (UPSTASH_*, SENTRY_DSN) vs. share (GOOGLE_CLIENT_*, ANTHROPIC_API_KEY, VAPID_*, TOKEN_ENCRYPTION_KEY) between the two envs.
  • Documents the git push <feature-branch>:preview --force-with-lease workflow 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 main first, 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

  • Doc-only change; no code or config touched. The infrastructure that makes this work (CORS regex via CORS_ORIGIN_PATTERN, OAuth relay via NEXT_PUBLIC_PROD_ORIGIN) was already in place.
  • Dashboard work (creating the Railway env, swapping the Vercel preview-scope NEXT_PUBLIC_API_URL, seeding the preview branch, creating a separate Upstash DB) needs to happen before the docs are accurate. Doing that out-of-band.

Test plan

  • Read docs/vercel-setup.md end-to-end and confirm the dual-env story reads correctly.
  • After dashboard setup: open a throwaway PR, verify the Vercel preview's NEXT_PUBLIC_API_URL points at itinly-preview.up.railway.app, sign-in still works (OAuth relay), and trip CRUD works against the preview backend.
  • Confirm prod's Upstash share-snapshot hash stays clean after a preview-side share-link round trip.

🤖 Generated with Claude Code

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

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

Project Deployment Actions Updated (UTC)
itinly Ready Ready Preview, Comment May 8, 2026 9:43pm

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>
@justmarks justmarks merged commit 35bba9a into main May 8, 2026
3 checks passed
@justmarks justmarks deleted the claude/interesting-lichterman-793b80 branch May 8, 2026 21:44
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