ezpm2gui 1.6.0 → 1.8.0

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.
Files changed (41) hide show
  1. package/README.md +330 -321
  2. package/bin/ezpm2gui.js +8 -8
  3. package/bin/ezpm2gui.ts +51 -51
  4. package/bin/generate-ecosystem.js +35 -35
  5. package/bin/generate-ecosystem.ts +56 -56
  6. package/dist/server/config/cron-jobs.json +1 -0
  7. package/dist/server/config/project-configs.json +235 -236
  8. package/dist/server/config/remote-connections.json +3 -0
  9. package/dist/server/index.js +42 -3
  10. package/dist/server/routes/deployApplication.js +47 -45
  11. package/dist/server/routes/logStreaming.js +31 -24
  12. package/dist/server/routes/modules.js +55 -0
  13. package/dist/server/routes/pageAuth.js +3 -3
  14. package/dist/server/routes/remoteConnections.js +13 -9
  15. package/dist/server/routes/remoteMetrics.d.ts +3 -0
  16. package/dist/server/routes/remoteMetrics.js +84 -0
  17. package/dist/server/services/ProjectSetupService.d.ts +1 -1
  18. package/dist/server/services/ProjectSetupService.js +25 -9
  19. package/dist/server/utils/metrics-history.d.ts +21 -0
  20. package/dist/server/utils/metrics-history.js +68 -0
  21. package/dist/server/utils/remote-metrics-db.d.ts +29 -0
  22. package/dist/server/utils/remote-metrics-db.js +134 -0
  23. package/dist/server/utils/remote-metrics-poller.d.ts +8 -0
  24. package/dist/server/utils/remote-metrics-poller.js +67 -0
  25. package/package.json +86 -73
  26. package/scripts/postinstall.js +36 -36
  27. package/src/client/build/asset-manifest.json +6 -6
  28. package/src/client/build/favicon.ico +2 -2
  29. package/src/client/build/index.html +1 -1
  30. package/src/client/build/logo192.svg +7 -7
  31. package/src/client/build/logo512.svg +7 -7
  32. package/src/client/build/manifest.json +24 -24
  33. package/src/client/build/static/css/main.9decb204.css +5 -0
  34. package/src/client/build/static/css/main.9decb204.css.map +1 -0
  35. package/src/client/build/static/js/main.28a4a583.js +3 -0
  36. package/src/client/build/static/js/main.28a4a583.js.map +1 -0
  37. package/src/client/build/static/css/main.775772ee.css +0 -5
  38. package/src/client/build/static/css/main.775772ee.css.map +0 -1
  39. package/src/client/build/static/js/main.cbcb09c9.js +0 -3
  40. package/src/client/build/static/js/main.cbcb09c9.js.map +0 -1
  41. /package/src/client/build/static/js/{main.cbcb09c9.js.LICENSE.txt → main.28a4a583.js.LICENSE.txt} +0 -0
