|
| 1 | +# pm2.web - Process Monitoring and Management |
| 2 | + |
| 3 | +pm2.web is a web-based application designed to monitor and manage processes running on your server using the PM2 process manager. With pm2.web, you can easily monitor your processes, control them with various actions, view logs, manage server functions, and even set up access controls for users.Easily install, deploy to Vercel, and utilize MongoDB Atlas to maintain a server with 0 open ports or host everything on-premise. |
| 4 | + |
| 5 | +## Pages - Features |
| 6 | + |
| 7 | +1. **Monitoring** |
| 8 | +  |
| 9 | +2. **Process Management** |
| 10 | +  |
| 11 | +3. **Server Management (Planned)** |
| 12 | +4. **Access Control** |
| 13 | +  |
| 14 | +5. **Settings** |
| 15 | +  |
| 16 | +6. **Alert Setup (Planned)** |
| 17 | + |
| 18 | +## Installation |
| 19 | + |
| 20 | +To get started with pm2.web, follow these steps: |
| 21 | + |
| 22 | +### Vercel & MongoDB Atlas |
| 23 | + |
| 24 | +<details> |
| 25 | + <summary>Expand</summary> |
| 26 | + |
| 27 | + #### MongoDB Atlas |
| 28 | + |
| 29 | + 1. Create a MongoDB Atlas account and create a new project. |
| 30 | + 2. Create a new cluster and select the free tier. |
| 31 | + 3. Create a new database user and save the username and password. |
| 32 | + 4. Add your IP address to the IP Access List or through a CIDR block. |
| 33 | + |
| 34 | + #### Vercel |
| 35 | + [](https://vercel.com/new/clone?repository-url=https://github.com/oxdev03/pm2.web&env=MONGO_URI&description=Process+Monitoring+and+Management&rootDirectory=dashboard) |
| 36 | + |
| 37 | + 1. Click the deploy button above and follow the instructions. |
| 38 | + |
| 39 | + #### Backend |
| 40 | + [Follow the instructions here , On-Premise->Backend](#backend1) |
| 41 | + |
| 42 | +</details> |
| 43 | + |
| 44 | +### On-Premise |
| 45 | + |
| 46 | +<details> |
| 47 | + <summary>Expand</summary> |
| 48 | + |
| 49 | +1. Clone the repository to your server. |
| 50 | + |
| 51 | + ```bash |
| 52 | + git clone https://github.com/oxdev03/pm2.web.git |
| 53 | + ``` |
| 54 | + |
| 55 | +#### Backend |
| 56 | +<a name="backend1"></a> |
| 57 | + |
| 58 | +The Backend is a simple nodejs application that uses the pm2 BUS API to communicate and monitor pm2 process. |
| 59 | +It doesn't require any open ports, since it only saves data to the database and events like restart, stop, delete are relayed through the change stream of mongodb. |
| 60 | + |
| 61 | +##### Requirements |
| 62 | + |
| 63 | +- Nodejs v16 |
| 64 | +- MongoDB Cluster |
| 65 | +- PM2 |
| 66 | + |
| 67 | +##### Installation |
| 68 | + |
| 69 | +1. Install the dependencies |
| 70 | + |
| 71 | + ```bash |
| 72 | + cd backend |
| 73 | + npm install |
| 74 | + ``` |
| 75 | + |
| 76 | +2. Create a `.env` file in the backend directory and add the following variables |
| 77 | + |
| 78 | + ```bash |
| 79 | + MONGO_URI=<MongoDB URI> |
| 80 | + ``` |
| 81 | + |
| 82 | +3. Start the backend |
| 83 | + |
| 84 | + ```bash |
| 85 | + npm start |
| 86 | + ``` |
| 87 | + |
| 88 | +#### Frontend |
| 89 | + |
| 90 | +##### Requirements |
| 91 | + |
| 92 | +- Open Port 3000 or 80,443 (if you use a reverse proxy) |
| 93 | +- Nodejs v16 |
| 94 | +- MongoDB |
| 95 | + |
| 96 | +##### Installation |
| 97 | + |
| 98 | +1. Install the dependencies |
| 99 | + |
| 100 | + ```bash |
| 101 | + cd dashboard |
| 102 | + npm install |
| 103 | + ``` |
| 104 | + |
| 105 | +2. Create a `.env` file in the dashboard directory and add the following variables |
| 106 | + |
| 107 | + ```bash |
| 108 | + MONGO_URI=<MongoDB URI> |
| 109 | + NEXTAUTH_URL=<Index URL of the dashboard eg. http://ip:3000> |
| 110 | + ``` |
| 111 | + |
| 112 | +3. Build the frontend |
| 113 | + |
| 114 | + ```bash |
| 115 | + npm run build |
| 116 | + ``` |
| 117 | + |
| 118 | +4. Start the frontend |
| 119 | + |
| 120 | + ```bash |
| 121 | + npm start |
| 122 | + ``` |
| 123 | + |
| 124 | + </details> |
| 125 | + |
| 126 | +## Usage |
| 127 | + |
| 128 | +Once pm2.web is installed and running, you can perform the following actions: |
| 129 | + |
| 130 | +- **Monitoring**: |
| 131 | + |
| 132 | + - Monitor the status, resource usage, and health of your processes from the main dashboard. |
| 133 | + |
| 134 | +- **Process**: |
| 135 | + |
| 136 | + - Stop, restart, or delete processes from the process list page. |
| 137 | + - Access the logs generated by your processes. |
| 138 | + - View key metrics and graphs to assess the performance of your applications. |
| 139 | + - Pm2 Settings & Git Feature |
| 140 | + |
| 141 | +- **Server Management (Planned)**: |
| 142 | + |
| 143 | + - Control server-level functions such as shutdown or restart using the dedicated server management page. |
| 144 | + - Execute these actions securely without the need for direct server access. |
| 145 | + - View key metrics and graphs |
| 146 | + - Configure specific server settings (db log rotation , polling/update interval) |
| 147 | + |
| 148 | +- **Access Control**: |
| 149 | + |
| 150 | + - Manage user access and permissions through the access control settings. |
| 151 | + - Create user accounts, assign roles, and specify the level of access each user has to servers, processes, and application functions. |
| 152 | + |
| 153 | +- **Settings**: |
| 154 | + |
| 155 | + - Configure settings such as the update interval, log rotation, and more. |
| 156 | + |
| 157 | +- **Alert Setup (Planned)**: |
| 158 | + - Configure alerts to receive notifications for specific actions. |
| 159 | + - Define alert rules based on events like shutdown, restart, or kill actions. |
| 160 | + |
| 161 | +## Milestones (based on stars) |
| 162 | + |
| 163 | +I have a lot of ideas for this project, but I don't have the time to implement them all due to my busy schedule. Nor the less the project will be maintained even if it doesn't reach the milestones. |
| 164 | + |
| 165 | +- [x] 0 Stars - Active Maintenance/Bug Fixes |
| 166 | +- [] 20 Stars - Server Management |
| 167 | +- [] 50 Stars - Alert Setup |
| 168 | +- [] 100 Stars - Change Database to PostgreSQL for better performance |
| 169 | +- [] 150 Stars - Live Monitoring (Websocket) |
| 170 | + |
| 171 | +## Contributing |
| 172 | + |
| 173 | +Contributions to pm2.web are welcome! If you would like to contribute to the project, please follow these guidelines: |
| 174 | + |
| 175 | +1. Fork the repository on GitHub. |
| 176 | + |
| 177 | +2. Create a new branch from the `develop` branch to work on your changes. |
| 178 | + |
| 179 | +3. Make your modifications and ensure they adhere to the project's coding standards. |
| 180 | + |
| 181 | +4. Commit your changes with clear and descriptive commit messages. |
| 182 | + |
| 183 | +5. Push your branch to your forked repository. |
| 184 | + |
| 185 | +6. Submit a pull request to the `develop` branch of the main pm2.web repository. |
| 186 | + |
| 187 | +## License |
| 188 | + |
| 189 | +pm2.web is released under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html). For more information, please refer to the [LICENSE](LICENSE) file. |
| 190 | + |
| 191 | +## Support |
| 192 | + |
| 193 | +For any questions, issues, or feature requests, please refer to the project's GitHub repository: [github.com/oxdev03/pm2.web](https://github.com/oxdev03/pm2.web.git). |
| 194 | + |
| 195 | +Open an issue and provide details about your inquiry, and the community or maintainers will assist you as soon as possible. |
| 196 | + |
| 197 | +## Credits |
| 198 | + |
| 199 | +pm2.web is built on the foundation of the PM2 process manager (BUS Api) ([pm2.keymetrics.io](https://pm2.keymetrics.io/)). We acknowledge and appreciate the PM2 team's efforts. |
| 200 | + |
| 201 | +The pm2.web project is currently maintained and supported by a single developer. |
| 202 | + |
| 203 | +## Disclaimer |
| 204 | + |
| 205 | +pm2.web is not affiliated with or endorsed by PM2 or ([pm2.keymetrics.io](https://pm2.keymetrics.io/)). pm2.web is an independent project created by a third-party developer. |
0 commit comments