Initial commit

This commit is contained in:
mstfyldz
2026-08-08 17:19:28 +03:00
commit df70520ede
19 changed files with 3926 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import OpenAI from 'openai';
import dotenv from 'dotenv';
dotenv.config();
// --- DEEPSEEK CONFIGURATION (PASIFİZE EDİLDİ) ---
// const apiKey = process.env.DEEPSEEK_API_KEY;
// if (!apiKey) {
// console.warn('WARNING: DEEPSEEK_API_KEY is missing from environment variables.');
// }
// export const openai = new OpenAI({
// baseURL: 'https://api.deepseek.com/v1',
// apiKey: apiKey || 'dummy-key',
// });
// ----------------------------------------------
// --- MİZAN (RUNPOD) CONFIGURATION ---
const runpodBaseUrl = process.env.RUNPOD_API_BASE_URL || 'https://q190env94stwis-11434.proxy.runpod.net/v1';
const runpodApiKey = process.env.RUNPOD_API_KEY || 'dummy-key';
export const openai = new OpenAI({
baseURL: runpodBaseUrl,
apiKey: runpodApiKey,
});
// ------------------------------------
+16
View File
@@ -0,0 +1,16 @@
import { createClient } from '@supabase/supabase-js';
import dotenv from 'dotenv';
dotenv.config();
const supabaseUrl = process.env.SUPABASE_URL;
// We use the service role key in the backend to bypass RLS when necessary (e.g. inserting system analyses),
// or we can use anon key if RLS allows it. Let's assume we use the anon key or service role key provided in ENV.
// However, the frontend passes the user_id, so the backend can act on behalf of the user.
const supabaseKey = process.env.SUPABASE_SERVICE_ROLE_KEY || process.env.SUPABASE_ANON_KEY;
if (!supabaseUrl || !supabaseKey) {
throw new Error('Missing Supabase URL or Key in environment variables');
}
export const supabase = createClient(supabaseUrl, supabaseKey);