package/README.md CHANGED
@@ -1,321 +1,330 @@
1
- # EZ PM2 GUI
2
-
3
- A modern web-based graphical user interface for the PM2 process manager, built with TypeScript, Tailwind CSS, and React.
4
-
5
- ## Screenshots
6
-
7
- **Process Dashboard** — live system metrics and every PM2 process at a glance:
8
-
9
- ![Process Dashboard](ezpm2gui/screenshots/01-processes.png)
10
-
11
- **Monitoring** — real-time CPU, memory and uptime per process:
12
-
13
- ![Process Monitor](ezpm2gui/screenshots/02-monitoring.png)
14
-
15
- **Deploy App** — start new PM2 processes from a structured form:
16
-
17
- ![Deploy App](ezpm2gui/screenshots/04-deploy-app.png)
18
-
19
- **Cron Jobs** — schedule recurring tasks without touching crontab:
20
-
21
- ![Cron Jobs](ezpm2gui/screenshots/08-cron-jobs.png)
22
-
23
- **Settings** — auto-saved preferences for refresh, logs, theme and security:
24
-
25
- ![Settings](ezpm2gui/screenshots/11-settings.png)
26
-
27
- > See the full visual walkthrough in [https://ezpm2gui.vercel.app/](https://ezpm2gui.vercel.app/) every screen is annotated with a screenshot.
28
-
29
- ## Features
30
-
31
- - **Real-time process monitoring** - Keep track of all your PM2 processes in real-time
32
- - **Process management** - Start, stop, restart, and delete processes with one click
33
- - **System metrics dashboard** - Monitor CPU, memory usage, and uptime
34
- - **Enhanced log streaming** - View and filter logs from multiple processes simultaneously
35
- - **WebSocket for live updates** - Get instant updates without refreshing
36
- - **Process CPU and memory charts** - Visualize performance metrics over time
37
- - **Filter processes by status or name** - Quickly find the processes you need
38
- - **Dark/light mode** - Fully supported across all pages with Tailwind CSS
39
- - **Cluster management** - Easily scale your Node.js applications
40
- - **Application deployment** - Deploy new applications directly from the UI
41
- - **Ecosystem configuration** - Create and manage your PM2 ecosystem files
42
- - **PM2 modules support** - Manage and configure PM2 modules
43
- - **Cron Jobs** - Schedule and manage automated tasks with visual cron expression builder
44
- - **Remote Server Management** - Connect and manage PM2 on remote servers via SSH
45
- - **Advanced Monitoring Dashboard** - Real-time performance charts with health scoring
46
- - **Tailwind CSS UI** - Sleek, compact, and responsive design with consistent dark/light theming
47
- - **Fully typed with TypeScript** - Robust and maintainable codebase
48
-
49
- ## Detailed Features
50
-
51
- ### Process Monitoring
52
- Monitor all your PM2 processes in real-time with detailed information on CPU usage, memory consumption, uptime, and status. The intuitive interface makes it easy to identify issues at a glance.
53
-
54
- ### Remote Server Management
55
- Connect to and manage PM2 processes on remote servers via secure SSH connections:
56
- - Add multiple remote server connections with SSH credentials
57
- - View and manage processes on remote servers
58
- - Stream logs from remote processes in real-time
59
- - Execute PM2 commands on remote machines
60
- - Encrypted credential storage for security
61
-
62
- ### Cron Jobs
63
- Schedule and automate tasks using PM2's cron restart feature:
64
- - Visual cron expression builder with common presets
65
- - Support for Node.js, Python, Shell, and .NET scripts
66
- - Inline script editor or file-based execution
67
- - Enable/disable jobs without deleting them
68
- - View next execution times and job status
69
-
70
- ### Advanced Monitoring Dashboard
71
- Get deeper insights into your system and process performance:
72
- - Real-time performance charts for CPU, memory, and load
73
- - System health score calculation
74
- - Historical metrics tracking
75
- - Process alerts for high resource usage
76
- - Per-process performance visualization
77
-
78
- ### Application Deployment
79
- Deploy new Node.js applications to PM2 directly from the UI. Configure all the necessary options including:
80
- - Application name and script path
81
- - Working directory
82
- - Number of instances for load balancing
83
- - Execution mode (fork or cluster)
84
- - Auto-restart options
85
- - Memory threshold for restarts
86
- - Environment variables
87
-
88
- ### Cluster Management
89
- Easily scale your Node.js applications with the cluster management interface. Add or remove instances on the fly and switch between fork and cluster execution modes for optimal performance.
90
-
91
- ### Log Streaming
92
- View and filter logs from multiple processes simultaneously with the enhanced log streaming interface. Features include:
93
- - Real-time log updates via WebSocket
94
- - Filtering by process, log level, or content
95
- - Pausing and resuming log streams
96
- - Download logs for offline analysis
97
- - Floating log panel for remote process logs
98
-
99
- ### Ecosystem Configuration
100
- Generate and manage PM2 ecosystem configuration files directly from the UI. This makes it easy to set up complex application deployments and share configurations across your team.
101
-
102
- ### PM2 Modules
103
- Manage and configure PM2 modules to extend the functionality of your PM2 installation. Install, update, and remove modules with a few clicks.
104
-
105
- ### System Metrics
106
- Monitor key system metrics including:
107
- - CPU usage and number of cores
108
- - Memory usage and availability
109
- - System uptime
110
- - Load averages (1, 5, and 15 minutes)
111
-
112
- ### User Interface
113
- EZ PM2 GUI uses Tailwind CSS for a sleek, compact, and fully responsive interface:
114
- - Dark and light mode support across all pages
115
- - Consistent color theming with smooth transitions
116
- - Compact layout with small fonts and reduced spacing for information density
117
- - `PageHeader` and `LogStatusBar` reusable components for a consistent look
118
- - Configure dashboard refresh intervals and log display settings from Settings
119
-
120
- ## Installation
121
-
122
- ### Global Installation
123
-
124
- ```bash
125
- npm install -g ezpm2gui
126
- ```
127
-
128
- ### Local Installation
129
-
130
- ```bash
131
- npm install ezpm2gui
132
- ```
133
-
134
- ## Usage
135
-
136
- ### As a Command Line Tool (Global Installation)
137
-
138
- ```bash
139
- # Start the EZ PM2 GUI web interface
140
- ezpm2gui
141
-
142
- # Start on a specific port
143
- ezpm2gui --port 4000
144
-
145
- # Start bound to all network interfaces
146
- ezpm2gui --host 0.0.0.0
147
-
148
- # Generate a sample PM2 ecosystem config
149
- ezpm2gui-generate-ecosystem
150
- ```
151
-
152
- ### As a Module (Local Installation)
153
-
154
- ```javascript
155
- const ezpm2gui = require('ezpm2gui');
156
-
157
- // Start the server with default options
158
- ezpm2gui.start();
159
-
160
- // Or with custom options
161
- ezpm2gui.start({
162
- port: 3030,
163
- host: '0.0.0.0'
164
- });
165
- ```
166
-
167
- ### Access the UI
168
-
169
- Once started, open your browser and navigate to:
170
-
171
- ```
172
- http://localhost:3001
173
- ```
174
-
175
- ## Requirements
176
-
177
- - Node.js 16.x or later
178
- - PM2 installed globally (`npm install -g pm2`)
179
-
180
- ## Configuration
181
-
182
- EZ PM2 GUI uses environment variables for configuration:
183
-
184
- - `PORT`: The port to run the server on (default: 3001)
185
- - `HOST`: The host to bind to (default: localhost)
186
-
187
- ## Load Balancing with PM2
188
-
189
- EZ PM2 GUI provides an easy interface to manage PM2's load balancing capabilities:
190
-
191
- ### Setting Up Load Balancing
192
-
193
- 1. **Deploy a new application or modify an existing one**:
194
- - Set the number of instances to greater than 1 (or 0/-1 for max instances based on CPU cores)
195
- - Choose "Cluster" as the execution mode for optimal load balancing
196
-
197
- 2. **Manage your cluster**:
198
- - Use the Cluster Management section to scale instances up or down
199
- - Switch between fork and cluster execution modes
200
- - Reload all instances with zero downtime
201
-
202
- ### How Load Balancing Works
203
-
204
- PM2 provides built-in load balancing when you run your Node.js applications in cluster mode with multiple instances:
205
-
206
- - **Cluster Mode**: In this mode, PM2 uses Node.js's cluster module to create multiple worker processes that share the same server port
207
- - **Multiple Instances**: Incoming requests are automatically distributed across your instances
208
- - **Zero Downtime Reloads**: When updating your application, PM2 can reload instances one by one to avoid downtime
209
-
210
- ### Best Practices
211
-
212
- - For CPU-intensive applications, use a number of instances equal to the number of CPU cores
213
- - For I/O-intensive applications, you can use more instances than CPU cores
214
- - Always use cluster mode for load balancing to ensure port sharing between instances
215
- - Use the reload feature instead of restart for zero-downtime deployments
216
-
217
- ## Development
218
-
219
- See [DEVELOPMENT.md](DEVELOPMENT.md) for detailed development instructions.
220
-
221
- ```bash
222
- # Clone the repository
223
- git clone https://github.com/thechandanbhagat/ezpm2gui.git
224
- cd ezpm2gui
225
-
226
- # Install dependencies and build
227
- ./install.sh # On Linux/macOS
228
- install.bat # On Windows
229
-
230
- # Start in development mode
231
- npm run dev
232
-
233
- # Build the application
234
- npm run build
235
-
236
- # Start the application (production mode)
237
- npm start
238
- ```
239
-
240
- ### Project Structure
241
-
242
- ```
243
- ezpm2gui/
244
- ├── bin/ # CLI entry points
245
- ├── dist/ # Compiled output
246
- ├── docs/ # Documentation
247
- ├── screenshots/ # Application screenshots
248
- ├── scripts/ # Build and utility scripts
249
- ├── src/ # Source code
250
- │ ├── client/ # React frontend
251
- │ │ ├── public/ # Static assets
252
- │ │ └── src/ # React components and logic
253
- │ │ ├── components/ # UI components
254
- │ │ └── types/ # TypeScript types for client
255
- ├── server/ # Express backend
256
- │ │ ├── routes/ # API routes
257
- │ │ └── utils/ # Server utilities
258
- │ └── types/ # Shared TypeScript types
259
- └── test/ # Test files
260
- ```
261
-
262
- ## Contributing
263
-
264
- Contributions are welcome! Please feel free to submit a Pull Request.
265
-
266
- 1. Fork the repository
267
- 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
268
- 3. Make your changes
269
- 4. Run the tests to ensure everything works
270
- 5. Commit your changes using our [commit guidelines](./docs/COMMIT_GUIDE.md)
271
- 6. Push to the branch (`git push origin feature/amazing-feature`)
272
- 7. Open a Pull Request
273
-
274
- ### Coding Style
275
-
276
- This project follows standardized TypeScript conventions and uses ESLint for code quality. Before submitting a pull request, please ensure your code follows these guidelines by running:
277
-
278
- ```bash
279
- npm run lint
280
- ```
281
-
282
- ## FAQ
283
-
284
- ### Q: How does EZ PM2 GUI differ from pm2-gui and PM2 Plus?
285
-
286
- A: EZ PM2 GUI is a modern, TypeScript-based alternative to pm2-gui with a more user-friendly interface and additional features. Unlike PM2 Plus, it's completely free and open-source, running locally on your server rather than in the cloud.
287
-
288
- ### Q: Can I use EZ PM2 GUI with PM2 running on a different machine?
289
-
290
- A: Yes, you can configure EZ PM2 GUI to connect to a remote PM2 installation. You'll need to specify the connection details in the application settings.
291
-
292
- ### Q: How do I generate an ecosystem file from my existing processes?
293
-
294
- A: Use the `ezpm2gui-generate-ecosystem` command-line tool, or visit the Ecosystem Config section in the web UI.
295
-
296
- ### Q: Can EZ PM2 GUI handle a large number of processes?
297
-
298
- A: Yes, EZ PM2 GUI is designed to handle dozens of processes efficiently. The UI is optimized to present large amounts of information in a digestible format.
299
-
300
- ### Q: Is EZ PM2 GUI secure?
301
-
302
- A: By default, EZ PM2 GUI binds to localhost for security reasons. If you expose the interface to other machines, consider adding authentication through a reverse proxy like Nginx.
303
-
304
- ## Related Projects
305
-
306
- - [PM2](https://github.com/Unitech/pm2) - The process manager that EZ PM2 GUI works with
307
- - [pm2-gui](https://github.com/Tjatse/pm2-gui) - The original inspiration for this project
308
-
309
- ## License
310
-
311
- GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See [LICENSE](LICENSE).
312
-
313
- EZ PM2 GUI interfaces with [PM2](https://github.com/Unitech/pm2), which is licensed under AGPL-3.0. Because this project links PM2 as a library, it is distributed under the same license.
314
-
315
- ## Credits
316
-
317
- Built by [Chandan Bhagat](https://github.com/thechandanbhagat) as a modern alternative to pm2-gui.
318
-
319
- ---
320
-
321
- **Note**: EZ PM2 GUI is not officially affiliated with PM2 or PM2 Plus. It's an independent tool that interfaces with the PM2 process manager.
1
+ # EZ PM2 GUI
2
+
3
+ A modern web-based graphical user interface for the PM2 process manager, built with TypeScript, Tailwind CSS, and React.
4
+
5
+ ## Screenshots
6
+
7
+ **Process Dashboard** — live system metrics and every PM2 process at a glance:
8
+
9
+ ![Process Dashboard](ezpm2gui/screenshots/01-processes.png)
10
+
11
+ **Monitoring** — real-time CPU, memory and uptime per process:
12
+
13
+ ![Process Monitor](ezpm2gui/screenshots/02-monitoring.png)
14
+
15
+ **Metrics (Live)** — rolling 1-hour sparklines per process, updated every 3 seconds:
16
+
17
+ ![Metrics Live](ezpm2gui/screenshots/12-metrics-live.png)
18
+
19
+ **Metrics (History)** — SQLite-backed CPU and memory charts with selectable time range:
20
+
21
+ ![Metrics History](ezpm2gui/screenshots/13-metrics-history.png)
22
+
23
+ **Deploy App** — start new PM2 processes from a structured form:
24
+
25
+ ![Deploy App](ezpm2gui/screenshots/04-deploy-app.png)
26
+
27
+ **Cron Jobs**schedule recurring tasks without touching crontab:
28
+
29
+ ![Cron Jobs](ezpm2gui/screenshots/08-cron-jobs.png)
30
+
31
+ **Settings** auto-saved preferences for refresh, logs, theme and security:
32
+
33
+ ![Settings](ezpm2gui/screenshots/11-settings.png)
34
+
35
+ > See the full visual walkthrough in [https://ezpm2gui.vercel.app/](https://ezpm2gui.vercel.app/) every screen is annotated with a screenshot.
36
+
37
+ ## Features
38
+
39
+ - **Real-time process monitoring** - Keep track of all your PM2 processes in real-time
40
+ - **Process management** - Start, stop, restart, and delete processes with one click
41
+ - **System metrics dashboard** - Monitor CPU, memory usage, and uptime
42
+ - **Metrics page with live sparklines** - Per-process rolling 1-hour CPU and memory micro-graphs updated every 3s; switch to History tab for SQLite-backed long-term charts
43
+ - **Enhanced log streaming** - View and filter logs from multiple processes simultaneously
44
+ - **WebSocket for live updates** - Get instant updates without refreshing
45
+ - **Process CPU and memory charts** - Visualize performance metrics over time
46
+ - **Filter processes by status or name** - Quickly find the processes you need
47
+ - **Dark/light mode** - Fully supported across all pages with Tailwind CSS
48
+ - **Cluster management** - Easily scale your Node.js applications
49
+ - **Application deployment** - Deploy new applications directly from the UI
50
+ - **Ecosystem configuration** - Create and manage your PM2 ecosystem files
51
+ - **PM2 modules support** - Manage and configure PM2 modules
52
+ - **Cron Jobs** - Schedule and manage automated tasks with visual cron expression builder
53
+ - **Remote Server Management** - Connect and manage PM2 on remote servers via SSH
54
+ - **Advanced Monitoring Dashboard** - Real-time performance charts with health scoring
55
+ - **Tailwind CSS UI** - Sleek, compact, and responsive design with consistent dark/light theming
56
+ - **Fully typed with TypeScript** - Robust and maintainable codebase
57
+
58
+ ## Detailed Features
59
+
60
+ ### Process Monitoring
61
+ Monitor all your PM2 processes in real-time with detailed information on CPU usage, memory consumption, uptime, and status. The intuitive interface makes it easy to identify issues at a glance.
62
+
63
+ ### Remote Server Management
64
+ Connect to and manage PM2 processes on remote servers via secure SSH connections:
65
+ - Add multiple remote server connections with SSH credentials
66
+ - View and manage processes on remote servers
67
+ - Stream logs from remote processes in real-time
68
+ - Execute PM2 commands on remote machines
69
+ - Encrypted credential storage for security
70
+
71
+ ### Cron Jobs
72
+ Schedule and automate tasks using PM2's cron restart feature:
73
+ - Visual cron expression builder with common presets
74
+ - Support for Node.js, Python, Shell, and .NET scripts
75
+ - Inline script editor or file-based execution
76
+ - Enable/disable jobs without deleting them
77
+ - View next execution times and job status
78
+
79
+ ### Advanced Monitoring Dashboard
80
+ Get deeper insights into your system and process performance:
81
+ - Real-time performance charts for CPU, memory, and load
82
+ - System health score calculation
83
+ - Historical metrics tracking
84
+ - Process alerts for high resource usage
85
+ - Per-process performance visualization
86
+
87
+ ### Application Deployment
88
+ Deploy new Node.js applications to PM2 directly from the UI. Configure all the necessary options including:
89
+ - Application name and script path
90
+ - Working directory
91
+ - Number of instances for load balancing
92
+ - Execution mode (fork or cluster)
93
+ - Auto-restart options
94
+ - Memory threshold for restarts
95
+ - Environment variables
96
+
97
+ ### Cluster Management
98
+ Easily scale your Node.js applications with the cluster management interface. Add or remove instances on the fly and switch between fork and cluster execution modes for optimal performance.
99
+
100
+ ### Log Streaming
101
+ View and filter logs from multiple processes simultaneously with the enhanced log streaming interface. Features include:
102
+ - Real-time log updates via WebSocket
103
+ - Filtering by process, log level, or content
104
+ - Pausing and resuming log streams
105
+ - Download logs for offline analysis
106
+ - Floating log panel for remote process logs
107
+
108
+ ### Ecosystem Configuration
109
+ Generate and manage PM2 ecosystem configuration files directly from the UI. This makes it easy to set up complex application deployments and share configurations across your team.
110
+
111
+ ### PM2 Modules
112
+ Manage and configure PM2 modules to extend the functionality of your PM2 installation. Install, update, and remove modules with a few clicks.
113
+
114
+ ### System Metrics
115
+ Monitor key system metrics including:
116
+ - CPU usage and number of cores
117
+ - Memory usage and availability
118
+ - System uptime
119
+ - Load averages (1, 5, and 15 minutes)
120
+
121
+ ### User Interface
122
+ EZ PM2 GUI uses Tailwind CSS for a sleek, compact, and fully responsive interface:
123
+ - Dark and light mode support across all pages
124
+ - Consistent color theming with smooth transitions
125
+ - Compact layout with small fonts and reduced spacing for information density
126
+ - `PageHeader` and `LogStatusBar` reusable components for a consistent look
127
+ - Configure dashboard refresh intervals and log display settings from Settings
128
+
129
+ ## Installation
130
+
131
+ ### Global Installation
132
+
133
+ ```bash
134
+ npm install -g ezpm2gui
135
+ ```
136
+
137
+ ### Local Installation
138
+
139
+ ```bash
140
+ npm install ezpm2gui
141
+ ```
142
+
143
+ ## Usage
144
+
145
+ ### As a Command Line Tool (Global Installation)
146
+
147
+ ```bash
148
+ # Start the EZ PM2 GUI web interface
149
+ ezpm2gui
150
+
151
+ # Start on a specific port
152
+ ezpm2gui --port 4000
153
+
154
+ # Start bound to all network interfaces
155
+ ezpm2gui --host 0.0.0.0
156
+
157
+ # Generate a sample PM2 ecosystem config
158
+ ezpm2gui-generate-ecosystem
159
+ ```
160
+
161
+ ### As a Module (Local Installation)
162
+
163
+ ```javascript
164
+ const ezpm2gui = require('ezpm2gui');
165
+
166
+ // Start the server with default options
167
+ ezpm2gui.start();
168
+
169
+ // Or with custom options
170
+ ezpm2gui.start({
171
+ port: 3030,
172
+ host: '0.0.0.0'
173
+ });
174
+ ```
175
+
176
+ ### Access the UI
177
+
178
+ Once started, open your browser and navigate to:
179
+
180
+ ```
181
+ http://localhost:3001
182
+ ```
183
+
184
+ ## Requirements
185
+
186
+ - Node.js 16.x or later
187
+ - PM2 installed globally (`npm install -g pm2`)
188
+
189
+ ## Configuration
190
+
191
+ EZ PM2 GUI uses environment variables for configuration:
192
+
193
+ - `PORT`: The port to run the server on (default: 3001)
194
+ - `HOST`: The host to bind to (default: localhost)
195
+
196
+ ## Load Balancing with PM2
197
+
198
+ EZ PM2 GUI provides an easy interface to manage PM2's load balancing capabilities:
199
+
200
+ ### Setting Up Load Balancing
201
+
202
+ 1. **Deploy a new application or modify an existing one**:
203
+ - Set the number of instances to greater than 1 (or 0/-1 for max instances based on CPU cores)
204
+ - Choose "Cluster" as the execution mode for optimal load balancing
205
+
206
+ 2. **Manage your cluster**:
207
+ - Use the Cluster Management section to scale instances up or down
208
+ - Switch between fork and cluster execution modes
209
+ - Reload all instances with zero downtime
210
+
211
+ ### How Load Balancing Works
212
+
213
+ PM2 provides built-in load balancing when you run your Node.js applications in cluster mode with multiple instances:
214
+
215
+ - **Cluster Mode**: In this mode, PM2 uses Node.js's cluster module to create multiple worker processes that share the same server port
216
+ - **Multiple Instances**: Incoming requests are automatically distributed across your instances
217
+ - **Zero Downtime Reloads**: When updating your application, PM2 can reload instances one by one to avoid downtime
218
+
219
+ ### Best Practices
220
+
221
+ - For CPU-intensive applications, use a number of instances equal to the number of CPU cores
222
+ - For I/O-intensive applications, you can use more instances than CPU cores
223
+ - Always use cluster mode for load balancing to ensure port sharing between instances
224
+ - Use the reload feature instead of restart for zero-downtime deployments
225
+
226
+ ## Development
227
+
228
+ See [DEVELOPMENT.md](DEVELOPMENT.md) for detailed development instructions.
229
+
230
+ ```bash
231
+ # Clone the repository
232
+ git clone https://github.com/thechandanbhagat/ezpm2gui.git
233
+ cd ezpm2gui
234
+
235
+ # Install dependencies and build
236
+ ./install.sh # On Linux/macOS
237
+ install.bat # On Windows
238
+
239
+ # Start in development mode
240
+ npm run dev
241
+
242
+ # Build the application
243
+ npm run build
244
+
245
+ # Start the application (production mode)
246
+ npm start
247
+ ```
248
+
249
+ ### Project Structure
250
+
251
+ ```
252
+ ezpm2gui/
253
+ ├── bin/ # CLI entry points
254
+ ├── dist/ # Compiled output
255
+ ├── docs/ # Documentation
256
+ ├── screenshots/ # Application screenshots
257
+ ├── scripts/ # Build and utility scripts
258
+ ├── src/ # Source code
259
+ │ ├── client/ # React frontend
260
+ │ │ ├── public/ # Static assets
261
+ │ │ └── src/ # React components and logic
262
+ │ │ ├── components/ # UI components
263
+ │ │ └── types/ # TypeScript types for client
264
+ │ ├── server/ # Express backend
265
+ │ │ ├── routes/ # API routes
266
+ │ │ └── utils/ # Server utilities
267
+ │ └── types/ # Shared TypeScript types
268
+ └── test/ # Test files
269
+ ```
270
+
271
+ ## Contributing
272
+
273
+ Contributions are welcome! Please feel free to submit a Pull Request.
274
+
275
+ 1. Fork the repository
276
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
277
+ 3. Make your changes
278
+ 4. Run the tests to ensure everything works
279
+ 5. Commit your changes using our [commit guidelines](./docs/COMMIT_GUIDE.md)
280
+ 6. Push to the branch (`git push origin feature/amazing-feature`)
281
+ 7. Open a Pull Request
282
+
283
+ ### Coding Style
284
+
285
+ This project follows standardized TypeScript conventions and uses ESLint for code quality. Before submitting a pull request, please ensure your code follows these guidelines by running:
286
+
287
+ ```bash
288
+ npm run lint
289
+ ```
290
+
291
+ ## FAQ
292
+
293
+ ### Q: How does EZ PM2 GUI differ from pm2-gui and PM2 Plus?
294
+
295
+ A: EZ PM2 GUI is a modern, TypeScript-based alternative to pm2-gui with a more user-friendly interface and additional features. Unlike PM2 Plus, it's completely free and open-source, running locally on your server rather than in the cloud.
296
+
297
+ ### Q: Can I use EZ PM2 GUI with PM2 running on a different machine?
298
+
299
+ A: Yes, you can configure EZ PM2 GUI to connect to a remote PM2 installation. You'll need to specify the connection details in the application settings.
300
+
301
+ ### Q: How do I generate an ecosystem file from my existing processes?
302
+
303
+ A: Use the `ezpm2gui-generate-ecosystem` command-line tool, or visit the Ecosystem Config section in the web UI.
304
+
305
+ ### Q: Can EZ PM2 GUI handle a large number of processes?
306
+
307
+ A: Yes, EZ PM2 GUI is designed to handle dozens of processes efficiently. The UI is optimized to present large amounts of information in a digestible format.
308
+
309
+ ### Q: Is EZ PM2 GUI secure?
310
+
311
+ A: By default, EZ PM2 GUI binds to localhost for security reasons. If you expose the interface to other machines, consider adding authentication through a reverse proxy like Nginx.
312
+
313
+ ## Related Projects
314
+
315
+ - [PM2](https://github.com/Unitech/pm2) - The process manager that EZ PM2 GUI works with
316
+ - [pm2-gui](https://github.com/Tjatse/pm2-gui) - The original inspiration for this project
317
+
318
+ ## License
319
+
320
+ GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See [LICENSE](LICENSE).
321
+
322
+ EZ PM2 GUI interfaces with [PM2](https://github.com/Unitech/pm2), which is licensed under AGPL-3.0. Because this project links PM2 as a library, it is distributed under the same license.
323
+
324
+ ## Credits
325
+
326
+ Built by [Chandan Bhagat](https://github.com/thechandanbhagat) as a modern alternative to pm2-gui.
327
+
328
+ ---
329
+
330
+ **Note**: EZ PM2 GUI is not officially affiliated with PM2 or PM2 Plus. It's an independent tool that interfaces with the PM2 process manager.