Milestone (a): project skeleton and OIDC login
- Next.js 16 + Tailwind + shadcn/ui skeleton - Auth.js v5 generic OIDC (Pocket ID, PKCE) with optional group gate - proxy.ts gates all pages and API routes - Drizzle schema (models, files, jobs, logs, worker state) on SQLite/libsql - Worker skeleton: migrations, interrupted-job recovery, heartbeat Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
891e496157
47 files changed
+14945
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import Link from "next/link";
|
||||
import { redirect } from "next/navigation";
|
||||
import { auth, signOut } from "@/auth";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { WorkerIndicator } from "@/components/worker-indicator";
|
||||
import { getWorkerStatus } from "@/lib/worker-status";
|
||||
|
||||
export default async function AppLayout({ children }: LayoutProps<"/">) {
|
||||
const session = await auth();
|
||||
if (!session?.user) redirect("/login");
|
||||
|
||||
const worker = await getWorkerStatus();
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen flex-col">
|
||||
<header className="border-b">
|
||||
<div className="mx-auto flex h-14 max-w-6xl items-center gap-6 px-4">
|
||||
<Link href="/" className="font-semibold">
|
||||
Model Manager
|
||||
</Link>
|
||||
<nav className="flex items-center gap-4 text-sm text-muted-foreground">
|
||||
<Link href="/" className="hover:text-foreground">
|
||||
Library
|
||||
</Link>
|
||||
</nav>
|
||||
<div className="ml-auto flex items-center gap-3">
|
||||
<WorkerIndicator initial={worker} />
|
||||
<span className="hidden text-sm text-muted-foreground sm:inline">
|
||||
{session.user.name ?? session.user.email}
|
||||
</span>
|
||||
<form
|
||||
action={async () => {
|
||||
"use server";
|
||||
await signOut({ redirectTo: "/login" });
|
||||
}}
|
||||
>
|
||||
<Button type="submit" variant="ghost" size="sm">
|
||||
Sign out
|
||||
</Button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main className="mx-auto w-full max-w-6xl flex-1 px-4 py-6">{children}</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Card, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
|
||||
export default function LibraryPage() {
|
||||
return (
|
||||
<div className="flex flex-col gap-4">
|
||||
<h1 className="text-xl font-semibold">Library</h1>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>No models yet</CardTitle>
|
||||
<CardDescription>Adding models from Hugging Face comes in the next milestone.</CardDescription>
|
||||
</CardHeader>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user