Skip to content

Bu API servisi, Supabase veritabanı trigger'ları ile entegre çalışarak OpenAI modellerini kullanmanızı sağlar.

Notifications You must be signed in to change notification settings

recepkocur/supabase-ai-assistant

Repository files navigation

AI Assistant Trigger API

Son Güncelleme: 17.02.2025

OpenAI modellerini Supabase veritabanı trigger'ları ile kullanmanızı sağlayan API servisi.

📌 Temel Özellikler

  • OpenAI GPT entegrasyonu (GPT-4 desteği)
  • Güvenli API erişimi
  • Docker tabanlı deployment
  • Otomatik CI/CD pipeline
  • Kapsamlı loglama ve monitoring
  • Development/Production ortam ayrımı

🚀 Hızlı Başlangıç

  1. Gereksinimleri yükleyin:

    • Node.js 20+
    • Docker ve Docker Compose
    • Make (opsiyonel)
  2. Ortam değişkenlerini ayarlayın:

OPENAI_API_KEY=your_openai_api_key
API_SECRET=your_api_secret
API_DEV_URL=api-dev.example.com
API_PROD_URL=api.example.com
  1. Servisi başlatın:
make restart   # veya
docker compose -f docker-compose.dev.yml up -d --build

🔌 API Kullanımı

Endpoint: /trigger-ai-assistant/generate-description

İstek:

{
  "name": "İşlenecek metin",
  "prompt": "Sistem talimatı",
  "model": "gpt-4" // Opsiyonel
}

Örnek

Başlıklar:

  • x-api-secret: API güvenlik anahtarı

🛡️ Güvenlik Özellikleri

  • API Secret doğrulaması
  • SSL/TLS şifreleme
  • Rate limiting
  • Request timeout (60s)
  • Request boyut limiti (4MB)
  • CORS koruması

🔧 Geliştirici Araçları

Ortam Yönetimi:

make restart  # Yeniden başlat
make log     # Logları görüntüle
make ps      # Durum kontrolü
make clean   # Sistemi temizle

Deployment:

  • dev branch → Development (api-dev.example.com:7101)
  • prod branch → Production (api.example.com:7201)

📊 Monitoring

  • JSON formatında detaylı loglar
  • Request/Response takibi
  • Sistem kaynak kullanımı
  • Container sağlık kontrolü
  • Maximum log boyutu: 10MB (3 dosya)

💡 Best Practices

  • Traefik reverse proxy kullanımı
  • Development ortamında hot-reload
  • Multi-stage Docker build
  • Otomatik SSL sertifika yönetimi
  • Container orchestration uyumluluğu

📦 Sistem Gereksinimleri

  • 2GB RAM (minimum)
  • 10GB disk alanı
  • Node.js 20+
  • Docker & Docker Compose

About

Bu API servisi, Supabase veritabanı trigger'ları ile entegre çalışarak OpenAI modellerini kullanmanızı sağlar.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published