first commit

This commit is contained in:
bluebamus committed 2025-12-15 13:51:13 +09:00
commit 086d898b68
154 files changed
+68619

No files matched your search

@@ -0,0 +1,274 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800" font-family="Arial, sans-serif">
<defs>
<linearGradient id="bgGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#f8fafc"/>
<stop offset="100%" style="stop-color:#e2e8f0"/>
</linearGradient>
<linearGradient id="frontendGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#3b82f6"/>
<stop offset="100%" style="stop-color:#1d4ed8"/>
</linearGradient>
<linearGradient id="backendGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#10b981"/>
<stop offset="100%" style="stop-color:#059669"/>
</linearGradient>
<linearGradient id="dbGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#f59e0b"/>
<stop offset="100%" style="stop-color:#d97706"/>
</linearGradient>
<linearGradient id="externalGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#8b5cf6"/>
<stop offset="100%" style="stop-color:#7c3aed"/>
</linearGradient>
<linearGradient id="platformGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#ef4444"/>
<stop offset="100%" style="stop-color:#dc2626"/>
</linearGradient>
<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
<feDropShadow dx="2" dy="2" stdDeviation="3" flood-opacity="0.2"/>
</filter>
</defs>
<!-- Background -->
<rect width="1200" height="800" fill="url(#bgGrad)"/>
<!-- Title -->
<text x="600" y="40" text-anchor="middle" font-size="24" font-weight="bold" fill="#1e293b">CaStAD System Architecture</text>
<!-- Frontend Section -->
<g transform="translate(50, 70)">
<rect width="320" height="280" rx="12" fill="url(#frontendGrad)" filter="url(#shadow)"/>
<text x="160" y="30" text-anchor="middle" font-size="16" font-weight="bold" fill="white">Frontend (React 19 + Vite)</text>
<rect x="15" y="50" width="290" height="210" rx="8" fill="white" fill-opacity="0.95"/>
<!-- Frontend Components -->
<text x="25" y="75" font-size="11" font-weight="bold" fill="#1e40af">Pages</text>
<text x="25" y="92" font-size="10" fill="#475569">• GeneratorPage (영상 생성)</text>
<text x="25" y="106" font-size="10" fill="#475569">• AdminDashboard (관리자)</text>
<text x="25" y="120" font-size="10" fill="#475569">• PensionsView (펜션 관리)</text>
<text x="25" y="145" font-size="11" font-weight="bold" fill="#1e40af">Services</text>
<text x="25" y="162" font-size="10" fill="#475569">• geminiService (AI 콘텐츠)</text>
<text x="25" y="176" font-size="10" fill="#475569">• sunoService (음악 생성)</text>
<text x="25" y="190" font-size="10" fill="#475569">• naverService (크롤링)</text>
<text x="25" y="204" font-size="10" fill="#475569">• instagramService (크롤링)</text>
<text x="170" y="75" font-size="11" font-weight="bold" fill="#1e40af">Contexts</text>
<text x="170" y="92" font-size="10" fill="#475569">• AuthContext</text>
<text x="170" y="106" font-size="10" fill="#475569">• LanguageContext</text>
<text x="170" y="120" font-size="10" fill="#475569">• ThemeContext</text>
<text x="170" y="145" font-size="11" font-weight="bold" fill="#1e40af">Features</text>
<text x="170" y="162" font-size="10" fill="#475569">• 다국어 지원 (6개)</text>
<text x="170" y="176" font-size="10" fill="#475569">• JWT 인증</text>
<text x="170" y="190" font-size="10" fill="#475569">• OAuth (Google/Naver)</text>
<text x="170" y="204" font-size="10" fill="#475569">• 실시간 프리뷰</text>
<text x="160" y="248" text-anchor="middle" font-size="10" fill="#64748b">Port: 5173 (dev) / 3000 (prod)</text>
</g>
<!-- Backend Section -->
<g transform="translate(440, 70)">
<rect width="320" height="280" rx="12" fill="url(#backendGrad)" filter="url(#shadow)"/>
<text x="160" y="30" text-anchor="middle" font-size="16" font-weight="bold" fill="white">Backend (Express.js)</text>
<rect x="15" y="50" width="290" height="210" rx="8" fill="white" fill-opacity="0.95"/>
<!-- Backend Components -->
<text x="25" y="75" font-size="11" font-weight="bold" fill="#065f46">API Endpoints (107+)</text>
<text x="25" y="92" font-size="10" fill="#475569">• /api/auth/* (인증)</text>
<text x="25" y="106" font-size="10" fill="#475569">• /api/profile/* (펜션)</text>
<text x="25" y="120" font-size="10" fill="#475569">• /api/youtube/* (YouTube)</text>
<text x="25" y="134" font-size="10" fill="#475569">• /api/instagram/* (Instagram)</text>
<text x="25" y="148" font-size="10" fill="#475569">• /api/tiktok/* (TikTok)</text>
<text x="25" y="162" font-size="10" fill="#475569">• /api/gemini/* (AI)</text>
<text x="25" y="176" font-size="10" fill="#475569">• /api/admin/* (관리자)</text>
<text x="170" y="75" font-size="11" font-weight="bold" fill="#065f46">Core Services</text>
<text x="170" y="92" font-size="10" fill="#475569">• Puppeteer (렌더링)</text>
<text x="170" y="106" font-size="10" fill="#475569">• FFmpeg (영상 병합)</text>
<text x="170" y="120" font-size="10" fill="#475569">• JWT 인증</text>
<text x="170" y="134" font-size="10" fill="#475569">• 쿠키 기반 크롤링</text>
<text x="170" y="148" font-size="10" fill="#475569">• API 사용량 추적</text>
<text x="170" y="162" font-size="10" fill="#475569">• 자동 생성 스케줄러</text>
<text x="160" y="248" text-anchor="middle" font-size="10" fill="#64748b">Port: 3001</text>
</g>
<!-- Database Section -->
<g transform="translate(830, 70)">
<rect width="320" height="280" rx="12" fill="url(#dbGrad)" filter="url(#shadow)"/>
<text x="160" y="30" text-anchor="middle" font-size="16" font-weight="bold" fill="white">Database (SQLite)</text>
<rect x="15" y="50" width="290" height="210" rx="8" fill="white" fill-opacity="0.95"/>
<!-- Database Tables -->
<text x="25" y="75" font-size="11" font-weight="bold" fill="#92400e">Core Tables (30+)</text>
<text x="25" y="92" font-size="10" fill="#475569">• users (사용자/플랜/크레딧)</text>
<text x="25" y="106" font-size="10" fill="#475569">• pension_profiles (펜션)</text>
<text x="25" y="120" font-size="10" fill="#475569">• pension_images (이미지)</text>
<text x="25" y="134" font-size="10" fill="#475569">• history (영상 이력)</text>
<text x="25" y="148" font-size="10" fill="#475569">• youtube_connections</text>
<text x="25" y="162" font-size="10" fill="#475569">• instagram_connections</text>
<text x="25" y="176" font-size="10" fill="#475569">• tiktok_connections</text>
<text x="170" y="75" font-size="11" font-weight="bold" fill="#92400e">Data Tables</text>
<text x="170" y="92" font-size="10" fill="#475569">• festivals (축제)</text>
<text x="170" y="106" font-size="10" fill="#475569">• public_pensions</text>
<text x="170" y="120" font-size="10" fill="#475569">• api_usage_logs</text>
<text x="170" y="134" font-size="10" fill="#475569">• system_settings</text>
<text x="170" y="148" font-size="10" fill="#475569">• activity_logs</text>
<text x="170" y="162" font-size="10" fill="#475569">• credit_history</text>
<text x="160" y="248" text-anchor="middle" font-size="10" fill="#64748b">File: server/database.sqlite</text>
</g>
<!-- External APIs Section -->
<g transform="translate(50, 380)">
<rect width="540" height="180" rx="12" fill="url(#externalGrad)" filter="url(#shadow)"/>
<text x="270" y="30" text-anchor="middle" font-size="16" font-weight="bold" fill="white">External APIs</text>
<rect x="15" y="50" width="510" height="110" rx="8" fill="white" fill-opacity="0.95"/>
<!-- API Groups -->
<g transform="translate(25, 70)">
<rect width="110" height="70" rx="6" fill="#f0f9ff" stroke="#0ea5e9" stroke-width="1"/>
<text x="55" y="20" text-anchor="middle" font-size="11" font-weight="bold" fill="#0369a1">Google</text>
<text x="55" y="38" text-anchor="middle" font-size="9" fill="#475569">Gemini AI</text>
<text x="55" y="52" text-anchor="middle" font-size="9" fill="#475569">Places API</text>
<text x="55" y="66" text-anchor="middle" font-size="9" fill="#475569">OAuth 2.0</text>
</g>
<g transform="translate(145, 70)">
<rect width="110" height="70" rx="6" fill="#fdf4ff" stroke="#d946ef" stroke-width="1"/>
<text x="55" y="20" text-anchor="middle" font-size="11" font-weight="bold" fill="#a21caf">Suno AI</text>
<text x="55" y="38" text-anchor="middle" font-size="9" fill="#475569">Music Gen</text>
<text x="55" y="52" text-anchor="middle" font-size="9" fill="#475569">V5 Model</text>
<text x="55" y="66" text-anchor="middle" font-size="9" fill="#475569">Custom Mode</text>
</g>
<g transform="translate(265, 70)">
<rect width="110" height="70" rx="6" fill="#f0fdf4" stroke="#22c55e" stroke-width="1"/>
<text x="55" y="20" text-anchor="middle" font-size="11" font-weight="bold" fill="#16a34a">Naver</text>
<text x="55" y="38" text-anchor="middle" font-size="9" fill="#475569">Map GraphQL</text>
<text x="55" y="52" text-anchor="middle" font-size="9" fill="#475569">OAuth 2.0</text>
<text x="55" y="66" text-anchor="middle" font-size="9" fill="#475569">Cookie Auth</text>
</g>
<g transform="translate(385, 70)">
<rect width="110" height="70" rx="6" fill="#fff7ed" stroke="#f97316" stroke-width="1"/>
<text x="55" y="20" text-anchor="middle" font-size="11" font-weight="bold" fill="#ea580c">TourAPI</text>
<text x="55" y="38" text-anchor="middle" font-size="9" fill="#475569">축제 정보</text>
<text x="55" y="52" text-anchor="middle" font-size="9" fill="#475569">펜션 정보</text>
<text x="55" y="66" text-anchor="middle" font-size="9" fill="#475569">지역 코드</text>
</g>
</g>
<!-- Upload Platforms Section -->
<g transform="translate(610, 380)">
<rect width="540" height="180" rx="12" fill="url(#platformGrad)" filter="url(#shadow)"/>
<text x="270" y="30" text-anchor="middle" font-size="16" font-weight="bold" fill="white">Upload Platforms</text>
<rect x="15" y="50" width="510" height="110" rx="8" fill="white" fill-opacity="0.95"/>
<!-- Platform Groups -->
<g transform="translate(35, 70)">
<rect width="140" height="70" rx="6" fill="#fef2f2" stroke="#ef4444" stroke-width="1"/>
<text x="70" y="20" text-anchor="middle" font-size="11" font-weight="bold" fill="#dc2626">YouTube</text>
<text x="70" y="38" text-anchor="middle" font-size="9" fill="#475569">OAuth 2.0 연동</text>
<text x="70" y="52" text-anchor="middle" font-size="9" fill="#475569">플레이리스트 관리</text>
<text x="70" y="66" text-anchor="middle" font-size="9" fill="#475569">Analytics API</text>
</g>
<g transform="translate(185, 70)">
<rect width="140" height="70" rx="6" fill="#fdf2f8" stroke="#ec4899" stroke-width="1"/>
<text x="70" y="20" text-anchor="middle" font-size="11" font-weight="bold" fill="#db2777">Instagram</text>
<text x="70" y="38" text-anchor="middle" font-size="9" fill="#475569">Reels 업로드</text>
<text x="70" y="52" text-anchor="middle" font-size="9" fill="#475569">자동 캡션/해시태그</text>
<text x="70" y="66" text-anchor="middle" font-size="9" fill="#475569">주간 통계</text>
</g>
<g transform="translate(335, 70)">
<rect width="140" height="70" rx="6" fill="#f0f0f0" stroke="#171717" stroke-width="1"/>
<text x="70" y="20" text-anchor="middle" font-size="11" font-weight="bold" fill="#171717">TikTok</text>
<text x="70" y="38" text-anchor="middle" font-size="9" fill="#475569">OAuth 2.0 연동</text>
<text x="70" y="52" text-anchor="middle" font-size="9" fill="#475569">Direct Post API</text>
<text x="70" y="66" text-anchor="middle" font-size="9" fill="#475569">개인정보 설정</text>
</g>
</g>
<!-- Data Flow Section -->
<g transform="translate(50, 590)">
<rect width="1100" height="180" rx="12" fill="#1e293b" filter="url(#shadow)"/>
<text x="550" y="30" text-anchor="middle" font-size="16" font-weight="bold" fill="white">Video Generation Pipeline</text>
<!-- Flow Steps -->
<g transform="translate(30, 55)">
<rect width="150" height="100" rx="8" fill="#3b82f6"/>
<text x="75" y="25" text-anchor="middle" font-size="11" font-weight="bold" fill="white">1. 입력</text>
<text x="75" y="45" text-anchor="middle" font-size="9" fill="#dbeafe">펜션 정보</text>
<text x="75" y="60" text-anchor="middle" font-size="9" fill="#dbeafe">이미지 (최대 100장)</text>
<text x="75" y="75" text-anchor="middle" font-size="9" fill="#dbeafe">URL 크롤링</text>
<text x="75" y="90" text-anchor="middle" font-size="9" fill="#dbeafe">(Naver/Google/Insta)</text>
</g>
<path d="M195 105 L225 105" stroke="#94a3b8" stroke-width="2" marker-end="url(#arrowhead)"/>
<g transform="translate(235, 55)">
<rect width="150" height="100" rx="8" fill="#8b5cf6"/>
<text x="75" y="25" text-anchor="middle" font-size="11" font-weight="bold" fill="white">2. AI 콘텐츠 생성</text>
<text x="75" y="45" text-anchor="middle" font-size="9" fill="#ede9fe">Gemini: 광고 카피</text>
<text x="75" y="60" text-anchor="middle" font-size="9" fill="#ede9fe">Gemini: TTS 음성</text>
<text x="75" y="75" text-anchor="middle" font-size="9" fill="#ede9fe">Suno: 배경 음악</text>
<text x="75" y="90" text-anchor="middle" font-size="9" fill="#ede9fe">DNA 분석</text>
</g>
<path d="M400 105 L430 105" stroke="#94a3b8" stroke-width="2"/>
<g transform="translate(440, 55)">
<rect width="150" height="100" rx="8" fill="#10b981"/>
<text x="75" y="25" text-anchor="middle" font-size="11" font-weight="bold" fill="white">3. 영상 렌더링</text>
<text x="75" y="45" text-anchor="middle" font-size="9" fill="#d1fae5">Puppeteer 캡처</text>
<text x="75" y="60" text-anchor="middle" font-size="9" fill="#d1fae5">FFmpeg 병합</text>
<text x="75" y="75" text-anchor="middle" font-size="9" fill="#d1fae5">H.264 + AAC</text>
<text x="75" y="90" text-anchor="middle" font-size="9" fill="#d1fae5">9:16 / 16:9 / 1:1</text>
</g>
<path d="M605 105 L635 105" stroke="#94a3b8" stroke-width="2"/>
<g transform="translate(645, 55)">
<rect width="150" height="100" rx="8" fill="#f59e0b"/>
<text x="75" y="25" text-anchor="middle" font-size="11" font-weight="bold" fill="white">4. 후처리</text>
<text x="75" y="45" text-anchor="middle" font-size="9" fill="#fef3c7">SEO 최적화</text>
<text x="75" y="60" text-anchor="middle" font-size="9" fill="#fef3c7">다국어 제목/설명</text>
<text x="75" y="75" text-anchor="middle" font-size="9" fill="#fef3c7">해시태그 생성</text>
<text x="75" y="90" text-anchor="middle" font-size="9" fill="#fef3c7">썸네일 생성</text>
</g>
<path d="M810 105 L840 105" stroke="#94a3b8" stroke-width="2"/>
<g transform="translate(850, 55)">
<rect width="200" height="100" rx="8" fill="#ef4444"/>
<text x="100" y="25" text-anchor="middle" font-size="11" font-weight="bold" fill="white">5. 멀티 플랫폼 업로드</text>
<text x="100" y="45" text-anchor="middle" font-size="9" fill="#fecaca">YouTube (플레이리스트)</text>
<text x="100" y="60" text-anchor="middle" font-size="9" fill="#fecaca">Instagram (Reels)</text>
<text x="100" y="75" text-anchor="middle" font-size="9" fill="#fecaca">TikTok (Direct Post)</text>
<text x="100" y="90" text-anchor="middle" font-size="9" fill="#fecaca">자동/수동 선택</text>
</g>
</g>
<!-- Arrows -->
<defs>
<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#94a3b8"/>
</marker>
</defs>
<!-- Connection Lines -->
<path d="M210 350 L210 380" stroke="#64748b" stroke-width="2" stroke-dasharray="5,5"/>
<path d="M600 350 L600 380" stroke="#64748b" stroke-width="2" stroke-dasharray="5,5"/>
<path d="M990 350 L990 380" stroke="#64748b" stroke-width="2" stroke-dasharray="5,5"/>
<path d="M370 210 L440 210" stroke="#64748b" stroke-width="2" marker-end="url(#arrowhead)"/>
<path d="M760 210 L830 210" stroke="#64748b" stroke-width="2" marker-end="url(#arrowhead)"/>
<!-- Version Info -->
<text x="1150" y="790" text-anchor="end" font-size="10" fill="#94a3b8">v3.6.0 - CaStAD Architecture</text>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

+69
View File
@@ -0,0 +1,69 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120">
<defs>
<!-- Custard cream gradient -->
<linearGradient id="custardGradient" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#FFF5E1"/>
<stop offset="50%" style="stop-color:#FFE4B5"/>
<stop offset="100%" style="stop-color:#F5C97A"/>
</linearGradient>
<!-- Caramel top gradient -->
<linearGradient id="caramelGradient" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#D4A056"/>
<stop offset="100%" style="stop-color:#B8860B"/>
</linearGradient>
<!-- Bowl/Cup gradient -->
<linearGradient id="bowlGradient" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#8B7355"/>
<stop offset="50%" style="stop-color:#6B4423"/>
<stop offset="100%" style="stop-color:#4A2C17"/>
</linearGradient>
<!-- Shine effect -->
<linearGradient id="shineGradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#FFFFFF;stop-opacity:0.6"/>
<stop offset="100%" style="stop-color:#FFFFFF;stop-opacity:0"/>
</linearGradient>
<!-- Drop shadow -->
<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
<feDropShadow dx="0" dy="2" stdDeviation="3" flood-color="#000000" flood-opacity="0.2"/>
</filter>
</defs>
<!-- Ramekin/Bowl base -->
<ellipse cx="60" cy="95" rx="40" ry="8" fill="#3D2314" opacity="0.3"/>
<!-- Bowl body -->
<path d="M20 55 L25 90 Q60 100 95 90 L100 55 Q100 50 95 48 L25 48 Q20 50 20 55" fill="url(#bowlGradient)" filter="url(#shadow)"/>
<!-- Bowl rim -->
<ellipse cx="60" cy="48" rx="38" ry="8" fill="#8B7355"/>
<ellipse cx="60" cy="48" rx="35" ry="6" fill="#6B4423"/>
<!-- Custard cream -->
<ellipse cx="60" cy="46" rx="32" ry="5" fill="url(#custardGradient)"/>
<!-- Caramel top layer -->
<ellipse cx="60" cy="44" rx="28" ry="4" fill="url(#caramelGradient)"/>
<!-- Caramelized sugar drizzle -->
<path d="M40 43 Q50 41 60 43 Q70 45 80 43" stroke="#8B4513" stroke-width="1.5" fill="none" stroke-linecap="round"/>
<!-- Shine on custard -->
<ellipse cx="48" cy="42" rx="8" ry="2" fill="url(#shineGradient)"/>
<!-- Steam wisps -->
<path d="M45 35 Q43 28 47 22" stroke="#D4A056" stroke-width="2" fill="none" stroke-linecap="round" opacity="0.5">
<animate attributeName="d" dur="2s" repeatCount="indefinite" values="M45 35 Q43 28 47 22;M45 35 Q47 28 43 22;M45 35 Q43 28 47 22"/>
<animate attributeName="opacity" dur="2s" repeatCount="indefinite" values="0.5;0.3;0.5"/>
</path>
<path d="M60 33 Q58 26 62 20" stroke="#D4A056" stroke-width="2" fill="none" stroke-linecap="round" opacity="0.6">
<animate attributeName="d" dur="2.5s" repeatCount="indefinite" values="M60 33 Q58 26 62 20;M60 33 Q62 26 58 20;M60 33 Q58 26 62 20"/>
<animate attributeName="opacity" dur="2.5s" repeatCount="indefinite" values="0.6;0.3;0.6"/>
</path>
<path d="M75 35 Q73 28 77 22" stroke="#D4A056" stroke-width="2" fill="none" stroke-linecap="round" opacity="0.4">
<animate attributeName="d" dur="3s" repeatCount="indefinite" values="M75 35 Q73 28 77 22;M75 35 Q77 28 73 22;M75 35 Q73 28 77 22"/>
<animate attributeName="opacity" dur="3s" repeatCount="indefinite" values="0.4;0.2;0.4"/>
</path>
<!-- "C" letter integrated into design (subtle) -->
<text x="60" y="75" font-family="Georgia, serif" font-size="20" font-weight="bold" fill="#FFF5E1" text-anchor="middle" opacity="0.9">C</text>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

@@ -0,0 +1,196 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 700">
<defs>
<linearGradient id="bgGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#0f172a"/>
<stop offset="100%" style="stop-color:#1e293b"/>
</linearGradient>
<linearGradient id="clientGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#3b82f6"/>
<stop offset="100%" style="stop-color:#1d4ed8"/>
</linearGradient>
<linearGradient id="serverGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#10b981"/>
<stop offset="100%" style="stop-color:#059669"/>
</linearGradient>
<linearGradient id="workerGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#f59e0b"/>
<stop offset="100%" style="stop-color:#d97706"/>
</linearGradient>
<linearGradient id="dbGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#8b5cf6"/>
<stop offset="100%" style="stop-color:#7c3aed"/>
</linearGradient>
<linearGradient id="uploadGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#ec4899"/>
<stop offset="100%" style="stop-color:#db2777"/>
</linearGradient>
<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
<feDropShadow dx="2" dy="4" stdDeviation="4" flood-opacity="0.3"/>
</filter>
<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#94a3b8"/>
</marker>
<marker id="arrowGreen" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#10b981"/>
</marker>
<marker id="arrowOrange" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#f59e0b"/>
</marker>
</defs>
<!-- Background -->
<rect width="1200" height="700" fill="url(#bgGrad)"/>
<!-- Title -->
<text x="600" y="40" text-anchor="middle" fill="#f8fafc" font-size="24" font-weight="bold" font-family="system-ui">
CastAD v3.7.0 - Background Render Queue System
</text>
<text x="600" y="65" text-anchor="middle" fill="#94a3b8" font-size="14" font-family="system-ui">
Asynchronous Video Rendering with Credit Management
</text>
<!-- Client Section -->
<rect x="50" y="100" width="280" height="280" rx="12" fill="#1e3a5f" stroke="#3b82f6" stroke-width="2" filter="url(#shadow)"/>
<text x="190" y="130" text-anchor="middle" fill="#60a5fa" font-size="16" font-weight="bold" font-family="system-ui">CLIENT (React)</text>
<!-- Client Components -->
<rect x="70" y="150" width="240" height="50" rx="8" fill="url(#clientGrad)" filter="url(#shadow)"/>
<text x="190" y="180" text-anchor="middle" fill="white" font-size="13" font-weight="500" font-family="system-ui">ResultPlayer.tsx</text>
<rect x="70" y="210" width="115" height="40" rx="6" fill="#2563eb"/>
<text x="127" y="235" text-anchor="middle" fill="white" font-size="11" font-family="system-ui">handleServerDownload()</text>
<rect x="195" y="210" width="115" height="40" rx="6" fill="#2563eb"/>
<text x="252" y="235" text-anchor="middle" fill="white" font-size="11" font-family="system-ui">pollJobStatus()</text>
<rect x="70" y="260" width="240" height="50" rx="8" fill="url(#clientGrad)" filter="url(#shadow)"/>
<text x="190" y="290" text-anchor="middle" fill="white" font-size="13" font-weight="500" font-family="system-ui">LibraryView.tsx</text>
<rect x="70" y="320" width="115" height="40" rx="6" fill="#2563eb"/>
<text x="127" y="340" text-anchor="middle" fill="white" font-size="10" font-family="system-ui">YouTube Upload</text>
<rect x="195" y="320" width="115" height="40" rx="6" fill="#c026d3"/>
<text x="252" y="340" text-anchor="middle" fill="white" font-size="10" font-family="system-ui">Instagram Upload</text>
<!-- Server Section -->
<rect x="400" y="100" width="350" height="400" rx="12" fill="#134e4a" stroke="#10b981" stroke-width="2" filter="url(#shadow)"/>
<text x="575" y="130" text-anchor="middle" fill="#34d399" font-size="16" font-weight="bold" font-family="system-ui">SERVER (Express.js)</text>
<!-- API Endpoints -->
<rect x="420" y="150" width="310" height="120" rx="8" fill="url(#serverGrad)" filter="url(#shadow)"/>
<text x="575" y="175" text-anchor="middle" fill="white" font-size="13" font-weight="bold" font-family="system-ui">Render Queue API</text>
<text x="440" y="200" fill="#d1fae5" font-size="11" font-family="monospace">POST /api/render/start</text>
<text x="640" y="200" fill="#fef3c7" font-size="10" font-family="system-ui">→ jobId, credit deduction</text>
<text x="440" y="220" fill="#d1fae5" font-size="11" font-family="monospace">GET /api/render/status/:id</text>
<text x="670" y="220" fill="#fef3c7" font-size="10" font-family="system-ui">→ progress %</text>
<text x="440" y="240" fill="#d1fae5" font-size="11" font-family="monospace">GET /api/render/jobs</text>
<text x="640" y="240" fill="#fef3c7" font-size="10" font-family="system-ui">→ job list</text>
<text x="440" y="260" fill="#fca5a5" font-size="10" font-family="system-ui">* 계정당 동시 렌더링 1개 제한</text>
<!-- Worker Section -->
<rect x="420" y="290" width="310" height="100" rx="8" fill="url(#workerGrad)" filter="url(#shadow)"/>
<text x="575" y="315" text-anchor="middle" fill="white" font-size="13" font-weight="bold" font-family="system-ui">Background Worker</text>
<text x="440" y="340" fill="#fef3c7" font-size="11" font-family="system-ui">• processRenderQueue()</text>
<text x="440" y="358" fill="#fef3c7" font-size="11" font-family="system-ui">• MAX_CONCURRENT_RENDERS: 3</text>
<text x="440" y="376" fill="#fef3c7" font-size="11" font-family="system-ui">• Puppeteer + FFmpeg</text>
<!-- Upload APIs -->
<rect x="420" y="405" width="310" height="80" rx="8" fill="url(#uploadGrad)" filter="url(#shadow)"/>
<text x="575" y="430" text-anchor="middle" fill="white" font-size="13" font-weight="bold" font-family="system-ui">Platform Upload APIs</text>
<text x="440" y="455" fill="#fce7f3" font-size="11" font-family="monospace">POST /api/youtube/my-upload</text>
<text x="440" y="475" fill="#fce7f3" font-size="11" font-family="monospace">POST /api/instagram/upload</text>
<!-- Database Section -->
<rect x="820" y="100" width="330" height="400" rx="12" fill="#4c1d95" stroke="#8b5cf6" stroke-width="2" filter="url(#shadow)"/>
<text x="985" y="130" text-anchor="middle" fill="#c4b5fd" font-size="16" font-weight="bold" font-family="system-ui">DATABASE (SQLite)</text>
<!-- Tables -->
<rect x="840" y="150" width="290" height="140" rx="8" fill="url(#dbGrad)" filter="url(#shadow)"/>
<text x="985" y="175" text-anchor="middle" fill="white" font-size="13" font-weight="bold" font-family="system-ui">render_jobs</text>
<text x="860" y="200" fill="#e9d5ff" font-size="10" font-family="monospace">id TEXT PRIMARY KEY</text>
<text x="860" y="218" fill="#e9d5ff" font-size="10" font-family="monospace">user_id, pension_id</text>
<text x="860" y="236" fill="#e9d5ff" font-size="10" font-family="monospace">status: pending|processing|completed|failed</text>
<text x="860" y="254" fill="#e9d5ff" font-size="10" font-family="monospace">progress: 0-100</text>
<text x="860" y="272" fill="#e9d5ff" font-size="10" font-family="monospace">credits_charged, credits_refunded</text>
<rect x="840" y="305" width="290" height="80" rx="8" fill="url(#dbGrad)" filter="url(#shadow)"/>
<text x="985" y="330" text-anchor="middle" fill="white" font-size="13" font-weight="bold" font-family="system-ui">credit_history</text>
<text x="860" y="355" fill="#e9d5ff" font-size="10" font-family="monospace">user_id, amount, type</text>
<text x="860" y="373" fill="#e9d5ff" font-size="10" font-family="monospace">description, balance_after</text>
<rect x="840" y="400" width="290" height="80" rx="8" fill="url(#dbGrad)" filter="url(#shadow)"/>
<text x="985" y="425" text-anchor="middle" fill="white" font-size="13" font-weight="bold" font-family="system-ui">history</text>
<text x="860" y="450" fill="#e9d5ff" font-size="10" font-family="monospace">final_video_path</text>
<text x="860" y="468" fill="#e9d5ff" font-size="10" font-family="monospace">business_name, pension_id</text>
<!-- Flow Arrows -->
<!-- Client to Server -->
<path d="M 330 200 L 400 200" stroke="#3b82f6" stroke-width="2" fill="none" marker-end="url(#arrowhead)"/>
<text x="365" y="195" fill="#60a5fa" font-size="9" font-family="system-ui">1. 렌더링 요청</text>
<!-- Server to DB (save job) -->
<path d="M 730 200 L 820 200" stroke="#10b981" stroke-width="2" fill="none" marker-end="url(#arrowGreen)"/>
<text x="775" y="195" fill="#34d399" font-size="9" font-family="system-ui">2. 작업 저장</text>
<!-- Server immediate response -->
<path d="M 400 220 L 330 220" stroke="#f59e0b" stroke-width="2" fill="none" marker-end="url(#arrowOrange)"/>
<text x="365" y="235" fill="#fbbf24" font-size="9" font-family="system-ui">3. jobId 반환</text>
<!-- Worker processing -->
<path d="M 730 340 L 820 300" stroke="#f59e0b" stroke-width="2" fill="none" marker-end="url(#arrowOrange)"/>
<text x="760" y="310" fill="#fbbf24" font-size="9" font-family="system-ui">4. 진행률</text>
<!-- Polling -->
<path d="M 330 230 C 350 280 350 280 400 280" stroke="#94a3b8" stroke-width="1.5" stroke-dasharray="5,3" fill="none" marker-end="url(#arrowhead)"/>
<text x="340" y="275" fill="#94a3b8" font-size="8" font-family="system-ui">5. 폴링</text>
<!-- Credit Flow Section -->
<rect x="50" y="520" width="500" height="160" rx="12" fill="#1e293b" stroke="#64748b" stroke-width="1" filter="url(#shadow)"/>
<text x="300" y="550" text-anchor="middle" fill="#f8fafc" font-size="14" font-weight="bold" font-family="system-ui">Credit Management Flow</text>
<!-- Credit flow boxes -->
<rect x="70" y="570" width="100" height="45" rx="6" fill="#3b82f6"/>
<text x="120" y="590" text-anchor="middle" fill="white" font-size="10" font-family="system-ui">렌더링 요청</text>
<text x="120" y="605" text-anchor="middle" fill="#bfdbfe" font-size="9" font-family="system-ui">크레딧 체크</text>
<rect x="190" y="570" width="100" height="45" rx="6" fill="#f59e0b"/>
<text x="240" y="590" text-anchor="middle" fill="white" font-size="10" font-family="system-ui">선차감</text>
<text x="240" y="605" text-anchor="middle" fill="#fef3c7" font-size="9" font-family="system-ui">-1 크레딧</text>
<rect x="310" y="570" width="100" height="45" rx="6" fill="#10b981"/>
<text x="360" y="590" text-anchor="middle" fill="white" font-size="10" font-family="system-ui">성공</text>
<text x="360" y="605" text-anchor="middle" fill="#d1fae5" font-size="9" font-family="system-ui">완료</text>
<rect x="310" y="625" width="100" height="45" rx="6" fill="#ef4444"/>
<text x="360" y="645" text-anchor="middle" fill="white" font-size="10" font-family="system-ui">실패</text>
<text x="360" y="660" text-anchor="middle" fill="#fecaca" font-size="9" font-family="system-ui">크레딧 환불</text>
<!-- Credit flow arrows -->
<path d="M 170 592 L 190 592" stroke="#94a3b8" stroke-width="1.5" fill="none" marker-end="url(#arrowhead)"/>
<path d="M 290 592 L 310 592" stroke="#94a3b8" stroke-width="1.5" fill="none" marker-end="url(#arrowhead)"/>
<path d="M 290 600 L 295 600 L 295 647 L 310 647" stroke="#94a3b8" stroke-width="1.5" fill="none" marker-end="url(#arrowhead)"/>
<!-- Constraint boxes -->
<rect x="430" y="570" width="105" height="100" rx="6" fill="#7c3aed"/>
<text x="482" y="595" text-anchor="middle" fill="white" font-size="11" font-weight="bold" font-family="system-ui">제한 사항</text>
<text x="482" y="615" text-anchor="middle" fill="#e9d5ff" font-size="10" font-family="system-ui">계정당: 1개</text>
<text x="482" y="635" text-anchor="middle" fill="#e9d5ff" font-size="10" font-family="system-ui">서버: 3개</text>
<text x="482" y="655" text-anchor="middle" fill="#e9d5ff" font-size="10" font-family="system-ui">동시 렌더링</text>
<!-- Feature Summary -->
<rect x="580" y="520" width="570" height="160" rx="12" fill="#1e293b" stroke="#64748b" stroke-width="1" filter="url(#shadow)"/>
<text x="865" y="550" text-anchor="middle" fill="#f8fafc" font-size="14" font-weight="bold" font-family="system-ui">v3.7.0 New Features</text>
<text x="600" y="580" fill="#60a5fa" font-size="12" font-family="system-ui">• Background Render Queue - 페이지 이동/로그아웃해도 작업 계속</text>
<text x="600" y="605" fill="#34d399" font-size="12" font-family="system-ui">• Credit Pre-deduction - 작업 시작 시 선차감, 실패 시 환불</text>
<text x="600" y="630" fill="#fbbf24" font-size="12" font-family="system-ui">• Per-user Rate Limit - 계정당 동시 렌더링 1개 제한</text>
<text x="600" y="655" fill="#f472b6" font-size="12" font-family="system-ui">• Instagram Upload - ResultPlayer & LibraryView에서 업로드</text>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.