Initial commit: EGBE chatbot template
Stripped from vercel/chatbot (Apache 2.0): - Dropped @vercel/* packages and AI Gateway - Removed artifacts feature (code/text/sheet/image side panel) - Switched AI provider to @ai-sdk/openai-compatible -> EGBE LiteLLM - Replaced Vercel Blob upload with data URLs - Dropped Redis resumable streams and rate limiter (in-memory now) - Added Dockerfile (Next.js standalone) + entrypoint that runs migrations - Wired DATABASE_URL, EGBE_AI_API_URL/KEY, NEXT_PUBLIC_BASE_URL for app-deploy.sh
This commit is contained in:
commit
3e21c2334c
129 changed files with 21913 additions and 0 deletions
88
app/layout.tsx
Normal file
88
app/layout.tsx
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import { ThemeProvider } from "@/components/theme-provider";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
|
||||
import "./globals.css";
|
||||
import { SessionProvider } from "next-auth/react";
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL ?? "http://localhost:3000";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
metadataBase: new URL(baseUrl),
|
||||
title: "EGBE Chatbot",
|
||||
description: "Chatbot template wired to EGBE LiteLLM proxy.",
|
||||
};
|
||||
|
||||
export const viewport = {
|
||||
maximumScale: 1,
|
||||
};
|
||||
|
||||
const geist = Geist({
|
||||
subsets: ["latin"],
|
||||
display: "swap",
|
||||
variable: "--font-geist",
|
||||
});
|
||||
|
||||
const geistMono = Geist_Mono({
|
||||
subsets: ["latin"],
|
||||
display: "swap",
|
||||
variable: "--font-geist-mono",
|
||||
});
|
||||
|
||||
const LIGHT_THEME_COLOR = "hsl(0 0% 100%)";
|
||||
const DARK_THEME_COLOR = "hsl(240deg 10% 3.92%)";
|
||||
const THEME_COLOR_SCRIPT = `\
|
||||
(function() {
|
||||
var html = document.documentElement;
|
||||
var meta = document.querySelector('meta[name="theme-color"]');
|
||||
if (!meta) {
|
||||
meta = document.createElement('meta');
|
||||
meta.setAttribute('name', 'theme-color');
|
||||
document.head.appendChild(meta);
|
||||
}
|
||||
function updateThemeColor() {
|
||||
var isDark = html.classList.contains('dark');
|
||||
meta.setAttribute('content', isDark ? '${DARK_THEME_COLOR}' : '${LIGHT_THEME_COLOR}');
|
||||
}
|
||||
var observer = new MutationObserver(updateThemeColor);
|
||||
observer.observe(html, { attributes: true, attributeFilter: ['class'] });
|
||||
updateThemeColor();
|
||||
})();`;
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html
|
||||
className={`${geist.variable} ${geistMono.variable}`}
|
||||
lang="en"
|
||||
suppressHydrationWarning
|
||||
>
|
||||
<head>
|
||||
<script
|
||||
// biome-ignore lint/security/noDangerouslySetInnerHtml: "Required"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: THEME_COLOR_SCRIPT,
|
||||
}}
|
||||
/>
|
||||
</head>
|
||||
<body className="antialiased">
|
||||
<ThemeProvider
|
||||
attribute="class"
|
||||
defaultTheme="system"
|
||||
disableTransitionOnChange
|
||||
enableSystem
|
||||
>
|
||||
<SessionProvider
|
||||
basePath={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/api/auth`}
|
||||
>
|
||||
<TooltipProvider>{children}</TooltipProvider>
|
||||
</SessionProvider>
|
||||
</ThemeProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue