Starterpacket von FSC & Shadcn eingebunden

This commit is contained in:
Admin committed 2026-10-28 16:59:03 +01:00
1 parent 6cf7985a44
commit 872bce2cfe
25 files changed
+5407

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
// Muster C: Provider und Modell an einer Stelle.
// Der Standard-Provider liest ANTHROPIC_API_KEY aus der Umgebung.
import { anthropic } from "@ai-sdk/anthropic";
// Ein günstiges Modell, weil jeder Aufruf Geld kostet (Claude Sonnet 5: 2 $ Input / 10 $ Output pro 1 Mio. Tokens).
export const getModel = () => anthropic("claude-sonnet-5");
+6
View File
@@ -0,0 +1,6 @@
/**
* Name und Kurzbeschreibung der Oberfläche. Der Name steht im Kopf neben dem E&P-Logo
* und im Browser-Tab. Für jede neue Oberfläche passend setzen, zum Beispiel "Hotel-Steckbriefe".
*/
export const APP_TITEL = "Meine Oberfläche";
export const APP_BESCHREIBUNG = "Eine kleine Oberfläche aus der KI-Schulung bei E&P Reisen.";
+30
View File
@@ -0,0 +1,30 @@
// Muster A: n8n-Webhook aus dem Frontend aufrufen.
// Die Basis-Adresse wird beim Bauen eingesetzt (NEXT_PUBLIC_*). Ohne Angabe gilt die E&P-n8n.
const BASE = (process.env.NEXT_PUBLIC_N8N_BASE || "https://n8n.ep-reisen.app").replace(/\/+$/, "");
export function webhookUrl(path: string): string {
const clean = path.replace(/^\/+/, "");
return `${BASE}/webhook/${clean}`;
}
export async function postWebhook<T = unknown>(
path: string,
body: unknown,
): Promise<T> {
const res = await fetch(webhookUrl(path), {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
});
if (!res.ok) {
throw new Error(`Webhook-Fehler ${res.status}: ${await res.text()}`);
}
// n8n kann JSON oder Text zurückgeben:
const text = await res.text();
try {
return JSON.parse(text) as T;
} catch {
return text as T;
}
}
+1
View File
@@ -0,0 +1 @@
export { cn } from "cn"