- JavaScript 100%
|
|
||
|---|---|---|
| config | ||
| docs/superpowers/plans | ||
| public | ||
| src | ||
| tests | ||
| .env.example | ||
| .gitignore | ||
| jest.config.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| server.js | ||
| server.js.bak | ||
| SPEC.md | ||
| test_prompts.md | ||
k1-stack-dashboard
Internal MSP stack dashboard. Port 3007. Single-file Express server at server.js.
Two dashboard sections:
| Section | Refresh rate | Trigger |
|---|---|---|
| Connectivity | 60-second auto-refresh | Automatic |
| Live Metrics | 5-minute server-side cache | Page load + manual "Refresh Metrics" button |
Connectivity section
Polls each platform API to confirm credentials are valid and the service is reachable. One card per platform. Refreshes every 60 seconds automatically.
Live Metrics section
Fetches real operational metrics from 8 platforms in parallel on the server, caches results for 5 minutes. Client receives cached data instantly on page load.
| Platform | Metrics |
|---|---|
| Datto RMM | Online devices, offline devices, critical alerts, warning alerts |
| Autotask | Open tickets, new this week, SLA response breaches |
| IT Glue | Orgs, configs, passwords, contacts, domains, SSL certs |
| SaaS Alerts | Billing users, total clients, total alerts |
| Microsoft 365 | Licensed users, total users, Secure Score % (MSP tenant only) |
| Pax8 | Company count, active subscriptions, monthly spend |
| RingCentral | Active users, calls today |
| myITprocess | Client count, review meeting count |
Note: Inky has no public API and is not included. M365 metrics are single-tenant (MSP tenant). Multi-tenant license data is at port 3000 (pct-license-dashboard).
Environment variables
Copy .env.example to .env and fill in credentials.
| Variable | Platform | Notes |
|---|---|---|
DATTO_RMM_API_URL |
Datto RMM | e.g. https://merlot-api.centrastage.net |
DATTO_RMM_API_KEY |
Datto RMM | OAuth2 client ID |
DATTO_RMM_API_SECRET |
Datto RMM | OAuth2 client secret |
AUTOTASK_USERNAME |
Autotask | API user email |
AUTOTASK_SECRET |
Autotask | API user secret |
AUTOTASK_TRACKING_ID |
Autotask | Integration tracking identifier |
AUTOTASK_ZONE_URL |
Autotask | Base REST URL (zone-specific) |
SAAS_ALERTS_API_KEY |
SaaS Alerts | Header: api_key |
ITGLUE_API_KEY |
IT Glue | Header: x-api-key |
ITGLUE_REGION |
IT Glue | US or EU |
MYITPROCESS_API_KEY |
myITprocess | Header: MITP-API-KEY |
M365_CLIENT_ID |
Microsoft 365 | App registration client ID (cec32c1c-...) |
M365_REFRESH_TOKEN |
Microsoft 365 | Delegated refresh token — copy from license-dashboard .env (REFRESH_TOKEN). Same app reg, public delegated client (device code flow). 90-day rolling; re-sync from license-dashboard if M365 shows auth errors. |
M365_TENANT_ID |
Microsoft 365 | MSP AAD tenant GUID |
PAX8_CLIENT_ID |
Pax8 | OAuth2 client ID |
PAX8_CLIENT_SECRET |
Pax8 | OAuth2 client secret |
RC_CLIENT_ID |
RingCentral | Sourced from RC-AT tooling -- do not create a separate app |
RC_CLIENT_SECRET |
RingCentral | Sourced from RC-AT tooling |
RC_JWT_TOKEN |
RingCentral | JWT bearer token, sourced from RC-AT tooling |
API endpoints
| Endpoint | Description |
|---|---|
GET / |
Renders full dashboard HTML |
GET /api/health |
Readiness probe |
GET /api/check |
Connectivity check for all platforms |
GET /api/metrics |
Returns cached metrics (5-min TTL) |
GET /api/metrics/refresh |
Busts cache, returns fresh metrics |
Running locally
npm install
node server.js
Server listens on port 3007 by default.
Deployment
Target: VMID 114 (PCT-NODEJS-PROD-14). Deploy via Runbook 11 in
infrastructure/proxmox/runbooks.md.