Skip to content

Conversation

@cfsmp3
Copy link
Collaborator

@cfsmp3 cfsmp3 commented Jan 27, 2026

Summary

  • Change frontend to use relative URLs (/) instead of hardcoded localhost values
  • Add getWebSocketURL() helper to construct WebSocket URLs from current host
  • Derive sync server URL (containerOrigin) from window.location.origin
  • Remove unused VITE_* environment variables from jest config

This enables the same Docker image to work in any environment since nginx handles routing to the backend. This is a prerequisite for automated deployment where images should be environment-agnostic.

Changes

File Change
URLs.ts Use relative URLs, add getWebSocketURL() helper
HomePage.tsx Use new getWebSocketURL() for WebSocket connection
HomePage.test.tsx Add getWebSocketURL to mock
jest.config.cjs Remove unused VITE_* env vars
Hero.test.tsx.snap Updated snapshot (URL: /auth/oauth)

Test plan

  • All 670 tests pass
  • Docker image builds successfully
  • Container runs and serves frontend correctly
  • Test on VPS with nginx reverse proxy

🤖 Generated with Claude Code

Change frontend to use relative URLs instead of hardcoded localhost
values. This enables the same Docker image to work in any environment
since nginx handles routing to the backend.

Changes:
- backendURL now uses '/' (relative path)
- containerOrigin derived from window.location.origin
- Add getWebSocketURL() helper for WebSocket connections
- Remove VITE_* env vars from jest config (no longer needed)
- Update tests and snapshots

This is a prerequisite for automated deployment where images should
be environment-agnostic.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@github-actions
Copy link

Thank you for opening this PR!

Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools.

Please take a moment to:

  • Check the "Files changed" tab
  • Leave comments on any lines for functions, comments, etc. that are important, non-obvious, or may need attention
  • Clarify decisions you made or areas you might be unsure about and/or any future updates being considered.
  • Finally, submit all the comments!

More information on how to conduct a self review:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request

This helps make the review process smoother and gives us a clearer understanding of your thought process.

Once you've added your self-review, we'll continue from our side. Thank you!

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.

2 participants