Skip to content

Open-source status page, incident response and uptime monitoring

feat: coming soon (#1)

Maximilian Kaskeab408d0e4f2b
diff --git a/apps/web/src/app/_components/background.tsx b/apps/web/src/app/_components/background.tsx
index 3b0ad64b5..b43aa0dfa 100644
--- a/apps/web/src/app/_components/background.tsx
+++ b/apps/web/src/app/_components/background.tsx
@@ -1,4 +1,5 @@
"use client";
+import useMouseMove from "@/hooks/use-mouse-move";
import React from "react";
export default function Background({
@@ -6,35 +7,13 @@ export default function Background({
}: {
children: React.ReactNode;
}) {
- React.useEffect(() => {
- function mouseMoveEvent(e: MouseEvent) {
- const scale = window.visualViewport.scale;
- // disable mouse movement on viewport zoom - causes page to slow down
- if (scale === 1) {
- const body = document.body;
-
- const targetX = e.clientX;
- const targetY = e.clientY;
-
- body.style.setProperty("--x", `${targetX}px`);
- body.style.setProperty("--y", `${targetY}px`);
- }
- }
-
- document.addEventListener("mousemove", mouseMoveEvent);
- return () => {
- document.removeEventListener("mousemove", mouseMoveEvent);
- };
- }, []);
-
+ // --x and --y will be updated based on mouse position
+ useMouseMove();
return (
<>
<div className="absolute inset-0 z-[-1]">
<div className="absolute inset-0 z-[-1] bg-muted-foreground/20" />
- <div
- className="absolute z-[-1] h-56 w-56 rounded-full -translate-y-1/2 -translate-x-1/2 bg-gradient-radial from-muted-foreground/70 from-0% to-transparent to-90% blur-md"
- style={{ left: "var(--x)", top: "var(--y)" }}
- />
+ <div className="absolute left-[--x] top-[--y] z-[-1] h-56 w-56 rounded-full -translate-y-1/2 -translate-x-1/2 bg-gradient-radial from-muted-foreground/80 from-0% to-transparent to-90% blur-md" />
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
<defs>
<pattern
diff --git a/apps/web/src/app/api/og/route.tsx b/apps/web/src/app/api/og/route.tsx
new file mode 100644
index 000000000..f6f8dd8ee
--- /dev/null
+++ b/apps/web/src/app/api/og/route.tsx
@@ -0,0 +1,70 @@
+import { ImageResponse } from "next/server";
+
+export const runtime = "edge";
+
+const size = {
+ width: 1200,
+ height: 630,
+};
+
+const TITLE = "Open Status";
+const DESCRIPTION = "An Open Source Alternative for your next Status Page";
+
+const interRegular = fetch(
+ new URL("../../../public/fonts/Inter-Regular.ttf", import.meta.url)
+).then((res) => res.arrayBuffer());
+
+const calSemiBold = fetch(
+ new URL("../../../public/fonts/CalSans-SemiBold.ttf", import.meta.url)
+).then((res) => res.arrayBuffer());
+
+export async function GET(req: Request) {
+ const interRegularData = await interRegular;
+ const calSemiBoldData = await calSemiBold;
+
+ const { searchParams } = new URL(req.url);
+ const title = searchParams.has("title") ? searchParams.get("title") : TITLE;
+ const description = searchParams.has("description")
+ ? searchParams.get("description")
+ : DESCRIPTION;
+
+ return new ImageResponse(
+ (
+ <div tw="relative flex flex-col bg-white items-center justify-center w-full h-full">
+ <div
+ tw="flex w-full h-full absolute inset-0"
+ // not every css variable is supported
+ style={{
+ backgroundImage: "radial-gradient(#94a3b8 10%, transparent 10%)",
+ backgroundPosition: "0px 0px, 6px 6px",
+ backgroundSize: "12px 12px",
+ filter: "blur(1px)", // to be discussed... couldn't put it inside the content container
+ }}
+ ></div>
+ <div tw="max-w-2xl relative flex flex-col items-center rounded-lg border border-slate-200 p-6 overflow-hidden bg-white bg-opacity-80">
+ <h1 style={{ fontFamily: "Cal" }} tw="text-6xl text-center">
+ {title}
+ </h1>
+ <p tw="text-slate-600 text-3xl text-center">{description}</p>
+ </div>
+ </div>
+ ),
+ {
+ ...size,
+ fonts: [
+ {
+ name: "Inter",
+ data: interRegularData,
+ style: "normal",
+ weight: 400,
+ },
+ {
+ name: "Cal",
+ data: calSemiBoldData,
+ style: "normal",
+ weight: 600,
+ },
+ ],
+ }
+ );
+}
diff --git a/apps/web/src/app/api/send/route.ts b/apps/web/src/app/api/send/route.ts
index 59e3d3d98..9e3b37e46 100644
--- a/apps/web/src/app/api/send/route.ts
+++ b/apps/web/src/app/api/send/route.ts
@@ -4,6 +4,9 @@ import { Resend } from "resend";
const resend = new Resend(process.env.RESEND_API_KEY);
+// TODO: move it into /api/send/[slug]/route.ts
+// where slug is the name of the template
+
export async function POST() {
try {
const data = await resend.emails.send({
diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx
index 1f947248f..a8d861a77 100644
--- a/apps/web/src/app/layout.tsx
+++ b/apps/web/src/app/layout.tsx
@@ -5,6 +5,7 @@ import LocalFont from "next/font/local";
import PlausibleProvider from "next-plausible";
import Background from "./_components/background";
import { Toaster } from "@/components/ui/toaster";
+import { Metadata } from "next";
const inter = Inter({ subsets: ["latin"] });
@@ -13,6 +14,24 @@ const calSans = LocalFont({
variable: "--font-calsans",
});
+export const metadata: Metadata = {
+ title: "openstatus.dev",
+ description: "An Open Source Alternative for your next Status Page.",
+ metadataBase: new URL("https://openstatus.dev"),
+ twitter: {
+ images: [`/api/og`],
+ card: "summary_large_image",
+ title: "openstatus.dev",
+ description: "An Open Source Alternative for your next Status Page.",
+ },
+ openGraph: {
+ type: "website",
+ images: [`/api/og`],
+ title: "openstatus.dev",
+ description: "An Open Source Alternative for your next Status Page.",
+ },
+};
+
export default function RootLayout({
children,
}: {
diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx
index 0610aa3a4..b7c56461e 100644
--- a/apps/web/src/app/page.tsx
+++ b/apps/web/src/app/page.tsx
@@ -11,13 +11,15 @@ export default function Page() {
<main className="min-h-screen w-full flex flex-col p-4 md:p-8 space-y-6">
<div className="flex-1 flex flex-col justify-center">
<div className="mx-auto max-w-xl text-center">
- <div className="rounded-lg border border-border backdrop-blur-[2px] p-8">
- <Badge>Announcing Post</Badge>
- <h1 className="text-3xl text-foreground font-cal mb-6 mt-2">
+ <div className="rounded-lg border border-border backdrop-blur-[2px] p-8 md:p-16">
+ <Badge>Coming Soon</Badge>
+ <h1 className="text-5xl text-foreground font-cal mb-6 mt-2">
OpenStatus
</h1>
- <p className="text-muted-foreground mb-4">
- Your Open Source Status Page.
+ <p className="text-muted-foreground text-lg mb-4">
+ {"Let's"} build a Saas together. Open for everyone. <br />
+ Managed or self-hosted. Pay-as-you go or plans. <br />
+ Choose your solution.
</p>
<form
action={async (data) => {
@@ -48,12 +50,12 @@ export default function Page() {
</div>
</div>
<footer className="text-center text-sm text-muted-foreground mx-auto rounded-full px-4 py-2 border border-border backdrop-blur-[2px]">
- Creating by{" "}
+ A collaboration between{" "}
<a
href="https://twitter.com/mxkaske"
target="_blank"
rel="noreferrer"
- className="underline underline-offset-4 hover:no-underline"
+ className="underline underline-offset-4 hover:no-underline text-foreground"
>
@mxkaske
</a>{" "}
@@ -62,7 +64,7 @@ export default function Page() {
href="https://twitter.com/thibaultleouay"
target="_blank"
rel="noreferrer"
- className="underline underline-offset-4 hover:no-underline"
+ className="underline underline-offset-4 hover:no-underline text-foreground"
>
@thibaultleouay
</a>
diff --git a/apps/web/src/hooks/use-mouse-move.tsx b/apps/web/src/hooks/use-mouse-move.tsx
new file mode 100644
index 000000000..c6ba72f4c
--- /dev/null
+++ b/apps/web/src/hooks/use-mouse-move.tsx
@@ -0,0 +1,26 @@
+"use client";
+
+import React from "react";
+
+export default function useMouseMove() {
+ React.useEffect(() => {
+ function mouseMoveEvent(e: MouseEvent) {
+ const scale = window.visualViewport.scale;
+ // disable mouse movement on viewport zoom - causes page to slow down
+ if (scale === 1) {
+ const body = document.body;
+
+ const targetX = e.clientX;
+ const targetY = e.clientY;
+
+ body.style.setProperty("--x", `${targetX}px`);
+ body.style.setProperty("--y", `${targetY}px`);
+ }
+ }
+
+ document.addEventListener("mousemove", mouseMoveEvent);
+ return () => {
+ document.removeEventListener("mousemove", mouseMoveEvent);
+ };
+ }, []);
+}
diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts
index d12339f9e..5b2869069 100644
--- a/apps/web/src/middleware.ts
+++ b/apps/web/src/middleware.ts
@@ -1,7 +1,7 @@
import { authMiddleware } from "@clerk/nextjs";
export default authMiddleware({
- publicRoutes: ["/"],
+ publicRoutes: ["/", "/api/og"],
});
export const config = {
diff --git a/apps/web/src/public/fonts/Inter-Regular.ttf b/apps/web/src/public/fonts/Inter-Regular.ttf
new file mode 100644
index 000000000..8d4eebf20
Binary files /dev/null and b/apps/web/src/public/fonts/Inter-Regular.ttf differ