Monitor API has a built-in observability layer that runs automatically and is also queryable on demand. On startup, the server executes a suite of health checks and logs the results; those same checks repeat every 5 minutes throughout the process lifetime. A dedicated REST endpoint exposes a real-time snapshot of the same data so that external tools, dashboards, and client apps can poll the service programmatically.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sheeplettuce/Monitor/llms.txt
Use this file to discover all available pages before exploring further.
Health endpoint
GET /api/health
No authentication is required. Returns a JSON object describing the current state of every monitored subsystem.
ip
The IP address of the client that made the request, as reported by Express (
req.ip). This reflects the caller’s address, not the server’s address.backend
Always
true when this endpoint responds. Confirms the Express process is running and reachable on the network.database
true if PostgreSQL responds successfully to a SELECT 1 query; false if the connection times out or throws an error. A false value here means the API is running but cannot read or write data.disco
Disk space (in GB, as strings) for the drive where the server process is running. Reported as
libre_GB, usado_GB, and total_GB. On Windows the C: drive is queried via wmic; on Linux/macOS df -BGB . reports the filesystem hosting the current working directory. If free space drops below 10 GB, a WARN entry is written to the log.evidencias
archivos: count of top-level entries in EVIDENCIAS_DIR. tamaño_MB: combined size of those entries in megabytes (as a string with one decimal place). Reflects the growth of uploaded evidence files over time.expedientes
Total count of
expediente rows in the database. Gives a quick sense of overall system load without running a separate query.ram
usada_MB: RSS (resident set size) memory consumed by the Node.js process in megabytes. total_MB: total physical RAM installed on the host machine. Both are rounded integers.Service discovery endpoint
GET /discovery
Returns the server’s local IPv4 addresses. No authentication required. Clients on the same LAN can call this endpoint to locate the Monitor API server without relying on a hardcoded IP.
mDNS / Bonjour discovery
On startup, Monitor API registers itself with the local network via mDNS (Multicast DNS) using the Bonjour protocol, advertising the service type_monitor._tcp. Clients and operating systems that support mDNS (macOS, most Linux desktops, Windows 10+) can resolve the server by hostname without needing an IP address:
Startup checks
When the server process starts, it runs the following checks in sequence and logs the result of each one:checkBackend
Verifies that a process is actively listening on port 3000 (the API port) by inspecting open network connections. On Windows it runs
netstat -ano | findstr :3000; on Linux/macOS it runs lsof -i :3000 | grep LISTEN. Logs success if the port is bound, error if nothing is listening.checkDatabase
Executes
SELECT 1 against the PostgreSQL database via Prisma. Logs success on a valid response, error with the exception message if the connection fails.checkDisk
Reads available, used, and total disk space for the server’s drive. Logs the figures at
info level. If free space is below 10 GB, an additional warn entry is written.checkEvidencias
Reads the
EVIDENCIAS_DIR directory and reports the number of entries and their combined size. Logs warn if the directory does not exist (e.g. on a fresh installation before any files have been uploaded).setInterval(runStatusChecks, 5 * 60 * 1000)), keeping the log file current without requiring manual intervention.
Log file
All log entries — from startup checks, periodic checks, request handlers, and internal services — are appended tologs/app.log in the project root. The file is created automatically if it does not exist.
Each line follows this format:
SUCCESS, INFO, WARN, ERROR. The log file grows indefinitely — consider setting up log rotation (e.g. with logrotate on Linux) for long-running production deployments.
The
EVIDENCIAS_DIR used by the health check is resolved as path.resolve(process.cwd(), process.env["EVIDENCIAS_DIR"] ?? "../evidencias"). If the environment variable is not set, it defaults to ../evidencias relative to process.cwd(). Ensure this path exists before starting the server, or the checkEvidencias step will log a warning on every cycle.