Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
🔥 External Status (#478)
Thibault Le Ouay8b6b11320ddd
diff --git a/apps/web/src/app/status/page.tsx b/apps/web/src/app/status/page.tsxnew file mode 100644index 000000000..bdfcfcee7--- /dev/null+++ b/apps/web/src/app/status/page.tsx@@ -0,0 +1,74 @@+import Link from "next/link";+import { z } from "zod";++import {+ Card,+ CardDescription,+ CardFooter,+ CardHeader,+ CardTitle,+} from "@openstatus/ui";++import { Icons } from "@/components/icons";+import { MarketingLayout } from "@/components/layout/marketing-layout";+import { env } from "@/env";++const ExternalStatus = z.object({+ id: z.number(),+ name: z.string(),+ url: z.string(),+ external_id: z.string(),+ last_updated_at: z.string().datetime({ offset: true }),+ time_zone: z.string(),+ status_indicator: z.string(),+ status_description: z.string(),+ created_at: z.string(),+ updated_at: z.string().datetime(),+});++const ExternalStatusPage = async () => {+ console.log(env.EXTERNAL_API_URL);+ const res = await fetch(env.EXTERNAL_API_URL);+ const data = await res.json();+ const openSourceFriends = z.array(ExternalStatus).parse(data);++ return (+ <MarketingLayout>+ <h1 className="text-foreground font-cal mb-4 text-4xl">+ Is my external service down?+ </h1>+ <div className="text-muted-foreground mb-6">+ Easily check if your external providers is working properly+ </div>+ <div className="grid w-full grid-cols-1 gap-6 md:grid-cols-2">+ {openSourceFriends.map((status) => (+ <Card key={status.name} className="group flex flex-col">+ <CardHeader className="flex-1">+ <div className="flex items-center gap-2">+ <CardTitle>+ <Link+ href={status.url}+ target="_blank"+ className="group-hover:underline"+ >+ {status.name}+ </Link>+ </CardTitle>+ </div>+ <CardDescription>{status.status_description}</CardDescription>+ </CardHeader>+ <CardFooter>+ <div className="flex items-center gap-2.5">+ <Link href={status.url} target="_blank">+ <Icons.globe className="text-muted-foreground h-5 w-5 hover:text-black" />+ </Link>+ </div>+ </CardFooter>+ </Card>+ ))}+ </div>+ </MarketingLayout>+ );+};++export default ExternalStatusPage;diff --git a/apps/web/src/components/layout/marketing-footer.tsx b/apps/web/src/components/layout/marketing-footer.tsxindex fb622b2bb..9da8f0dbd 100644--- a/apps/web/src/components/layout/marketing-footer.tsx+++ b/apps/web/src/components/layout/marketing-footer.tsx@@ -29,6 +29,7 @@ export function MarketingFooter({ className }: Props) {<FooterLink href="/changelog" label="Changelog" /><FooterLink href="https://docs.openstatus.dev" label="Docs" /><FooterLink href="/oss-friends" label="OSS Friends" />+ <FooterLink href="/status" label="External Providers Monitoring" /></div><div className="order-3 flex flex-col gap-3 text-sm md:order-4"><p className="text-foreground font-semibold">Legal</p>diff --git a/apps/web/src/env.ts b/apps/web/src/env.tsindex 28d639db7..390931f7c 100644--- a/apps/web/src/env.ts+++ b/apps/web/src/env.ts@@ -22,6 +22,7 @@ export const env = createEnv({GCP_CLIENT_EMAIL: z.string(),GCP_PRIVATE_KEY: z.string(),CRON_SECRET: z.string(),+ EXTERNAL_API_URL: z.string().url(),},client: {NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string().min(1),@@ -61,5 +62,6 @@ export const env = createEnv({GCP_CLIENT_EMAIL: process.env.GCP_CLIENT_EMAIL,GCP_PRIVATE_KEY: process.env.GCP_PRIVATE_KEY,CRON_SECRET: process.env.CRON_SECRET,+ EXTERNAL_API_URL: process.env.EXTERNAL_API_URL,},});diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.tsindex 4eaa59416..b169067c8 100644--- a/apps/web/src/middleware.ts+++ b/apps/web/src/middleware.ts@@ -72,6 +72,8 @@ export default authMiddleware({"/api/checker/cron/10m","/blog","/blog/(.*)",+ "/status",+ "/status/(.*)","/changelog","/changelog/(.*)","/legal/(.*)",