CritEye Documentation
5-Minute Quick Start (Local Dev Mode)
Get the entire CritEye system running on your local machine in under 5 minutes without needing a Firebase project. In DEV MODE, the backend trusts local admin connections, allowing rapid development and validation.
1. Extract Repositories & Install Dependencies
# In your projects directory:
cd criteye-complete
# Install dependencies across all three components
cd criteye-backend && npm install && cd ..
cd criteye-admin && npm install && cd ..
cd criteye-client && npm install && cd ..
2. Start the Backend (Terminal 1)
The backend serves as the real-time hub connecting the administrator console and workstation agents.
cd criteye-backend
npm start
# Output: [CritEye] backend listening on :4000 (DEV MODE)
Keep this terminal open.
3. Start the Admin Dashboard (Terminal 2)
Launch the Next.js administration console on port 3000.
cd criteye-admin
npm run dev
# Output: ▲ Next.js 14 - Local: http://localhost:3000
Open http://localhost:3000 in your browser. Click "Don't have an account?" and log in with any test email/password (the dev stub accepts any credentials). You are now logged in as the admin for default-org.
4. Start the Test Client Agent (Terminal 3)
cd criteye-client
npm start
# An Electron setup window opens
In the client setup window:
- • Device Name:
LAB-TEST-PC-01 - • Server URL:
http://localhost:4000(or click "Localhost:4000") - • Click "Start Monitoring Agent"
The client minimizes quietly to your Windows system tray.
5. Link & Watch the Live Screen
- 1. In your admin browser (
http://localhost:3000), click Devices. - 2. Click Add Manually (or Pair Device), enter
LAB-TEST-PC-01. - 3. Click Generate Pairing Code (e.g.
ABC123). - 4. On the client PC, right-click the CritEye tray icon → Settings.
- 5. Paste the pairing code into the Link Device box and click Link Workstation.
- 6. The PC appears on your Admin screen with a green Online status! Click Watch to see the live feed.
System Requirements
CritEye is split into server and client dependencies:
- • Workstation Client: Windows 10 or 11 x64. Minimum 4 GB RAM. Requires administrative privileges for PowerShell WMI hardware inventory queries and lock screen unlock.
- • Admin Studio: Modern web browser (Chrome, Edge, Firefox, Safari) with WebSockets and HTML5 Canvas support.
- • Backend Hub: Node.js 18 or higher. Deployable locally, on Windows Server, or on Linux cloud hosts (Render, Railway, Fly.io, DigitalOcean).
Installation Overview
For end-user workstations, you do not need developer tools or Node.js. Simply distribute the official compiled installer:
CritEye-Setup-1.0.0.exe
This is a standard 84 MB NSIS installer that places the binary in C:\Program Files\CritEye, registers the Windows startup registry key, and configures the system tray daemon.
Backend Server Setup (:4000)
The backend application is located in criteye-backend/. It manages real-time socket channels, device registries, and permission enforcement.
Environment Configuration (.env)
PORT=4000
NODE_ENV=production
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_CLIENT_EMAIL=firebase-adminsdk@...
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n..."
ALLOWED_ORIGIN="http://localhost:3000,https://admin.yourdomain.com"
.env, firebase-key.json, or data/db.json will immediately receive a 403 Forbidden response.
Admin Console Setup (:3000)
Built using Next.js 14 and Tailwind CSS. The admin dashboard communicates with the backend via Socket.io client.
cd criteye-admin
npm install
npm run build
npm start
Configure the backend endpoint in criteye-admin/.env.local:
NEXT_PUBLIC_SOCKET_URL=http://localhost:4000
NEXT_PUBLIC_FIREBASE_API_KEY=AIzaSy...
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=criteye.firebaseapp.com
PC Client Agent Configuration
The client stores its local persistent configuration in lib/store.js and local app data. Default settings can be adjusted directly from the tray Settings Hub across 5 dedicated panels:
- 1. Identity & Network: Device name, unique hardware UUID, backend server endpoint.
- 2. Privacy & Telemetry: Screen stream toggle, keystroke counter, idle reporting, telemetry refresh.
- 3. Takeover & Dual Mouse: Dual mouse independent cursor, physical input freeze, floating takeover banner.
- 4. Power & Lock Screen: Allow lock screen monitoring, remote password typing, always-running boot autostart.
- 5. Security & Passcodes: Local password to protect settings from unauthorized local users, session close password.
Pairing Devices to Organizations
Workstations join your fleet through a zero-trust cryptographic pairing flow:
- 1. Admin generates a 6-character uppercase pairing code in Admin Studio.
- 2. Code is entered on the workstation agent.
- 3. Workstation transmits its public device UUID, hostname, and OS metrics.
- 4. Backend validates the code and associates the device ID with the admin's organization in
data/db.json.
Live Screen Feeds
The client utilizes Electron's desktopCapturer to acquire video frames at up to 30 FPS. Frames are JPEG compressed with adaptive quality factors to minimize bandwidth consumption across corporate LANs.
Dual Mouse System & Takeover
CritEye solves the common frustration of cursor fighting during remote assistance:
- • Dual Mouse Mode: The administrator drives an independent virtual cursor. The local user's physical mouse is unaffected.
- • Takeover Mode: Suppresses local physical input and presents an on-screen notification banner with an emergency "Revoke Control" button for the user.
Activity & WMI Hardware Telemetry
Low-level input hooks (uiohook-napi) record global mouse distance and key counts without recording keystroke characters (protecting privacy). Hardware queries are run via PowerShell:
# Example PowerShell query executed by CritEye for USB devices:
Get-CimInstance Win32_PnPEntity | Where-Object { $_.PNPClass -eq "USB" }
Wake-on-LAN (WoL)
When a machine is powered off, the admin console can broadcast a standard Wake-on-LAN magic packet over UDP port 9 to awaken the workstation motherboard remotely.
Common Gotchas & Troubleshooting
1. Workstation says "Disconnected" in tray, but backend is running
Check the Server URL configured in the client's Settings panel. If testing locally, make sure it is set to http://localhost:4000 or your LAN IP (e.g. http://192.168.1.50:4000).
2. Admin browser shows "Connecting..." forever
Verify that the backend terminal is running and shows [CritEye] backend listening on :4000. Check your browser developer console (F12) to verify WebSocket connectivity to port 4000.
3. Windows Lock Screen is blank during sleep
Ensure "Allow Windows Lock Screen monitoring" is toggled on in the client's Remote Power & Lock Screen tab, and that CritEye has administrative rights to capture secure Windows desktops.
Ports & Networking Reference
| Port | Protocol | Direction | Purpose |
|---|---|---|---|
4000 |
TCP / WebSocket | Inbound to Backend | Socket.io real-time screen streaming and input relay |
3000 |
HTTP / TCP | Inbound to Admin | Next.js web administration dashboard |
9 |
UDP Broadcast | Outbound from Backend | Wake-on-LAN magic packets to wake sleeping PCs |