krsyer-server-monitor-pro 1.0.27 → 1.0.29
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/monitor.js +7 -0
- package/package.json +9 -4
- package/DEPLOY_GUIDE.md +0 -68
- package/bin/cli.js +0 -84
- package/guestguru-api/.idea/guestguru-api.iml +0 -9
- package/guestguru-api/.idea/misc.xml +0 -6
- package/guestguru-api/.idea/modules.xml +0 -8
- package/guestguru-api/.idea/vcs.xml +0 -6
- package/guestguru-api/API_DESIGN_GUIDE.md +0 -140
- package/guestguru-api/API_DOCUMENTATION.md +0 -504
- package/guestguru-api/API_REQUIREMENTS_TENANTS.md +0 -110
- package/guestguru-api/AVAILABLE_TENANT_ENDPOINTS.md +0 -137
- package/guestguru-api/BACKEND_INSTRUCTIONS.md +0 -77
- package/guestguru-api/DINING_MODULE_INTEGRATION.md +0 -175
- package/guestguru-api/FRONTEND_FINANCE_MODULE.md +0 -151
- package/guestguru-api/README.md +0 -93
- package/guestguru-api/app.json +0 -12
- package/guestguru-api/database.sqlite +0 -0
- package/guestguru-api/eas.json +0 -21
- package/guestguru-api/ecosystem.config.js +0 -19
- package/guestguru-api/fix_db_schema.js +0 -77
- package/guestguru-api/list_columns.js +0 -27
- package/guestguru-api/package.json +0 -34
- package/guestguru-api/postman_backend_v2.json +0 -1745
- package/guestguru-api/postman_collection.json +0 -477
- package/guestguru-api/postman_environment.json +0 -17
- package/guestguru-api/public/icon.png +0 -0
- package/guestguru-api/public/icon_b64.txt +0 -1
- package/guestguru-api/readd_column.js +0 -27
- package/guestguru-api/server.js +0 -263
- package/guestguru-api/test_cashfree_connection.js +0 -52
- package/lib/controllers/cloudflareController.js +0 -1
- package/lib/controllers/dockerController.js +0 -1
- package/lib/controllers/networkController.js +0 -1
- package/lib/controllers/serverController.js +0 -1
- package/lib/ecosystem.config.js +0 -1
- package/lib/middleware/saasAuth.js +0 -1
- package/lib/public/login.html +0 -99
- package/lib/public/payment.html +0 -152
- package/lib/public/script.js +0 -1180
- package/lib/public/style.css +0 -1045
- package/lib/routes/cloudflareRoutes.js +0 -1
- package/lib/routes/dockerRoutes.js +0 -1
- package/lib/routes/networkRoutes.js +0 -1
- package/lib/routes/serverRoutes.js +0 -1
- package/lib/server.js +0 -1
- package/lib/services/cashfreeService.js +0 -1
- package/lib/views/activate.html +0 -109
- package/lib/views/index.html +0 -552
- package/license-portal/.env.example +0 -15
- package/license-portal/README.md +0 -93
- package/license-portal/ecosystem.config.js +0 -16
- package/license-portal/package.json +0 -22
- package/license-portal/server.js +0 -306
- package/license-portal/services/emailService.js +0 -126
- package/license-portal/views/pricing.html +0 -358
- package/temp_cf_method.js +0 -48
package/package.json
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "krsyer-server-monitor-pro",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"description": "API to get server details like IP address, health, applications running, etc.",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "monitor.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"monitor.js",
|
|
8
|
+
"README.md"
|
|
9
|
+
],
|
|
6
10
|
"bin": {
|
|
7
|
-
"server-monitor": "
|
|
11
|
+
"server-monitor": "monitor.js"
|
|
8
12
|
},
|
|
9
13
|
"scripts": {
|
|
10
14
|
"start": "node src/server.js",
|
|
11
15
|
"dev": "nodemon src/server.js",
|
|
12
16
|
"obfuscate": "node scripts/build.js",
|
|
13
|
-
"build": "
|
|
17
|
+
"build": "node scripts/final-build.js",
|
|
14
18
|
"binary": "npm run build && pkg . --output dist/server-monitor",
|
|
15
19
|
"prepublishOnly": "npm run build",
|
|
16
20
|
"postinstall": "echo \"\n\u001b[32m [Server Monitor] To run as a service, type: sudo npx server-monitor setup \u001b[0m\n\""
|
|
@@ -53,6 +57,7 @@
|
|
|
53
57
|
"socket.io": "^4.8.3"
|
|
54
58
|
},
|
|
55
59
|
"devDependencies": {
|
|
60
|
+
"@vercel/ncc": "^0.38.4",
|
|
56
61
|
"javascript-obfuscator": "^5.1.0",
|
|
57
62
|
"localtunnel": "^2.0.2",
|
|
58
63
|
"nodemon": "^3.0.2",
|
package/DEPLOY_GUIDE.md
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# 🚀 Deployment Guide for Ubuntu Server
|
|
2
|
-
|
|
3
|
-
You have successfully downloaded the package. Now you need to **configure** and **start** it.
|
|
4
|
-
|
|
5
|
-
## 1. Create a Project Folder (If not already created)
|
|
6
|
-
```bash
|
|
7
|
-
mkdir monitor-app
|
|
8
|
-
cd monitor-app
|
|
9
|
-
npm init -y
|
|
10
|
-
npm install krsyer-server-monitor-pro
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## 2. Create the Configuration File (`.env`)
|
|
14
|
-
You **MUST** create a `.env` file to set your credentials.
|
|
15
|
-
|
|
16
|
-
Run this command to create and edit the file:
|
|
17
|
-
```bash
|
|
18
|
-
nano .env
|
|
19
|
-
```
|
|
20
|
-
Paste the following content into it:
|
|
21
|
-
|
|
22
|
-
```env
|
|
23
|
-
PORT=3014
|
|
24
|
-
NODE_ENV=production
|
|
25
|
-
ADMIN_USER=admin@example.com
|
|
26
|
-
ADMIN_PASS=StrongPass123!
|
|
27
|
-
|
|
28
|
-
# Cashfree Production Credentials
|
|
29
|
-
CASHFREE_APP_ID=1164413cb8a8b0f8c98da00bd0f3144611
|
|
30
|
-
CASHFREE_SECRET_KEY=cfsk_ma_prod_126e046813270a58359788647a1ae315_bbef541f
|
|
31
|
-
|
|
32
|
-
# YOUR SERVER CONFIGURATION
|
|
33
|
-
# Set this to your Server's Public IP or Domain
|
|
34
|
-
# NOTE: Cashfree Payments REQUIRE 'https://' to see the payment page.
|
|
35
|
-
# If you use HTTP, dashboard will work, but payment creation will fail.
|
|
36
|
-
APP_URL=http://YOUR_SERVER_IP:3014
|
|
37
|
-
|
|
38
|
-
# License Key
|
|
39
|
-
# We include this DEMO key so you can Log In and see the Dashboard immediately.
|
|
40
|
-
# To test the Payment Flow, REMOVE this line or comment it out (#).
|
|
41
|
-
LICENSE_KEY=DEMO-123
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
*(Press `Ctrl+X`, then `Y`, then `Enter` to save)*
|
|
45
|
-
|
|
46
|
-
## 3. Start the Server
|
|
47
|
-
Run the following command inside your folder:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
npx server-monitor start --port 3014
|
|
51
|
-
```
|
|
52
|
-
*(If prompted to install `krsyer-server-monitor-pro`, type `y`)*
|
|
53
|
-
|
|
54
|
-
## 4. How to Access
|
|
55
|
-
Open your browser and visit:
|
|
56
|
-
`http://YOUR_SERVER_IP:3014`
|
|
57
|
-
|
|
58
|
-
- **Login**: `admin@example.com` / `StrongPass123!`
|
|
59
|
-
- **Dashboard**: Works immediately because of `LICENSE_KEY=DEMO-123`.
|
|
60
|
-
|
|
61
|
-
## 5. Enable Background Mode (Optional)
|
|
62
|
-
To keep the server running after you close the terminal:
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
npm install -g pm2
|
|
66
|
-
pm2 start server-monitor -- start --port 3014
|
|
67
|
-
pm2 save
|
|
68
|
-
```
|
package/bin/cli.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { Command } = require('commander');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const program = new Command();
|
|
6
|
-
|
|
7
|
-
program
|
|
8
|
-
.name('server-monitor')
|
|
9
|
-
.description('Comprehensive server monitoring API and Dashboard')
|
|
10
|
-
.version('1.0.0');
|
|
11
|
-
|
|
12
|
-
const fs = require('fs');
|
|
13
|
-
const { execSync } = require('child_process');
|
|
14
|
-
|
|
15
|
-
program
|
|
16
|
-
.command('start')
|
|
17
|
-
.description('Start the monitoring server')
|
|
18
|
-
.option('-p, --port <number>', 'Port to run on', 3014)
|
|
19
|
-
.action((options) => {
|
|
20
|
-
process.env.PORT = options.port;
|
|
21
|
-
// When running from NPM, we'll point to the obfuscated lib folder
|
|
22
|
-
// For development, we point to src
|
|
23
|
-
const serverPath = process.env.NODE_ENV === 'development'
|
|
24
|
-
? path.join(__dirname, '../src/server.js')
|
|
25
|
-
: path.join(__dirname, '../lib/server.js');
|
|
26
|
-
|
|
27
|
-
require(serverPath);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
program
|
|
31
|
-
.command('setup')
|
|
32
|
-
.description('Install as a Systemd service (Linux only, requires sudo)')
|
|
33
|
-
.action(() => {
|
|
34
|
-
if (process.platform !== 'linux') {
|
|
35
|
-
console.error('Service installation is only supported on Linux.');
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
console.log('Installing Systemd Service...');
|
|
40
|
-
|
|
41
|
-
// Detect current config directory
|
|
42
|
-
const cwd = process.cwd();
|
|
43
|
-
const nodePath = process.execPath;
|
|
44
|
-
const cliPath = __filename;
|
|
45
|
-
|
|
46
|
-
const serviceContent = `[Unit]
|
|
47
|
-
Description=Krsyer Server Monitor Pro
|
|
48
|
-
After=network.target
|
|
49
|
-
|
|
50
|
-
[Service]
|
|
51
|
-
Type=simple
|
|
52
|
-
User=root
|
|
53
|
-
WorkingDirectory=${cwd}
|
|
54
|
-
ExecStart=${nodePath} "${cliPath}" start
|
|
55
|
-
Restart=always
|
|
56
|
-
Environment=NODE_ENV=production
|
|
57
|
-
|
|
58
|
-
[Install]
|
|
59
|
-
WantedBy=multi-user.target
|
|
60
|
-
`;
|
|
61
|
-
|
|
62
|
-
try {
|
|
63
|
-
fs.writeFileSync('/etc/systemd/system/krsyer-monitor.service', serviceContent);
|
|
64
|
-
console.log('Created /etc/systemd/system/krsyer-monitor.service');
|
|
65
|
-
|
|
66
|
-
console.log('Reloading Daemon...');
|
|
67
|
-
execSync('systemctl daemon-reload');
|
|
68
|
-
|
|
69
|
-
console.log('Enabling Service...');
|
|
70
|
-
execSync('systemctl enable krsyer-monitor');
|
|
71
|
-
|
|
72
|
-
console.log('Starting Service...');
|
|
73
|
-
execSync('systemctl start krsyer-monitor');
|
|
74
|
-
|
|
75
|
-
console.log('------------------------------------------------');
|
|
76
|
-
console.log('✅ Service installed and started successfully!');
|
|
77
|
-
console.log('📊 Check status: systemctl status krsyer-monitor');
|
|
78
|
-
console.log('------------------------------------------------');
|
|
79
|
-
} catch (e) {
|
|
80
|
-
console.error('❌ Failed to install service. Please run with sudo.', e.message);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
program.parse();
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="JAVA_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
-
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$" />
|
|
6
|
-
<orderEntry type="inheritedJdk" />
|
|
7
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
-
</component>
|
|
9
|
-
</module>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
|
|
4
|
-
<output url="file://$PROJECT_DIR$/out" />
|
|
5
|
-
</component>
|
|
6
|
-
</project>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/guestguru-api.iml" filepath="$PROJECT_DIR$/.idea/guestguru-api.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
# SaaS PG Management App - Frontend Design & API Guide
|
|
2
|
-
|
|
3
|
-
This guide outlines the backend API endpoints mapped to the required mobile screens for the SaaS PG Management Application. It is divided by **User Roles** (Super Admin, PG Owner, Resident).
|
|
4
|
-
|
|
5
|
-
## 🌍 Base URL
|
|
6
|
-
`http:// <server-ip> :5000/api`
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## 🔐 Authentication Module
|
|
11
|
-
**Screens**: Login, Sign Up, Splash Screen
|
|
12
|
-
|
|
13
|
-
### 1. Login
|
|
14
|
-
* **Endpoint**: `POST /auth/signin`
|
|
15
|
-
* **Payload**: `{ "email": "...", "password": "..." }`
|
|
16
|
-
* **Response**: Returns `accessToken`, `role`, `ownerId`.
|
|
17
|
-
* **UI Design Notes**:
|
|
18
|
-
* Simple form with Email & Password.
|
|
19
|
-
* **Action**: Store `accessToken` securely (AsyncStorage).
|
|
20
|
-
* **Logic**: Redirect based on `role` ('superadmin' -> SA Dashboard, 'admin' -> Owner Dashboard, 'customer' -> Resident App).
|
|
21
|
-
|
|
22
|
-
### 2. Sign Up (PG Owners)
|
|
23
|
-
* **Endpoint**: `POST /auth/signup`
|
|
24
|
-
* **Payload**: `{ "name": "...", "email": "...", "password": "...", "phone": "...", "role": "admin" }`
|
|
25
|
-
* **UI Design Notes**:
|
|
26
|
-
* Registration form for new PG Owners.
|
|
27
|
-
* Show "Free Plan Active" success message after signup.
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## 👑 Super Admin App
|
|
32
|
-
**Target Audience**: You (Platform Owner)
|
|
33
|
-
|
|
34
|
-
### 1. Dashboard / Owner Management
|
|
35
|
-
Manage the PG Owners who use your SaaS platform.
|
|
36
|
-
* **Endpoint**: `GET /superadmin/owners`
|
|
37
|
-
* **Display Data**: List of owners (Name, Email, Plan Name, Status).
|
|
38
|
-
* **UI Design Notes**:
|
|
39
|
-
* List view card for each PG Owner.
|
|
40
|
-
* **Toggle Switch**: "Block/Unblock" owner.
|
|
41
|
-
* **Endpoint**: `PUT /superadmin/owners/:id/toggle-block`
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## 🏢 PG Owner App (SaaS Tenant)
|
|
46
|
-
**Target Audience**: Hostel/PG Managers
|
|
47
|
-
|
|
48
|
-
### 1. Owner Dashboard (Home)
|
|
49
|
-
Overview of their PG's performance.
|
|
50
|
-
* **Endpoint**: `GET /dashboard/admin`
|
|
51
|
-
* **Display Data**:
|
|
52
|
-
* **Stats Cards**: Total Rooms, Available Beds, Active Tenants.
|
|
53
|
-
* **Financials**: Total Revenue, Collected, Pending (Hardcoded trend +12%).
|
|
54
|
-
* **Recent Activity**: Feed of "Rent Received", "New Assignment".
|
|
55
|
-
* **UI Design Notes**:
|
|
56
|
-
* Rich graphical widgets (Pie chart for Occupancy).
|
|
57
|
-
* Scrollable "Activity Feed".
|
|
58
|
-
|
|
59
|
-
### 2. Pending Dues Screen
|
|
60
|
-
List of tenants who haven't paid rent.
|
|
61
|
-
* **Endpoint**: `GET /dashboard/admin/pending-rents?month=12&year=2025`
|
|
62
|
-
* **Display Data**: Total Pending Amount, List of Tenants (Name, Room, Due Amount).
|
|
63
|
-
* **UI Design Notes**:
|
|
64
|
-
* **Filter**: Month/Year picker.
|
|
65
|
-
* **List Item**: Tenant Name, Room No, RED text for "Due: ₹5000".
|
|
66
|
-
* **Action**: "Remind" button (WhatsApp intent).
|
|
67
|
-
|
|
68
|
-
### 3. Room Management
|
|
69
|
-
* **List Rooms**: `GET /rooms`
|
|
70
|
-
* *Grid view* of rooms showing Room No, Occupancy (2/3), Floor.
|
|
71
|
-
* **Add Room**: `POST /rooms`
|
|
72
|
-
* Fields: No, Floor, Capacity, Price, Amenities.
|
|
73
|
-
* **Edit Room**: `PUT /rooms/:id`
|
|
74
|
-
* **Delete**: `DELETE /rooms/:id`
|
|
75
|
-
* **UI Design Notes**:
|
|
76
|
-
* Floating Action Button (+) to add room.
|
|
77
|
-
* Visual indicator for "Full" rooms (Red) vs "Available" (Green).
|
|
78
|
-
|
|
79
|
-
### 4. Tenant Management
|
|
80
|
-
* **List Tenants**: `GET /tenants?status=Active`
|
|
81
|
-
* *List view* with Search Bar.
|
|
82
|
-
* Shows: Details, Room No, Status tag (Active/Due Payment).
|
|
83
|
-
* **Onboard Tenant**: `POST /tenants`
|
|
84
|
-
* **Form**: Name, Phone, Email, Assign Room (Dropdown), Rent Amount.
|
|
85
|
-
* **Uploads**: Profile Pic, ID Proof (Multipart form).
|
|
86
|
-
* **Tenant Details**: `GET /tenants/:id`
|
|
87
|
-
* Profile View, Payment History, Assigned Room.
|
|
88
|
-
* **Actions**:
|
|
89
|
-
* `POST /tenants/:id/move-out` (End stay).
|
|
90
|
-
* `DELETE /tenants/:id` (Archive).
|
|
91
|
-
|
|
92
|
-
### 5. Collection (Cash Entry)
|
|
93
|
-
Record a payment made offline.
|
|
94
|
-
* **Endpoint**: `POST /payments` (or `/tenants/collect-rent`)
|
|
95
|
-
* **Payload**: `{ "tenantId": "...", "amount": 5000, "type": "monthly_rent" }`
|
|
96
|
-
* **UI Design Notes**:
|
|
97
|
-
* "Collect Rent" modal on Tenant Details screen.
|
|
98
|
-
* Auto-updates Tenant status from "Due" to "Active".
|
|
99
|
-
|
|
100
|
-
### 6. Subscription Plan
|
|
101
|
-
Manage their SaaS subscription.
|
|
102
|
-
* **Endpoint**: `GET /subscriptions`
|
|
103
|
-
* Shows: Current Plan (Free/Premium), Expiry.
|
|
104
|
-
* **Upgrade**: `POST /subscriptions/upgrade`
|
|
105
|
-
* UI: Pricing Cards (Basic, Premium) -> Payment Gateway -> Success.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## 🏠 Resident App (Tenant)
|
|
110
|
-
**Target Audience**: Students/Professionals living in PG
|
|
111
|
-
|
|
112
|
-
### 1. Resident Home
|
|
113
|
-
* **Endpoint**: `GET /dashboard/customer`
|
|
114
|
-
* **Display Data**:
|
|
115
|
-
* **Profile**: Name, Room Number.
|
|
116
|
-
* **Announcements**: Carousel of latest notices from Owner.
|
|
117
|
-
* **Recent Payments**: List of last 5 transactions.
|
|
118
|
-
* **UI Design Notes**:
|
|
119
|
-
* Clean, welcoming header "Welcome Back, [Name]".
|
|
120
|
-
* **Quick Action**: "Pay Rent" button.
|
|
121
|
-
|
|
122
|
-
### 2. Announcements
|
|
123
|
-
* **Endpoint**: `GET /dashboard/announcements`
|
|
124
|
-
* **Display Data**: List of notices (e.g., "Water heater maintenance").
|
|
125
|
-
|
|
126
|
-
### 3. Payment History
|
|
127
|
-
* **Endpoint**: `GET /payments/my-history`
|
|
128
|
-
* **Display Data**: List of all payments (Date, Amount, Status).
|
|
129
|
-
* **UI Design Notes**:
|
|
130
|
-
* Card style for each transaction.
|
|
131
|
-
* Green badge for "Completed", Red for "Failed".
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## ⚖️ Legal & Compliance
|
|
136
|
-
**Common Screens**: Settings > Terms / Privacy
|
|
137
|
-
|
|
138
|
-
* **Terms**: `GET /legal/terms`
|
|
139
|
-
* **Privacy**: `GET /legal/privacy`
|
|
140
|
-
* **UI Design Notes**: Simple text/webview render.
|