📦 Shop Product AI Content System

📅 Tarih: 2025-11-27 | 🎯 Tenant: ixtif.com (Tenant 2) | 👤 Hedef: Tam Otomasyonlu Ürün İçerik Üretimi

Sistem Hedefi

🎯 Ana Hedef

Shop modülündeki ürünler için AI ile tamamen otomatik bilingual (TR + EN) içerik üretimi:

  • ✅ Title + Short Description + Long Body
  • ✅ Primary Specs (4 item - hero section)
  • ✅ FAQ Data (5 soru/cevap)
  • ✅ SEO Keywords (tags)
  • ✅ AI Generated Images (2 adet - Leonardo AI)
  • ✅ Görsellere SEO etiketleri (alt, title, loading)

💡 Örnek Sonuç

Akson Mili Kapağı - 414 ürünü için üretilen içerik:

  • 📝 Body TR: 9,000+ karakter (pattern v4)
  • 📝 Body EN: 8,800+ karakter
  • 📊 Primary Specs: 4 item (Malzeme, Uyumluluk, Seri, Kaplama)
  • ❓ FAQ: 5 soru/cevap (bilingual)
  • 🏷️ Tags: 30 keyword (15 TR + 15 EN)
  • 📸 Görseller: 2 adet (montaj + blueprint - 1024x1024)

🔗 Canlı Örnek

Sistem Mimarisi

1. Veri Akışı

User Input (Ürün Başlık + Kategori) ↓ OpenAI GPT-4 (Content Generation) ↓ Content Parsing (Title, Specs, Body, FAQ, Tags) ↓ Leonardo AI (2 Görsel Üretimi - Async) ↓ Image Embedding (Body içine otomatik) ↓ SEO Tag Injection (alt, title, loading) ↓ Database Save (ShopProduct model) ↓ Cache Clear + OPcache Reset

2. Kullanılacak Teknolojiler

Bileşen Teknoloji Açıklama
AI Content Generation OpenAI GPT-4 Bilingual content üretimi (TR + EN)
AI Image Generation Leonardo AI (Lucid Origin) 2 görsel: montaj + teknik çizim
API Prompt Enhancement AIPromptEnhancer Service Görsel promptları optimize eder
DB Storage ShopProduct Model Tenant-aware database
DB Media Storage MediaLibraryItem Model AI görselleri metadata ile saklar
UI Admin Interface Livewire Component Tek buton: "Generate AI Content"

Yapılacaklar - Adım Adım

📝 ADIM 1: AI Content Service Oluştur

Dosya: Modules/Shop/app/Services/ShopProductAIContentService.php

Sorumluluk: Ürün bilgilerinden GPT-4 ile bilingual content üretimi

  • generateFullContent($title, $category, $options) - Ana metod
  • Dönen veri: title, short_description, body, primary_specs, faq_data, tags
  • Pattern v4 kullan (o örnek HTML yapısı)
  • Tenant context ekle (ixtif.com = industrial_equipment)
  • SEO-focused keyword integration
// Örnek prompt "Generate bilingual product content for: {$title} Category: {$category} Sector: Industrial Equipment (Forklift Parts) Pattern: Simple paragraphs with strong tags Output: JSON with tr/en keys Required fields: title, short_description, body, primary_specs(4), faq_data(5), tags(30)"

🎨 ADIM 2: AI Image Generator Integration

Dosya: Modules/Shop/app/Services/ShopProductImageGenerator.php

Sorumluluk: Leonardo AI ile 2 görsel üret ve body'ye embed et

  • Görsel 1: Installation/Usage shot (1024x1024, cinematic_closeup)
  • Görsel 2: Technical/Blueprint (1024x1024, neutral)
  • Async generation (queue job kullan)
  • MediaLibraryItem oluştur + metadata
  • Lightbox wrapper ekle
  • SEO tags inject et (alt, title, loading=lazy)
// Örnek prompt generation $prompt1 = "Close-up photo of {$productTitle} being installed, industrial environment, technician hands, professional"; $prompt2 = "Technical blueprint of {$productTitle}, engineering drawing, dark blue background, CAD style";

🖥️ ADIM 3: Livewire Admin Component

Dosya: Modules/Shop/app/Http/Livewire/Admin/ProductAIContentGenerator.php

UI: Admin > Shop > Products > Manage > "Generate AI Content" button

  • Input: Title (otomatik ürün başlığından)
  • Input: Category (otomatik ürün kategorisinden)
  • Checkbox: Generate Images (default: true)
  • Progress indicator (Livewire polling)
  • Success: Preview + "Apply" button

🔄 ADIM 4: Queue Job - Async Image Generation

Dosya: Modules/Shop/app/Jobs/GenerateProductImagesJob.php

Neden: Leonardo AI 20-30 saniye sürebilir, kullanıcı beklemez

  • Job parametreleri: product_id, body_placeholder_positions
  • Leonardo AI görselleri üret
  • Body'deki placeholder'ları değiştir
  • SEO tags ekle
  • Product update + cache clear

