Skip to content

Add persistent WebSocket backend deployment support#84

Open
saurabhhhcodes wants to merge 3 commits into
ThePlator:mainfrom
saurabhhhcodes:codex/websocket-deploy-74
Open

Add persistent WebSocket backend deployment support#84
saurabhhhcodes wants to merge 3 commits into
ThePlator:mainfrom
saurabhhhcodes:codex/websocket-deploy-74

Conversation

@saurabhhhcodes

Copy link
Copy Markdown

Summary

  • fix production backend startup so persistent hosts like Render/Railway/Fly.io/Docker call server.listen() while Vercel serverless still exports the Express app
  • add /api/health for deployment health checks and runtime metadata
  • add tested runtime helpers for Vercel detection and port parsing
  • add a backend Dockerfile, Render blueprint, deployment guide, and updated environment documentation

Fixes #74

Testing

  • /Users/saurabhkumarbajpaiai/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node --test tests/*.test.js ✅ 3 passed
  • /Users/saurabhkumarbajpaiai/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node --check server.js
  • /Users/saurabhkumarbajpaiai/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node --check lib/runtime.js
  • git diff --check

Note: npm is not installed in my local shell, so I ran the package test entry directly with the bundled Node runtime.

GSSoC labels

The issue already has gssoc:approved, level:advanced, and type:performance. After review, could you please keep/add the matching PR labels and any quality label you think fits?

@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the Sameer's projects Team on Vercel.

A member of the Team first needs to authorize it.

@ThePlator

Copy link
Copy Markdown
Owner

Hi @saurabhhhcodes! Thank you for the incredible effort on this PR—it is extremely thorough and well-documented.

As noted in Issue #74, we had previously assigned this task to @roshankumar0036singh to give him the opportunity to implement his suggestion. However, to keep the project moving forward, we have set a deadline. If Roshan does not respond or provide an update by tomorrow afternoon, we will go ahead and merge your PR.

Thank you for your patience and for such a high-quality contribution!

@saurabhhhcodes

Copy link
Copy Markdown
Author

Thank you for the update and for being fair about the original assignment. I completely understand giving @roshankumar0036singh the deadline first.

I’ll keep this branch ready and won’t make unnecessary changes unless you ask for something specific. If you decide to merge it tomorrow, please also keep/add the scoring labels from the issue (gssoc:approved, level:advanced, type:performance, and any quality label you think fits).

@saurabhhhcodes

Copy link
Copy Markdown
Author

Updated this branch with the latest main and resolved the merge conflicts.

What changed in the conflict resolution:

  • kept upstream's newer Docker/Render deployment setup and health-check wiring
  • preserved the runtime helpers/tests from this PR so persistent hosts still call server.listen() while Vercel serverless exports the app
  • verified the branch is mergeable again on GitHub

Validation after resolving conflicts:

  • node --check backend/server.js
  • node --check backend/lib/runtime.js
  • cd backend && node --test tests/*.test.js ✅ 3 passed
  • git diff --check

Please add gssoc:approved, an appropriate difficulty label, and type:devops/type:feature if this is ready to count for GSSoC.

@saurabhhhcodes

Copy link
Copy Markdown
Author

Refreshed this branch on latest main and resolved the conflicts.

What changed in the refresh:

  • kept upstream's newer chat/problem/challenge/socket work intact
  • preserved this PR's deployment documentation and runtime-helper refinements
  • kept the PR diff focused to deployment docs plus runtime helper behavior

Validation:

  • node --check backend/server.js
  • node --check backend/lib/runtime.js
  • npm --prefix backend exec vitest run tests/runtime.test.js (10 passed)
  • git diff --check

The branch should be mergeable again; the remaining red status, if any, is expected Vercel authorization.

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.

[PROJECT] WebSocket Deployment Compatibility (Vercel vs Socket.io)

2 participants