nextjs-hackathon-stack 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/template/_env.example
CHANGED
|
@@ -9,11 +9,13 @@ NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
|
|
|
9
9
|
# Supabase DB — https://supabase.com > Project Settings > Database > Connection string (URI)
|
|
10
10
|
DATABASE_URL=postgresql://postgres:[password]@db.your-project-id.supabase.co:5432/postgres
|
|
11
11
|
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
#
|
|
16
|
-
#
|
|
12
|
+
# AI Provider — defaults to MiniMax direct API
|
|
13
|
+
AI_API_KEY=your-api-key
|
|
14
|
+
# Optional: override base URL (default: https://api.minimaxi.chat/v1)
|
|
15
|
+
# For Vercel Gateway: https://ai-gateway.vercel.sh/v1
|
|
16
|
+
# AI_BASE_URL=https://api.minimaxi.chat/v1
|
|
17
|
+
# Optional: override model (default: MiniMax-M1)
|
|
18
|
+
# AI_MODEL=MiniMax-M1
|
|
17
19
|
|
|
18
20
|
# =============================================================================
|
|
19
21
|
# OPTIONAL
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChatUi } from "@/features/chat/components/chat-ui";
|
|
2
|
+
import { logoutAction } from "@/features/auth/actions/logout.action";
|
|
2
3
|
import { createClient } from "@/shared/lib/supabase/server";
|
|
3
4
|
|
|
4
5
|
export default async function HomePage() {
|
|
@@ -9,7 +10,14 @@ export default async function HomePage() {
|
|
|
9
10
|
|
|
10
11
|
return (
|
|
11
12
|
<main className="container mx-auto p-8">
|
|
12
|
-
<
|
|
13
|
+
<div className="mb-4 flex items-center justify-between">
|
|
14
|
+
<h1 className="text-2xl font-bold">Welcome, {user?.email}</h1>
|
|
15
|
+
<form action={logoutAction}>
|
|
16
|
+
<button type="submit" className="rounded bg-gray-200 px-4 py-2 text-sm hover:bg-gray-300">
|
|
17
|
+
Log out
|
|
18
|
+
</button>
|
|
19
|
+
</form>
|
|
20
|
+
</div>
|
|
13
21
|
<ChatUi />
|
|
14
22
|
</main>
|
|
15
23
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createOpenAI } from "@ai-sdk/openai";
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
baseURL: process.env.
|
|
5
|
-
apiKey: process.env.
|
|
3
|
+
const provider = createOpenAI({
|
|
4
|
+
baseURL: process.env.AI_BASE_URL ?? "https://api.minimaxi.chat/v1",
|
|
5
|
+
apiKey: process.env.AI_API_KEY ?? "",
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
export const aiModel =
|
|
8
|
+
export const aiModel = provider(process.env.AI_MODEL ?? "MiniMax-M1");
|