- User model with email/hashed_password/is_admin/notification_prefs - JWT auth: POST /api/auth/register, /login, /me - First registered user auto-promoted to admin - Migration 0005: users table + user_id FK on follows (clears global follows) - Follows, dashboard, settings, admin endpoints all require authentication - Admin endpoints (settings writes, celery triggers) require is_admin - Frontend: login/register pages, Zustand auth store (localStorage persist) - AuthGuard component gates all app routes, shows app shell only when authed - Sidebar shows user email + logout; Admin nav link visible to admins only - Admin panel (/settings): user list with delete + promote/demote, LLM config, data source settings, and manual celery controls Authored-By: Jack Levy
31 lines
730 B
TypeScript
31 lines
730 B
TypeScript
import type { Metadata } from "next";
|
|
import { Inter } from "next/font/google";
|
|
import "./globals.css";
|
|
import { Providers } from "./providers";
|
|
import { AuthGuard } from "@/components/shared/AuthGuard";
|
|
|
|
const inter = Inter({ subsets: ["latin"] });
|
|
|
|
export const metadata: Metadata = {
|
|
title: "PocketVeto",
|
|
description: "Monitor US Congress with AI-powered bill summaries and trend analysis",
|
|
};
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
return (
|
|
<html lang="en" suppressHydrationWarning>
|
|
<body className={inter.className}>
|
|
<Providers>
|
|
<AuthGuard>
|
|
{children}
|
|
</AuthGuard>
|
|
</Providers>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|