server.ts) to handle real-time WebSockets (socket.io).
Vercel does not support custom servers or long-running WebSocket processes (it is a Serverless platform).
If you try to deploy to Vercel, the website will load, but active collaboration (cursors, chat, code sync) will fail.
Render allows you to run "Web Services" which stay online and support WebSockets.
Make sure your latest code is pushed to your GitHub repository:
https://github.com/iam-sarthakdev/DevSync
- Go to dashboard.render.com.
- Click New + -> Web Service.
- Connect your GitHub repository.
Use these exact settings:
| Setting | Value |
|---|---|
| Name | devsync (or any name) |
| Runtime | Node |
| Build Command | npm install && npm run build |
| Start Command | npm start |
Note: Our
package.jsonhas astartscript that runstsx server.ts, which is exactly what we need.
Add these environment variables in the Render dashboard:
NODE_ENV:production
Click Create Web Service. Render will build your app and start the server.
Once done, you will get a URL like https://devsync-xyz.onrender.com.
- Go to railway.app.
- Click New Project -> Deploy from GitHub repo.
- Select
DevSync. - Railway will automatically detect
npm startand deploy it. - Go to Settings -> Generate Domain to get your public URL.
- Frontend: Next.js (Served by
server.ts) - Backend: Socket.IO (Served by
server.ts) - Platform: Render or Railway (Supports persistent servers)