Skip to content

feat: runtime server URL config via ServerConfig#1

Open
lofimichael wants to merge 3 commits into
mainfrom
lofimichael/server-config
Open

feat: runtime server URL config via ServerConfig#1
lofimichael wants to merge 3 commits into
mainfrom
lofimichael/server-config

Conversation

@lofimichael
Copy link
Copy Markdown
Owner

Summary

  • ServerConfig struct — single source of truth for server URLs. Resolves via: env var (CITYSCAPE_API_URL) → Info.plist (CityscapeAPIURL) → hardcoded Railway default
  • WebSocket URL derived from HTTP URLhttpswss, httpws, strips /api path via URLComponents parsing. No more independent config in two places
  • APIClient + ChannelManager — replaced #if DEBUG compile-time URL switching with ServerConfig.shared
  • run.sh — uses open --env (macOS 14+) to pass CITYSCAPE_API_URL to the app process. Fixes a bug where env vars from the shell weren't reaching the GUI app
  • 10 new tests for URL resolution, scheme derivation, path stripping, custom ports, and query parameter handling (56 total, all passing)
  • Auth unchanged#if DEBUG stays for auth mode (dev auto-auth vs Sign in with Apple). Auth mode follows the build type, not the server URL

Test plan

  • All 56 tests pass (46 existing + 10 new ServerConfig tests)
  • Build succeeds with zero errors
  • Eng review completed (all issues resolved)
  • Codex independent review — caught open env var bug, fixed

🤖 Generated with Claude Code

lofimichael and others added 3 commits March 20, 2026 16:33
Single source of truth for HTTP API and WebSocket URLs.
Resolution: env var (CITYSCAPE_API_URL) → Info.plist → Railway default.
Derives WebSocket URL from HTTP URL via URLComponents parsing.
10 unit tests for URL resolution, scheme derivation, and path stripping.
APIClient and ChannelManager now read from ServerConfig.shared
instead of compile-time #if DEBUG branching. Both HTTP and WebSocket
URLs are derived from a single configurable source.
Use open --env (macOS 14+) to pass CITYSCAPE_API_URL to the app
process. Document server configuration in README.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
lofimichael added a commit that referenced this pull request Mar 20, 2026
* docs: product research and vision for WiFi-based social discovery

Comprehensive product research covering technical feasibility (CoreWLAN,
iMessage automation), competitive landscape (8 failed proximity apps),
product design (user flows, trust/safety, cold start), and architecture.

CEO review accepted 8 scope expansions including ambient spatial board,
cross-venue awareness, office hours beacons, and venue intelligence.
Eng review defined Phoenix contexts, DB schema, API contract, and
3-wave implementation plan.

* chore: bump version and changelog (v0.1.0.0)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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