Website: Next.js app for accounts, linking, who's online, device sign-in and the console

apps/web: Next.js 16 (App Router), Tailwind 4 and shadcn/ui, light and dark from the system. Pages render on the
server and call the API with Eden Treaty (typed by @t5de/api), forwarding the visitor's cookie; forms use server
actions; sign-up, sign-in and sign-out use Better Auth's React client. /api is rewritten to the API so its cookies
are first-party. Who's online follows the API's event stream (Next's gzip is off: it held the stream back).
Standalone output with a Dockerfile; deploys to Vercel as is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
dhkatzandClaude Opus 5.5 committed 2026-10-29 05:02:00 -07:00
1 parent 7afada1c63
commit 64c552330b
57 files changed
+3834

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
"use client";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { useState } from "react";
import { Button } from "@/components/ui/button";
import { authClient } from "@/lib/auth-client";
import { cn } from "@/lib/utils";
/** A link in a navigation bar, marked when it's the current page (or, unless exact, a page under it). */
export function NavLink({
href,
exact = false,
children,
}: {
href: string;
exact?: boolean;
children: React.ReactNode;
}) {
const pathname = usePathname();
const here = pathname === href || (!exact && pathname.startsWith(href + "/"));
return (
<Link
href={href}
aria-current={here ? "page" : undefined}
className={cn(
"rounded-md px-2.5 py-1.5 text-muted-foreground transition-colors hover:text-foreground",
here && "bg-muted text-foreground",
)}
>
{children}
</Link>
);
}
export function SignOutButton() {
const router = useRouter();
const [pending, setPending] = useState(false);
return (
<Button
variant="outline"
disabled={pending}
onClick={async () => {
setPending(true);
await authClient.signOut();
router.push("/");
router.refresh();
}}
>
{pending ? "Signing out…" : "Sign out"}
</Button>
);
}