diff --git a/frontend/app/api/ai/explain/route.ts b/frontend/app/api/ai/explain/route.ts index 551561c6..115ce801 100644 --- a/frontend/app/api/ai/explain/route.ts +++ b/frontend/app/api/ai/explain/route.ts @@ -7,7 +7,7 @@ import { createExplainPrompt, type ExplanationResponse, } from '@/lib/ai/prompts'; -import { getClientIp } from '@/lib/security/rate-limit'; +import { getClientIp } from '@/lib/security/client-ip'; const rateLimiter = new Map(); const MAX_REQUESTS_PER_WINDOW = 10; @@ -94,6 +94,9 @@ export async function POST(request: NextRequest) { const apiKey = process.env.GROQ_API_KEY; if (!apiKey) { console.error('GROQ_API_KEY is not configured'); + console.error('Available env vars starting with GROQ:', + Object.keys(process.env).filter(k => k.startsWith('GROQ')) + ); return NextResponse.json( { error: 'AI service not configured', code: 'SERVICE_UNAVAILABLE' }, { status: 503 } diff --git a/frontend/app/layout.tsx b/frontend/app/layout.tsx index c92fb3b7..e5ee2c7a 100644 --- a/frontend/app/layout.tsx +++ b/frontend/app/layout.tsx @@ -34,6 +34,25 @@ export default function RootLayout({ }>) { return ( + +