feat(mvp): phase 4 - app registry & healthcheck

Add app CRUD API endpoints, healthcheck service with node-cron scheduler,
icon resolver (Lucide, Simple Icons, CDN, uploads), app management UI
with Superforms, health badge component, and Docker health endpoint.
This commit is contained in:
2026-03-24 20:53:50 +03:00
parent 2c001df322
commit 4d941f566f
17 changed files with 962 additions and 21 deletions
@@ -0,0 +1,39 @@
import cron from 'node-cron';
import { checkAllApps } from '$lib/server/services/healthcheckService.js';
let scheduledTask: cron.ScheduledTask | null = null;
/**
* Start the healthcheck scheduler.
* Runs checkAllApps on a cron schedule (default: every 60 seconds).
*/
export function startScheduler(cronExpression: string = '* * * * *'): void {
if (scheduledTask) {
return;
}
scheduledTask = cron.schedule(cronExpression, async () => {
try {
await checkAllApps();
} catch {
// Swallow errors to prevent scheduler crash
}
});
// Run an initial check shortly after startup
setTimeout(() => {
checkAllApps().catch(() => {
// Swallow initial check errors
});
}, 5000);
}
/**
* Stop the healthcheck scheduler.
*/
export function stopScheduler(): void {
if (scheduledTask) {
scheduledTask.stop();
scheduledTask = null;
}
}