` in main.js $docRoot = $_SERVER['DOCUMENT_ROOT']; // Electron passes HYPRCRD_DATA_DIR so the app stores all user data // outside the app bundle (survives updates). $dataDir = getenv('HYPRCRD_DATA_DIR'); if ($dataDir) { define('DB_PATH', $dataDir . '/hyprcrd.db'); define('UPLOAD_DIR', $dataDir . '/uploads'); if (!is_dir($dataDir . '/uploads')) { mkdir($dataDir . '/uploads', 0755, true); } } $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); $file = $docRoot . $path; if ($path !== '/' && is_file($file)) { return false; } // Serve uploaded files from the external data dir if ($dataDir && str_starts_with($path, '/uploads/')) { $extFile = $dataDir . $path; if (is_file($extFile)) { $mime = mime_content_type($extFile) ?: 'application/octet-stream'; header('Content-Type: ' . $mime); readfile($extFile); return; } } require $docRoot . '/index.php';