The Backend is a simple Node.js application that uses the pm2 BUS API to communicate and monitor pm2 processes. It doesn't require any open ports, since it only saves data to the database, and events like restart, stop, and delete are relayed through the change stream of MongoDB.
- Node.js v18
- MongoDB Cluster
- PM2 (installed globally)
DB_URI=<MongoDB URI>
SERVER_NAME=used instead of the host name (optional)
-
Install the dependencies
# run from the project root npm install
-
Create a
.env
file in theapps/backend
directory and add the following variablesDB_URI=<MongoDB URI>
You can start it using the following npm command:
# run from the project root
npm run start:apps:backend
To run the process in the background, you can use several tools such as PM2.
This will start it using pm2. Furthermore, you can hide it from the process list through the dashboard.
# run from the project root
pm2 start npm --name "pm2.web-daemon" -- run "start:apps:backend"