feat(web): Next.js 15 app shell, auth, i18n, base UI
App Router setup with next-intl (en/fr), Better Auth wiring, shadcn/ui components, Tailwind, AES-256-GCM encrypt util, Redis rate limiter, tier limit checker, site_settings helper for runtime .env overrides.
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Lora, Geist_Mono } from "next/font/google";
|
||||
import { headers } from "next/headers";
|
||||
import { Providers } from "@/components/providers";
|
||||
import { auth } from "@/lib/auth/server";
|
||||
import type { Locale } from "@/lib/i18n/provider";
|
||||
import { SwRegister } from "@/components/pwa/sw-register";
|
||||
import "./globals.css";
|
||||
|
||||
const lora = Lora({
|
||||
variable: "--font-lora",
|
||||
subsets: ["latin"],
|
||||
display: "swap",
|
||||
});
|
||||
|
||||
const geistMono = Geist_Mono({
|
||||
variable: "--font-geist-mono",
|
||||
subsets: ["latin"],
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: { default: "Epicure", template: "%s | Epicure" },
|
||||
description: "Your personal AI-powered recipe book.",
|
||||
};
|
||||
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
}: Readonly<{ children: React.ReactNode }>) {
|
||||
const session = await auth.api.getSession({ headers: await headers() }).catch(() => null);
|
||||
const initialLocale = ((session?.user as { locale?: string })?.locale ?? "en") as Locale;
|
||||
|
||||
return (
|
||||
<html
|
||||
lang={initialLocale}
|
||||
suppressHydrationWarning
|
||||
className={`${lora.variable} ${geistMono.variable} h-full antialiased`}
|
||||
>
|
||||
<body className="min-h-full flex flex-col">
|
||||
<Providers initialLocale={initialLocale}>{children}</Providers>
|
||||
<SwRegister />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user