From 56a88f0a684ffa1dab53bc8315d92d289a72cab5 Mon Sep 17 00:00:00 2001 From: Aljaz Ceru Date: Tue, 16 Sep 2025 08:06:27 +0200 Subject: [PATCH] build fix --- frontend/Dockerfile | 14 +++++++------- frontend/next.config.js | 8 +++----- frontend/src/app/admin/page.tsx | 4 ++-- frontend/src/app/analytics/page.tsx | 4 ++-- frontend/src/app/api-keys/page.tsx | 17 +++++++++++++---- frontend/src/app/audit/page.tsx | 6 +++--- frontend/src/app/budgets/page.tsx | 4 ++-- frontend/src/app/dashboard/page.tsx | 4 ++-- frontend/src/app/llm/page.tsx | 4 ++-- frontend/src/app/prompt-templates/page.tsx | 4 ++-- frontend/src/app/rag/page.tsx | 4 ++-- frontend/src/app/register/page.tsx | 4 ++-- frontend/src/app/settings/page.tsx | 4 ++-- frontend/src/app/test-auth/page.tsx | 4 ++-- 14 files changed, 46 insertions(+), 39 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 8531b34..5c26a2e 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -23,8 +23,8 @@ COPY --from=deps /app/node_modules ./node_modules COPY . . # Environment variables for build -ENV NEXT_TELEMETRY_DISABLED 1 -ENV NODE_ENV production +ENV NEXT_TELEMETRY_DISABLED=1 +ENV NODE_ENV=production # Build the application RUN \ @@ -38,8 +38,8 @@ RUN \ FROM base AS runner WORKDIR /app -ENV NODE_ENV production -ENV NEXT_TELEMETRY_DISABLED 1 +ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 # Create nextjs user RUN addgroup --system --gid 1001 nodejs @@ -61,8 +61,8 @@ USER nextjs # Expose port EXPOSE 3000 -ENV PORT 3000 -ENV HOSTNAME "0.0.0.0" +ENV PORT=3000 +ENV HOSTNAME=0.0.0.0 # Start the application (standalone) -CMD ["node", "server.js"] \ No newline at end of file +CMD ["node", "server.js"] diff --git a/frontend/next.config.js b/frontend/next.config.js index 279e0a5..32baf9a 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -9,10 +9,8 @@ const nextConfig = { typescript: { ignoreBuildErrors: true, }, - experimental: { - // Enable standalone output for better Docker compatibility - outputStandalone: true, - }, + // Enable standalone output for better Docker compatibility + output: 'standalone', webpack: (config, { isServer, dev }) => { config.resolve.alias = { ...config.resolve.alias, @@ -53,4 +51,4 @@ const nextConfig = { }, }; -module.exports = nextConfig; \ No newline at end of file +module.exports = nextConfig; diff --git a/frontend/src/app/admin/page.tsx b/frontend/src/app/admin/page.tsx index 9949f52..b8934b2 100644 --- a/frontend/src/app/admin/page.tsx +++ b/frontend/src/app/admin/page.tsx @@ -18,7 +18,7 @@ import { CheckCircle, XCircle } from "lucide-react"; -import { apiClient } from "../lib/api-client"; +import { apiClient } from "@/lib/api-client"; interface SystemStats { total_users: number; @@ -358,4 +358,4 @@ export default function AdminPage() { ); -} \ No newline at end of file +} diff --git a/frontend/src/app/analytics/page.tsx b/frontend/src/app/analytics/page.tsx index a9558fe..ffabd0e 100644 --- a/frontend/src/app/analytics/page.tsx +++ b/frontend/src/app/analytics/page.tsx @@ -20,7 +20,7 @@ import { RefreshCw } from 'lucide-react'; import { ProtectedRoute } from '@/components/auth/ProtectedRoute' -import { apiClient } from '../lib/api-client' +import { apiClient } from '@/lib/api-client' interface AnalyticsData { overview: { @@ -399,4 +399,4 @@ function AnalyticsPageContent() { ); -} \ No newline at end of file +} diff --git a/frontend/src/app/api-keys/page.tsx b/frontend/src/app/api-keys/page.tsx index 7eda2ac..0fce068 100644 --- a/frontend/src/app/api-keys/page.tsx +++ b/frontend/src/app/api-keys/page.tsx @@ -1,6 +1,7 @@ "use client"; -import { useState, useEffect } from "react"; +import { useState, useEffect, Suspense } from "react"; +export const dynamic = 'force-dynamic' import { useSearchParams } from "next/navigation"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; @@ -36,7 +37,7 @@ import { Bot } from "lucide-react"; import { useToast } from "@/hooks/use-toast"; -import { apiClient } from "../lib/api-client"; +import { apiClient } from "@/lib/api-client"; interface ApiKey { id: string; @@ -93,7 +94,7 @@ const PERMISSION_OPTIONS = [ { value: "llm:embeddings", label: "LLM Embeddings" }, ]; -export default function ApiKeysPage() { +function ApiKeysPageContent() { const { toast } = useToast(); const searchParams = useSearchParams(); const [apiKeys, setApiKeys] = useState([]); @@ -905,4 +906,12 @@ export default function ApiKeysPage() { ); -} \ No newline at end of file +} + +export default function ApiKeysPage() { + return ( + Loading...}> + + + ); +} diff --git a/frontend/src/app/audit/page.tsx b/frontend/src/app/audit/page.tsx index d4b513d..7567a17 100644 --- a/frontend/src/app/audit/page.tsx +++ b/frontend/src/app/audit/page.tsx @@ -1,7 +1,7 @@ "use client"; import { useState, useEffect } from "react"; -import { downloadFile } from "../lib/file-download"; +import { downloadFile } from "@/lib/file-download"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; @@ -27,7 +27,7 @@ import { ChevronRight } from "lucide-react"; import { useToast } from "@/hooks/use-toast"; -import { apiClient } from "../lib/api-client"; +import { apiClient } from "@/lib/api-client"; import { config } from "@/lib/config"; interface AuditLog { @@ -544,4 +544,4 @@ export default function AuditPage() { ); -} \ No newline at end of file +} diff --git a/frontend/src/app/budgets/page.tsx b/frontend/src/app/budgets/page.tsx index 7e9a761..f06c521 100644 --- a/frontend/src/app/budgets/page.tsx +++ b/frontend/src/app/budgets/page.tsx @@ -34,7 +34,7 @@ import { Clock } from "lucide-react"; import { useToast } from "@/hooks/use-toast"; -import { apiClient } from "../lib/api-client"; +import { apiClient } from "@/lib/api-client"; interface Budget { id: string; @@ -608,4 +608,4 @@ export default function BudgetsPage() { ); -} \ No newline at end of file +} diff --git a/frontend/src/app/dashboard/page.tsx b/frontend/src/app/dashboard/page.tsx index d878c49..35a7db4 100644 --- a/frontend/src/app/dashboard/page.tsx +++ b/frontend/src/app/dashboard/page.tsx @@ -5,7 +5,7 @@ import { useState, useEffect } from "react" import { ProtectedRoute } from "@/components/auth/ProtectedRoute" import { useToast } from "@/hooks/use-toast" import { config } from "@/lib/config" -import { apiClient } from "../lib/api-client" +import { apiClient } from "@/lib/api-client" // Force dynamic rendering for authentication export const dynamic = 'force-dynamic' @@ -476,4 +476,4 @@ function DashboardContent() { ) -} \ No newline at end of file +} diff --git a/frontend/src/app/llm/page.tsx b/frontend/src/app/llm/page.tsx index 117b18a..70362c8 100644 --- a/frontend/src/app/llm/page.tsx +++ b/frontend/src/app/llm/page.tsx @@ -25,7 +25,7 @@ import { AlertTriangle } from 'lucide-react' import { useToast } from '@/hooks/use-toast' -import { apiClient } from '../lib/api-client' +import { apiClient } from '@/lib/api-client' import { ProtectedRoute } from '@/components/auth/ProtectedRoute' import { useRouter } from 'next/navigation' @@ -468,4 +468,4 @@ function LLMPageContent() { ) -} \ No newline at end of file +} diff --git a/frontend/src/app/prompt-templates/page.tsx b/frontend/src/app/prompt-templates/page.tsx index 3232aad..57f438d 100644 --- a/frontend/src/app/prompt-templates/page.tsx +++ b/frontend/src/app/prompt-templates/page.tsx @@ -29,7 +29,7 @@ import { } from '@/components/ui/alert-dialog' import { Edit3, RotateCcw, Loader2, Save, AlertTriangle, Plus, Sparkles } from 'lucide-react' import toast from 'react-hot-toast' -import { apiClient } from '../lib/api-client' +import { apiClient } from '@/lib/api-client' import { config } from '@/lib/config' import { useAuth } from '@/contexts/AuthContext' @@ -725,4 +725,4 @@ export default function PromptTemplatesPage() { )} ) -} \ No newline at end of file +} diff --git a/frontend/src/app/rag/page.tsx b/frontend/src/app/rag/page.tsx index 4eba5ef..d69732f 100644 --- a/frontend/src/app/rag/page.tsx +++ b/frontend/src/app/rag/page.tsx @@ -13,7 +13,7 @@ import { DocumentUpload } from "@/components/rag/document-upload" import { DocumentBrowser } from "@/components/rag/document-browser" import { useAuth } from "@/contexts/AuthContext" import { ProtectedRoute } from '@/components/auth/ProtectedRoute' -import { apiClient } from '../lib/api-client' +import { apiClient } from '@/lib/api-client' interface Collection { id: string @@ -237,4 +237,4 @@ function RAGPageContent() { ) -} \ No newline at end of file +} diff --git a/frontend/src/app/register/page.tsx b/frontend/src/app/register/page.tsx index 53ece3f..4054b9b 100644 --- a/frontend/src/app/register/page.tsx +++ b/frontend/src/app/register/page.tsx @@ -10,7 +10,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com import { Alert, AlertDescription } from "@/components/ui/alert"; import { Checkbox } from "@/components/ui/checkbox"; import { useToast } from "@/hooks/use-toast"; -import { apiClient } from "../lib/api-client"; +import { apiClient } from "@/lib/api-client"; interface RegisterFormData { username: string; @@ -288,4 +288,4 @@ export default function RegisterPage() { ); -} \ No newline at end of file +} diff --git a/frontend/src/app/settings/page.tsx b/frontend/src/app/settings/page.tsx index c5cf425..9af3f19 100644 --- a/frontend/src/app/settings/page.tsx +++ b/frontend/src/app/settings/page.tsx @@ -31,7 +31,7 @@ import { Play } from "lucide-react"; import { useToast } from "@/hooks/use-toast"; -import { apiClient } from "../lib/api-client"; +import { apiClient } from "@/lib/api-client"; import { useModules, triggerModuleRefresh } from '@/contexts/ModulesContext'; import { Badge } from '@/components/ui/badge'; @@ -1115,4 +1115,4 @@ export default function SettingsPage() { ); -} \ No newline at end of file +} diff --git a/frontend/src/app/test-auth/page.tsx b/frontend/src/app/test-auth/page.tsx index 15935d8..94d316f 100644 --- a/frontend/src/app/test-auth/page.tsx +++ b/frontend/src/app/test-auth/page.tsx @@ -4,7 +4,7 @@ import { useAuth } from "@/contexts/AuthContext" import { Button } from "@/components/ui/button" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { useState } from "react" -import { apiClient } from "../lib/api-client" +import { apiClient } from "@/lib/api-client" import { tokenManager } from "@/lib/token-manager" export default function TestAuthPage() { @@ -136,4 +136,4 @@ Authenticated: ${tokenManager.isAuthenticated()} ) -} \ No newline at end of file +}