Spaces:
Runtime error
Runtime error
chore: finalize Render deployment setup and docs
Browse files- README.md +27 -7
- package.json +1 -1
- render.yaml +2 -2
README.md
CHANGED
|
@@ -197,7 +197,7 @@ For users on different internet connections (cellular, other Wi-Fi), **deploy to
|
|
| 197 |
| Option | Difficulty | Cost | HTTPS | Best For |
|
| 198 |
|--------|-----------|------|-------|----------|
|
| 199 |
| Railway | Easy | Free tier | Auto | Quick deployment, beginners |
|
| 200 |
-
| Render | Easy | Free tier | Auto |
|
| 201 |
| Self-host (DuckDNS+Caddy) | Hard | Free | Auto | Learning, full control |
|
| 202 |
|
| 203 |
#### Option 1: Deploy to Railway (Easiest - Free HTTPS + Domain)
|
|
@@ -220,15 +220,35 @@ For users on different internet connections (cellular, other Wi-Fi), **deploy to
|
|
| 220 |
```
|
| 221 |
5. Share the URL (automatic HTTPS included!)
|
| 222 |
|
| 223 |
-
#### Option 2: Deploy to Render (
|
| 224 |
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
- **Build Command:** `npm install`
|
| 230 |
- **Start Command:** `npm start`
|
| 231 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
|
| 233 |
#### Option 3: Self-host with proper domain (Advanced)
|
| 234 |
|
|
|
|
| 197 |
| Option | Difficulty | Cost | HTTPS | Best For |
|
| 198 |
|--------|-----------|------|-------|----------|
|
| 199 |
| Railway | Easy | Free tier | Auto | Quick deployment, beginners |
|
| 200 |
+
| Render | Easy | Free tier | Auto | Node + WebSocket apps with simple setup |
|
| 201 |
| Self-host (DuckDNS+Caddy) | Hard | Free | Auto | Learning, full control |
|
| 202 |
|
| 203 |
#### Option 1: Deploy to Railway (Easiest - Free HTTPS + Domain)
|
|
|
|
| 220 |
```
|
| 221 |
5. Share the URL (automatic HTTPS included!)
|
| 222 |
|
| 223 |
+
#### Option 2: Deploy to Render (recommended)
|
| 224 |
|
| 225 |
+
This app is already compatible with Render because it uses a dynamic port (`process.env.PORT`) and Socket.IO over a Node web service.
|
| 226 |
+
|
| 227 |
+
1. Push your latest code to GitHub.
|
| 228 |
+
2. Go to https://render.com and sign in with GitHub.
|
| 229 |
+
3. Click **New +** → **Web Service**.
|
| 230 |
+
4. Choose **Build and deploy from a Git repository** and select this repo.
|
| 231 |
+
5. Configure service settings:
|
| 232 |
+
- **Runtime:** `Node`
|
| 233 |
- **Build Command:** `npm install`
|
| 234 |
- **Start Command:** `npm start`
|
| 235 |
+
- **Plan:** `Free`
|
| 236 |
+
- **Region:** nearest to your users
|
| 237 |
+
6. Add environment variables from your local `.env` file (never commit secrets):
|
| 238 |
+
- `DATABASE_URL`
|
| 239 |
+
- `JWT_SECRET`
|
| 240 |
+
- `CORS_ORIGIN` (set to your frontend URL or `*` for quick testing)
|
| 241 |
+
- Optional TURN variables for WebRTC: `TURN_URLS`, `TURN_USERNAME`, `TURN_CREDENTIAL`
|
| 242 |
+
7. Click **Create Web Service** and wait for build logs to finish.
|
| 243 |
+
8. Open your live URL: `https://<your-service>.onrender.com`
|
| 244 |
+
9. Validate health endpoint in browser:
|
| 245 |
+
- `https://<your-service>.onrender.com/api/version`
|
| 246 |
+
10. Test real-time chat from 2 browser tabs/devices.
|
| 247 |
+
|
| 248 |
+
Notes for Render Free tier:
|
| 249 |
+
- Free services sleep after inactivity; first wake-up request can take around 30-60 seconds.
|
| 250 |
+
- This app uses PostgreSQL via `DATABASE_URL`, so chat/account data is persisted in DB, not only in memory.
|
| 251 |
+
- Do not set `PORT` manually on Render; Render injects it automatically.
|
| 252 |
|
| 253 |
#### Option 3: Self-host with proper domain (Advanced)
|
| 254 |
|
package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "discord-like-app",
|
| 3 |
-
"version": "3.2.
|
| 4 |
"main": "server.js",
|
| 5 |
"scripts": {
|
| 6 |
"dev": "nodemon server.js",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "discord-like-app",
|
| 3 |
+
"version": "3.2.10",
|
| 4 |
"main": "server.js",
|
| 5 |
"scripts": {
|
| 6 |
"dev": "nodemon server.js",
|
render.yaml
CHANGED
|
@@ -2,10 +2,10 @@ services:
|
|
| 2 |
- type: web
|
| 3 |
name: ultimate-chat-app
|
| 4 |
env: node
|
|
|
|
| 5 |
buildCommand: npm install
|
| 6 |
startCommand: npm start
|
|
|
|
| 7 |
envVars:
|
| 8 |
-
- key: PORT
|
| 9 |
-
value: 10000
|
| 10 |
- key: NODE_ENV
|
| 11 |
value: production
|
|
|
|
| 2 |
- type: web
|
| 3 |
name: ultimate-chat-app
|
| 4 |
env: node
|
| 5 |
+
plan: free
|
| 6 |
buildCommand: npm install
|
| 7 |
startCommand: npm start
|
| 8 |
+
healthCheckPath: /api/version
|
| 9 |
envVars:
|
|
|
|
|
|
|
| 10 |
- key: NODE_ENV
|
| 11 |
value: production
|