SPB Git

spb/earth-now Public License

earth-now.co — real-time planetary dashboard: live world metrics modeled, not streamed.

TypeScript 93% Shell 2.3% SQL 1.4% JavaScript 1.3% Dockerfile 1.2% CSS 0.8%
1.4 KB · 40 lines tsx
Raw Blame History
1/**2 * earth-now.co3 * Author:  Simon-Pierre Boucher4 * Contact: contact@spboucher.ai5 * File:    apps/web/app/page.tsx6 * Purpose: Home page (server component) — fetches registry metrics + counter models and hands off to the client dashboard; friendly API-offline state7 */89import Dashboard from "@/components/Dashboard";10import { fetchMetrics, fetchModels } from "@/lib/api";1112export const dynamic = "force-dynamic";1314export default async function HomePage() {15  try {16    const [metrics, modelsResponse] = await Promise.all([fetchMetrics(), fetchModels()]);17    return <Dashboard metrics={metrics} initialModels={modelsResponse.models} />;18  } catch {19    // Never crash the page when apps/api is down — render a calm offline state.20    return (21      <div className="mx-auto flex max-w-2xl flex-col items-center gap-3 px-4 py-24 text-center">22        <p className="text-4xl" aria-hidden>23          🛰️24        </p>25        <h1 className="text-xl font-semibold text-ink">26          API hors ligne / API offline27        </h1>28        <p className="text-sm text-ink2">29          Les compteurs sont momentanément indisponibles — le serveur de modèles ne répond pas.30          Réessayez dans un instant.31        </p>32        <p className="text-sm text-muted">33          Counters are momentarily unavailable — the model server is not responding. Please try34          again shortly.35        </p>36      </div>37    );38  }39}40