📊 ADIM 5: Analytics & Logging

Dosya: Mevcut AI credit system kullan

  • GPT-4 kullanımı: 5 credit
  • Leonardo AI (2 görsel): 2 credit
  • Toplam: 7 credit per product
  • Log: Generation time, success rate, errors

Teknik Detaylar

Content Pattern (v4 Yapısı)

📐 HTML Yapısı

Akson Mili Kapağı örneğindeki pattern:

  • Intro Section: 2/3 metin + 1/3 görsel (sticky)
  • Features Section: "Neden Bu Yedek Parçayı Tercih Etmelisiniz?" - 6 card (grid 3 col)
  • Use Cases Section: "Hangi Forklift Tiplerinde Kullanılır?" - 3 card
  • Advantages Box: Gradient kutu, 4 item (grid 2 col)
  • Image + Text Grid: Görsel + açıklama (2 col)

Primary Specs Yapısı

[ {"label": "Malzeme", "value": "Döküm Çelik"}, {"label": "Uyumluluk", "value": "Forklift Arka Dingil"}, {"label": "Seri", "value": "414"}, {"label": "Kaplama", "value": "Toz Boya Kaplama"} ] // NOT: icon field KULLANMA (template parse hatası verir)

FAQ Yapısı

[ { "question": { "tr": "414 serisi hangi forklift modellerine uyumludur?", "en": "Which forklift models is the 414 series compatible with?" }, "answer": { "tr": "1.5-5 ton kapasiteli standart forklift modellerinde...", "en": "Used in standard forklift models with 1.5-5 ton capacity..." } } // ... 4 soru daha ]

SEO Image Tags

<a href='{$imageUrl}' class='glightbox block rounded-xl overflow-hidden border-2 border-gray-200 dark:border-gray-700 hover:border-blue-500 transition-all'> <img src='{$imageUrl}' alt='Forklift Akson Mili Kapağı 414 Serisi Montajı - Arka Dingil Yedek Parça' title='Akson kapağı montaj görseli - OEM kalite forklift yedek parça' class='w-full aspect-square rounded-xl object-cover' loading='lazy' > </a>

Kritik Noktalar

⚠️ Tenant Awareness

Sistem multi-tenant! Her tenant farklı sektör:

  • Tenant 2 (ixtif.com): industrial_equipment
  • Tenant 1001 (muzibu.com): music_platform
  • Content promptunda tenant sektörünü belirt
  • tenancy()->initialize() unutma!

⚠️ Permission Management

Her dosya işleminden sonra:

sudo chown tuufi.com_:psaserv /path/to/file sudo chmod 644 /path/to/file

⚠️ Cache Yönetimi

Content update sonrası mutlaka:

php artisan view:clear php artisan responsecache:clear curl -s -k https://ixtif.com/opcache-reset.php

⚠️ Icon Field Hatası

Primary specs ve FAQ data'da icon field KULLANMA!

Blade template parse hatası verir. Sadece label/value ve question/answer kullan.

Uygulama Sırası

Sıra Dosya/Bileşen Süre Bağımlılık
1 ShopProductAIContentService.php 2-3 saat OpenAI API, AIPromptEnhancer
2 ShopProductImageGenerator.php 2 saat LeonardoAIService, MediaLibraryItem
3 GenerateProductImagesJob.php 1 saat Queue, ImageGenerator
4 ProductAIContentGenerator Livewire 3 saat ContentService, ImageGenerator
5 Test + Debug 2 saat Tüm bileşenler

⏱️ Toplam Tahmini Süre: 10-12 saat

Başarı Kriterleri

✅ Sistem Başarılı Sayılır Eğer:

  • Kullanıcı admin panelde tek butona basıyor
  • 30-60 saniye içinde tam içerik hazır (görsellerle)
  • Content SEO-friendly ve okunabilir
  • Görseller otomatik embed edilmiş + SEO tagları mevcut
  • Lightbox çalışıyor
  • Dark mode uyumlu
  • Mobil responsive
  • Bilingual (TR + EN) %100 uyumlu
  • Cache otomatik temizleniyor
  • Credit sistemine entegre

Referans Dosyalar

Dosya Açıklama
/var/www/vhosts/tuufi.com/httpdocs/public/readme/2025/11/27/product-331-fixed/ai-content-v5.json Akson Mili Kapağı content örneği (final)
Modules/MediaManagement/app/Http/Livewire/Admin/AiImageGeneratorComponent.php Leonardo AI entegrasyonu örneği
app/Services/Media/LeonardoAIService.php Leonardo API service
Modules/AI/app/Services/AIPromptEnhancer.php Prompt enhancement (GPT-4)
Modules/Shop/resources/views/themes/ixtif/show.blade.php Product detail template (GLightbox mevcut)