vortix 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -35
- package/agent/package-lock.json +165 -0
- package/agent/start-local.bat +3 -0
- package/agent/start-production.bat +3 -0
- package/agent/test-screenshot.js +19 -0
- package/backend/DEPLOY.md +261 -0
- package/backend/Procfile +1 -0
- package/backend/README.md +80 -0
- package/backend/server.js +788 -237
- package/package.json +1 -1
- package/CHANGELOG.md +0 -86
package/README.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
# Vortix
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
AI-powered remote OS control system with natural language command execution,
|
|
4
|
+
real-time monitoring, and advanced device management.
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Features
|
|
7
7
|
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
8
|
+
- **AI Command Generation** - Convert natural language to system commands
|
|
9
|
+
- **Real-time System Monitoring** - CPU, Memory, and Disk usage tracking
|
|
10
|
+
- **Screen Sharing** - Live desktop streaming capabilities
|
|
11
|
+
- **File Transfer** - Upload and download files remotely
|
|
12
|
+
- **Multi-device Control** - Execute commands across multiple devices
|
|
13
|
+
- **Secure Authentication** - Password-protected device access
|
|
14
|
+
- **Auto-start on Boot** - Automatic agent startup
|
|
15
|
+
- **Modern Web Dashboard** - Responsive UI with mobile support
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Quick Start
|
|
18
18
|
|
|
19
19
|
### Installation
|
|
20
20
|
|
|
@@ -41,7 +41,7 @@ vortix start
|
|
|
41
41
|
|
|
42
42
|
That's it! No backend setup required - everything runs in the cloud.
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## Commands
|
|
45
45
|
|
|
46
46
|
| Command | Description |
|
|
47
47
|
| -------------- | ------------------------------------- |
|
|
@@ -49,7 +49,7 @@ That's it! No backend setup required - everything runs in the cloud.
|
|
|
49
49
|
| `vortix start` | Start the agent on current machine |
|
|
50
50
|
| `vortix help` | Show help information |
|
|
51
51
|
|
|
52
|
-
##
|
|
52
|
+
## Use Cases
|
|
53
53
|
|
|
54
54
|
- **Remote Work** - Control your office computer from home
|
|
55
55
|
- **Server Management** - Monitor and manage remote servers
|
|
@@ -57,14 +57,14 @@ That's it! No backend setup required - everything runs in the cloud.
|
|
|
57
57
|
- **Home Automation** - Control your home PC from anywhere
|
|
58
58
|
- **Development** - Manage multiple development environments
|
|
59
59
|
|
|
60
|
-
##
|
|
60
|
+
## Architecture
|
|
61
61
|
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
62
|
+
- **Cloud Backend** - Hosted WebSocket server (always online)
|
|
63
|
+
- **Local Agent** - Runs on your devices, executes commands
|
|
64
|
+
- **Web Dashboard** - Modern React/Next.js interface
|
|
65
|
+
- **Secure Connection** - End-to-end encrypted communication
|
|
66
66
|
|
|
67
|
-
##
|
|
67
|
+
## Example Commands
|
|
68
68
|
|
|
69
69
|
Try these natural language commands in the dashboard:
|
|
70
70
|
|
|
@@ -77,7 +77,7 @@ Try these natural language commands in the dashboard:
|
|
|
77
77
|
"check disk space"
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
##
|
|
80
|
+
## Advanced Features
|
|
81
81
|
|
|
82
82
|
### Auto-start on Boot
|
|
83
83
|
|
|
@@ -99,7 +99,7 @@ Upload and download files directly through the web interface.
|
|
|
99
99
|
|
|
100
100
|
Execute the same command across multiple connected devices simultaneously.
|
|
101
101
|
|
|
102
|
-
##
|
|
102
|
+
## Dashboard Features
|
|
103
103
|
|
|
104
104
|
- **Command Center** - Execute commands with AI assistance
|
|
105
105
|
- **Device Management** - View and control all connected devices
|
|
@@ -108,20 +108,20 @@ Execute the same command across multiple connected devices simultaneously.
|
|
|
108
108
|
- **Screen Viewer** - Live desktop streaming
|
|
109
109
|
- **Mobile Support** - Full functionality on mobile devices
|
|
110
110
|
|
|
111
|
-
##
|
|
111
|
+
## Security
|
|
112
112
|
|
|
113
113
|
- Password-protected device authentication
|
|
114
114
|
- Secure WebSocket connections (WSS)
|
|
115
115
|
- Command approval system for dangerous operations
|
|
116
116
|
- No data stored on servers (commands executed locally)
|
|
117
117
|
|
|
118
|
-
##
|
|
118
|
+
## Supported Platforms
|
|
119
119
|
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
120
|
+
- Windows (7, 8, 10, 11)
|
|
121
|
+
- macOS (10.14+)
|
|
122
|
+
- Linux (Ubuntu, CentOS, Debian, etc.)
|
|
123
123
|
|
|
124
|
-
##
|
|
124
|
+
## Troubleshooting
|
|
125
125
|
|
|
126
126
|
### Agent won't connect?
|
|
127
127
|
|
|
@@ -141,15 +141,29 @@ Execute the same command across multiple connected devices simultaneously.
|
|
|
141
141
|
- Report issues on [GitHub](https://github.com/Vaibhav262610/vortix/issues)
|
|
142
142
|
- Contact support: vaibhavrajpoot2626@gmail.com
|
|
143
143
|
|
|
144
|
-
##
|
|
144
|
+
## What's New in v1.2.2
|
|
145
145
|
|
|
146
|
-
-
|
|
147
|
-
|
|
148
|
-
-
|
|
149
|
-
|
|
150
|
-
-
|
|
146
|
+
- **Streamlined Dashboard** - Removed screen sharing and auto-start features for
|
|
147
|
+
cleaner UI
|
|
148
|
+
- **Focus on Core Features** - Simplified interface focused on command execution
|
|
149
|
+
and monitoring
|
|
150
|
+
- **Updated Components** - Latest agent and backend files included
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
### Previous Updates (v1.2.1)
|
|
153
|
+
|
|
154
|
+
- **Improved Documentation** - More professional README with better formatting
|
|
155
|
+
- **Enhanced Readability** - Cleaner structure and natural tone
|
|
156
|
+
- **Better User Experience** - Less cluttered documentation
|
|
157
|
+
|
|
158
|
+
### Previous Updates (v1.2.0)
|
|
159
|
+
|
|
160
|
+
- **Redesigned Dashboard** - Modern Command Center interface
|
|
161
|
+
- **Mobile Optimization** - Perfect mobile experience
|
|
162
|
+
- **Performance Improvements** - Faster real-time updates
|
|
163
|
+
- **Enhanced UI** - Better navigation and user experience
|
|
164
|
+
- **Cloud-first Architecture** - No backend setup required
|
|
165
|
+
|
|
166
|
+
## License
|
|
153
167
|
|
|
154
168
|
MIT License - see
|
|
155
169
|
[LICENSE](https://github.com/Vaibhav262610/vortix/blob/main/LICENSE) for
|
package/agent/package-lock.json
CHANGED
|
@@ -9,9 +9,174 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"screenshot-desktop": "^1.15.0",
|
|
12
13
|
"ws": "^8.19.0"
|
|
13
14
|
}
|
|
14
15
|
},
|
|
16
|
+
"node_modules/balanced-match": {
|
|
17
|
+
"version": "1.0.2",
|
|
18
|
+
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
|
19
|
+
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
|
20
|
+
"license": "MIT"
|
|
21
|
+
},
|
|
22
|
+
"node_modules/brace-expansion": {
|
|
23
|
+
"version": "1.1.12",
|
|
24
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
|
|
25
|
+
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"balanced-match": "^1.0.0",
|
|
29
|
+
"concat-map": "0.0.1"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"node_modules/concat-map": {
|
|
33
|
+
"version": "0.0.1",
|
|
34
|
+
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
|
35
|
+
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
|
|
36
|
+
"license": "MIT"
|
|
37
|
+
},
|
|
38
|
+
"node_modules/fs.realpath": {
|
|
39
|
+
"version": "1.0.0",
|
|
40
|
+
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
|
41
|
+
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
|
|
42
|
+
"license": "ISC"
|
|
43
|
+
},
|
|
44
|
+
"node_modules/glob": {
|
|
45
|
+
"version": "7.2.3",
|
|
46
|
+
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
|
47
|
+
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
|
48
|
+
"deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me",
|
|
49
|
+
"license": "ISC",
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"fs.realpath": "^1.0.0",
|
|
52
|
+
"inflight": "^1.0.4",
|
|
53
|
+
"inherits": "2",
|
|
54
|
+
"minimatch": "^3.1.1",
|
|
55
|
+
"once": "^1.3.0",
|
|
56
|
+
"path-is-absolute": "^1.0.0"
|
|
57
|
+
},
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": "*"
|
|
60
|
+
},
|
|
61
|
+
"funding": {
|
|
62
|
+
"url": "https://github.com/sponsors/isaacs"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"node_modules/inflight": {
|
|
66
|
+
"version": "1.0.6",
|
|
67
|
+
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
|
68
|
+
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
|
|
69
|
+
"deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
|
|
70
|
+
"license": "ISC",
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"once": "^1.3.0",
|
|
73
|
+
"wrappy": "1"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"node_modules/inherits": {
|
|
77
|
+
"version": "2.0.4",
|
|
78
|
+
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
|
79
|
+
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
|
80
|
+
"license": "ISC"
|
|
81
|
+
},
|
|
82
|
+
"node_modules/minimatch": {
|
|
83
|
+
"version": "3.1.3",
|
|
84
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.3.tgz",
|
|
85
|
+
"integrity": "sha512-M2GCs7Vk83NxkUyQV1bkABc4yxgz9kILhHImZiBPAZ9ybuvCb0/H7lEl5XvIg3g+9d4eNotkZA5IWwYl0tibaA==",
|
|
86
|
+
"license": "ISC",
|
|
87
|
+
"dependencies": {
|
|
88
|
+
"brace-expansion": "^1.1.7"
|
|
89
|
+
},
|
|
90
|
+
"engines": {
|
|
91
|
+
"node": "*"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"node_modules/minimist": {
|
|
95
|
+
"version": "1.2.8",
|
|
96
|
+
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
|
97
|
+
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
|
98
|
+
"license": "MIT",
|
|
99
|
+
"funding": {
|
|
100
|
+
"url": "https://github.com/sponsors/ljharb"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"node_modules/mkdirp": {
|
|
104
|
+
"version": "0.5.6",
|
|
105
|
+
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
|
|
106
|
+
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
|
|
107
|
+
"license": "MIT",
|
|
108
|
+
"dependencies": {
|
|
109
|
+
"minimist": "^1.2.6"
|
|
110
|
+
},
|
|
111
|
+
"bin": {
|
|
112
|
+
"mkdirp": "bin/cmd.js"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"node_modules/once": {
|
|
116
|
+
"version": "1.4.0",
|
|
117
|
+
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
|
118
|
+
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
|
119
|
+
"license": "ISC",
|
|
120
|
+
"dependencies": {
|
|
121
|
+
"wrappy": "1"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"node_modules/path-is-absolute": {
|
|
125
|
+
"version": "1.0.1",
|
|
126
|
+
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
|
127
|
+
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
|
|
128
|
+
"license": "MIT",
|
|
129
|
+
"engines": {
|
|
130
|
+
"node": ">=0.10.0"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"node_modules/rimraf": {
|
|
134
|
+
"version": "2.6.3",
|
|
135
|
+
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
|
|
136
|
+
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
|
137
|
+
"deprecated": "Rimraf versions prior to v4 are no longer supported",
|
|
138
|
+
"license": "ISC",
|
|
139
|
+
"dependencies": {
|
|
140
|
+
"glob": "^7.1.3"
|
|
141
|
+
},
|
|
142
|
+
"bin": {
|
|
143
|
+
"rimraf": "bin.js"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"node_modules/screenshot-desktop": {
|
|
147
|
+
"version": "1.15.3",
|
|
148
|
+
"resolved": "https://registry.npmjs.org/screenshot-desktop/-/screenshot-desktop-1.15.3.tgz",
|
|
149
|
+
"integrity": "sha512-bHztitCmaa+A+ssxRa3LDNepQzCHEEAkz1FaJjoZx2yDMkHIkHLKKcc5xMgkGNas97wSGboSB2BoO0c4RnjlJw==",
|
|
150
|
+
"funding": [
|
|
151
|
+
{
|
|
152
|
+
"type": "github",
|
|
153
|
+
"url": "https://github.com/sponsors/bencevans"
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"license": "MIT",
|
|
157
|
+
"dependencies": {
|
|
158
|
+
"temp": "^0.9.4"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"node_modules/temp": {
|
|
162
|
+
"version": "0.9.4",
|
|
163
|
+
"resolved": "https://registry.npmjs.org/temp/-/temp-0.9.4.tgz",
|
|
164
|
+
"integrity": "sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==",
|
|
165
|
+
"license": "MIT",
|
|
166
|
+
"dependencies": {
|
|
167
|
+
"mkdirp": "^0.5.1",
|
|
168
|
+
"rimraf": "~2.6.2"
|
|
169
|
+
},
|
|
170
|
+
"engines": {
|
|
171
|
+
"node": ">=6.0.0"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"node_modules/wrappy": {
|
|
175
|
+
"version": "1.0.2",
|
|
176
|
+
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
|
177
|
+
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
|
178
|
+
"license": "ISC"
|
|
179
|
+
},
|
|
15
180
|
"node_modules/ws": {
|
|
16
181
|
"version": "8.19.0",
|
|
17
182
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Test script to verify screenshot-desktop works
|
|
2
|
+
const screenshot = require('screenshot-desktop');
|
|
3
|
+
|
|
4
|
+
console.log('Testing screenshot capture...');
|
|
5
|
+
|
|
6
|
+
screenshot({ format: 'jpg' })
|
|
7
|
+
.then((img) => {
|
|
8
|
+
console.log('✅ Screenshot captured successfully!');
|
|
9
|
+
console.log(` Size: ${img.length} bytes`);
|
|
10
|
+
console.log(` Base64 length: ${img.toString('base64').length} characters`);
|
|
11
|
+
console.log('\nScreen sharing should work! 🎉');
|
|
12
|
+
})
|
|
13
|
+
.catch((err) => {
|
|
14
|
+
console.error('❌ Screenshot failed:', err.message);
|
|
15
|
+
console.error('\nTroubleshooting:');
|
|
16
|
+
console.error('- Windows: Make sure you have permissions');
|
|
17
|
+
console.error('- macOS: Grant Screen Recording permission in System Preferences');
|
|
18
|
+
console.error('- Linux: Install scrot or imagemagick');
|
|
19
|
+
});
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
# Backend Deployment Guide
|
|
2
|
+
|
|
3
|
+
## ✅ Pre-Deployment Checklist
|
|
4
|
+
|
|
5
|
+
- [x] Fixed package.json main file (server.js)
|
|
6
|
+
- [x] Fixed PORT configuration
|
|
7
|
+
- [x] Removed unused dependencies (openai, uuid)
|
|
8
|
+
- [x] Cleaned up imports
|
|
9
|
+
- [x] No diagnostic errors
|
|
10
|
+
|
|
11
|
+
## 🚀 Deploy to Railway (Recommended)
|
|
12
|
+
|
|
13
|
+
### Step 1: Install Railway CLI
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g @railway/cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Step 2: Login
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
railway login
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Step 3: Initialize and Deploy
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cd backend
|
|
29
|
+
railway init
|
|
30
|
+
railway up
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Step 4: Get Your URL
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
railway domain
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Example output: `vortix-backend.railway.app`
|
|
40
|
+
|
|
41
|
+
### Step 5: Test Connection
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Install wscat
|
|
45
|
+
npm install -g wscat
|
|
46
|
+
|
|
47
|
+
# Test connection
|
|
48
|
+
wscat -c wss://vortix-backend.railway.app?token=test
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 🔧 Alternative: Deploy to Render
|
|
52
|
+
|
|
53
|
+
### Step 1: Go to Render.com
|
|
54
|
+
|
|
55
|
+
https://render.com
|
|
56
|
+
|
|
57
|
+
### Step 2: Create Web Service
|
|
58
|
+
|
|
59
|
+
- Click "New +" → "Web Service"
|
|
60
|
+
- Connect your GitHub repository
|
|
61
|
+
|
|
62
|
+
### Step 3: Configure
|
|
63
|
+
|
|
64
|
+
- **Name**: vortix-backend
|
|
65
|
+
- **Root Directory**: `backend`
|
|
66
|
+
- **Environment**: Node
|
|
67
|
+
- **Build Command**: `npm install`
|
|
68
|
+
- **Start Command**: `npm start`
|
|
69
|
+
|
|
70
|
+
### Step 4: Deploy
|
|
71
|
+
|
|
72
|
+
Click "Create Web Service"
|
|
73
|
+
|
|
74
|
+
### Step 5: Get URL
|
|
75
|
+
|
|
76
|
+
Your service will be at: `https://vortix-backend.onrender.com`
|
|
77
|
+
|
|
78
|
+
## 🔧 Alternative: Deploy to Heroku
|
|
79
|
+
|
|
80
|
+
### Step 1: Install Heroku CLI
|
|
81
|
+
|
|
82
|
+
https://devcenter.heroku.com/articles/heroku-cli
|
|
83
|
+
|
|
84
|
+
### Step 2: Login
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
heroku login
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Step 3: Create App
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
cd backend
|
|
94
|
+
heroku create vortix-backend
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Step 4: Deploy
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
git push heroku main
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Step 5: Get URL
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
heroku open
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## 📝 Post-Deployment
|
|
110
|
+
|
|
111
|
+
### 1. Save Your Backend URL
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
Backend URL: wss://your-backend-url.railway.app
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 2. Update Agent
|
|
118
|
+
|
|
119
|
+
Edit `agent/agent.js` (line ~30):
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
const ws = new WebSocket(`wss://your-backend-url.railway.app?token=${token}`);
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 3. Update Dashboard
|
|
126
|
+
|
|
127
|
+
Create `dashboard/.env.local`:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
NEXT_PUBLIC_BACKEND_WS=wss://your-backend-url.railway.app
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 4. Test Everything
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Test WebSocket connection
|
|
137
|
+
wscat -c wss://your-backend-url.railway.app?token=test
|
|
138
|
+
|
|
139
|
+
# Should connect without errors
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## 🔍 Monitoring
|
|
143
|
+
|
|
144
|
+
### Railway
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# View logs
|
|
148
|
+
railway logs --tail
|
|
149
|
+
|
|
150
|
+
# Check status
|
|
151
|
+
railway status
|
|
152
|
+
|
|
153
|
+
# View variables
|
|
154
|
+
railway variables
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Render
|
|
158
|
+
|
|
159
|
+
- Check logs in Render dashboard
|
|
160
|
+
- Monitor at: https://dashboard.render.com
|
|
161
|
+
|
|
162
|
+
### Heroku
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# View logs
|
|
166
|
+
heroku logs --tail
|
|
167
|
+
|
|
168
|
+
# Check status
|
|
169
|
+
heroku ps
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## 🐛 Troubleshooting
|
|
173
|
+
|
|
174
|
+
### Connection Refused
|
|
175
|
+
|
|
176
|
+
- Check if backend is running
|
|
177
|
+
- Verify PORT is set correctly
|
|
178
|
+
- Check firewall settings
|
|
179
|
+
|
|
180
|
+
### WebSocket Upgrade Failed
|
|
181
|
+
|
|
182
|
+
- Ensure using `wss://` (not `ws://`) in production
|
|
183
|
+
- Check if hosting provider supports WebSocket
|
|
184
|
+
|
|
185
|
+
### AI Planning Not Working
|
|
186
|
+
|
|
187
|
+
- Ollama must be running locally (not on cloud)
|
|
188
|
+
- Consider switching to OpenAI API for cloud deployment
|
|
189
|
+
- Or remove AI planning feature
|
|
190
|
+
|
|
191
|
+
### Port Already in Use
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Railway/Render handle this automatically
|
|
195
|
+
# For local testing, change PORT in .env
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## 🔐 Security Notes
|
|
199
|
+
|
|
200
|
+
### Current Setup
|
|
201
|
+
|
|
202
|
+
- Basic token authentication (hostname-based)
|
|
203
|
+
- No rate limiting
|
|
204
|
+
- No command validation
|
|
205
|
+
|
|
206
|
+
### For Production
|
|
207
|
+
|
|
208
|
+
1. Implement JWT authentication
|
|
209
|
+
2. Add rate limiting
|
|
210
|
+
3. Validate all commands
|
|
211
|
+
4. Use environment variables for secrets
|
|
212
|
+
5. Enable CORS properly
|
|
213
|
+
6. Add request logging
|
|
214
|
+
|
|
215
|
+
## 📊 Expected Behavior
|
|
216
|
+
|
|
217
|
+
### Successful Deployment
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
✅ Backend running on port 8080
|
|
221
|
+
✅ WebSocket server accepting connections
|
|
222
|
+
✅ Devices can connect
|
|
223
|
+
✅ Dashboard can connect
|
|
224
|
+
✅ Commands route correctly
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Logs Should Show
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
Backend running on port 8080
|
|
231
|
+
Type: send <DeviceName> <command>
|
|
232
|
+
Registered device: Test-Device
|
|
233
|
+
Token: device-test-device
|
|
234
|
+
Registered device: VAIBHAV-PC
|
|
235
|
+
Token: device-vaibhav-pc
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## 🎯 Success Criteria
|
|
239
|
+
|
|
240
|
+
- [ ] Backend deployed to cloud
|
|
241
|
+
- [ ] WebSocket connections work
|
|
242
|
+
- [ ] URL saved and documented
|
|
243
|
+
- [ ] Agent updated with new URL
|
|
244
|
+
- [ ] Dashboard updated with new URL
|
|
245
|
+
- [ ] End-to-end test successful
|
|
246
|
+
|
|
247
|
+
## 💰 Costs
|
|
248
|
+
|
|
249
|
+
- **Railway**: Free tier (500 hrs/month)
|
|
250
|
+
- **Render**: Free tier (750 hrs/month)
|
|
251
|
+
- **Heroku**: Free tier discontinued, starts at $7/month
|
|
252
|
+
|
|
253
|
+
## 📞 Support
|
|
254
|
+
|
|
255
|
+
- Railway: https://railway.app/help
|
|
256
|
+
- Render: https://render.com/docs
|
|
257
|
+
- Heroku: https://help.heroku.com
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
**Your backend is ready to deploy!** 🚀
|
package/backend/Procfile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
web: node server.js
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Vortix Backend
|
|
2
|
+
|
|
3
|
+
WebSocket server for coordinating devices and dashboard.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- WebSocket server for real-time communication
|
|
8
|
+
- Device registration and management
|
|
9
|
+
- Command routing between dashboard and agents
|
|
10
|
+
- AI-powered command planning (Ollama integration)
|
|
11
|
+
- Heartbeat monitoring
|
|
12
|
+
|
|
13
|
+
## Environment Variables
|
|
14
|
+
|
|
15
|
+
- `PORT` - Server port (default: 8080)
|
|
16
|
+
|
|
17
|
+
## Local Development
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Install dependencies
|
|
21
|
+
npm install
|
|
22
|
+
|
|
23
|
+
# Start server
|
|
24
|
+
npm start
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Server will run on `ws://localhost:8080`
|
|
28
|
+
|
|
29
|
+
## Deployment
|
|
30
|
+
|
|
31
|
+
### Railway
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
railway up
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Render
|
|
38
|
+
|
|
39
|
+
1. Connect GitHub repo
|
|
40
|
+
2. Set build command: `npm install`
|
|
41
|
+
3. Set start command: `npm start`
|
|
42
|
+
|
|
43
|
+
### Heroku
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
heroku create
|
|
47
|
+
git push heroku main
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## API
|
|
51
|
+
|
|
52
|
+
### WebSocket Endpoints
|
|
53
|
+
|
|
54
|
+
**Agent Connection**
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
ws://backend-url?token=device-hostname
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Dashboard Connection**
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
ws://backend-url?type=dashboard
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Message Types
|
|
67
|
+
|
|
68
|
+
See [ARCHITECTURE.md](../docs/ARCHITECTURE.md) for complete message
|
|
69
|
+
documentation.
|
|
70
|
+
|
|
71
|
+
## Requirements
|
|
72
|
+
|
|
73
|
+
- Node.js >= 14.0.0
|
|
74
|
+
- Ollama running on localhost:11434 (for AI planning)
|
|
75
|
+
|
|
76
|
+
## Notes
|
|
77
|
+
|
|
78
|
+
- AI planning requires Ollama with qwen2.5:7b model
|
|
79
|
+
- Can be modified to use OpenAI instead
|
|
80
|
+
- Supports multiple simultaneous device connections
|