feat: prototype gap closure — enrichment diagnosis + brand extraction + plan assets
Phase 1: Data Pipeline Fixes - Plan page: connect enrichment data for Asset Collection + YouTube Repurpose - mergeEnrichment: generate 15-20 data-driven diagnosis items from enrichment (YouTube Shorts check, IG engagement, FB activity, 강남언니 ratings, GMaps) - ClinicSnapshot: fill staffCount, nearestStation, certifications from enrichment Phase 2: AI + Brand Enhancement - AI prompt: per-channel diagnosis[] array (5-7 items), established, nameEn, newChannelProposals - scrape-website: Firecrawl branding extraction (colors, fonts, logo, tagline) - transformPlan: BrandGuide colors/fonts from scraped branding data - transformPlan: cross-channel brand consistency analysis (name, phone mismatches) - transformPlan: channel branding rules from enrichment (YT, IG, FB profiles) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a7d8aeeddc
commit
e32b8766de
4 files changed
+380
-31
No files matched your search
@@ -88,7 +88,9 @@ ${JSON.stringify(analyzeResult.data?.analysis || {}, null, 2)}
|
||||
|
||||
{
|
||||
"clinicInfo": {
|
||||
"name": "병원명",
|
||||
"name": "병원명 (한국어)",
|
||||
"nameEn": "영문 병원명",
|
||||
"established": "개원년도 (예: 2005)",
|
||||
"address": "주소",
|
||||
"phone": "전화번호",
|
||||
"services": ["시술1", "시술2"],
|
||||
@@ -96,20 +98,23 @@ ${JSON.stringify(analyzeResult.data?.analysis || {}, null, 2)}
|
||||
"socialMedia": {
|
||||
"instagramAccounts": ["국내용 핸들", "해외/영문 핸들", "기타 관련 계정 (@ 없이, 예: banobagi_ps, english_banobagi)"],
|
||||
"youtube": "YouTube 채널 핸들 또는 URL",
|
||||
"facebook": "Facebook 페이지명",
|
||||
"facebook": "Facebook 페이지명 또는 URL",
|
||||
"naverBlog": "네이버 블로그 ID"
|
||||
}
|
||||
},
|
||||
"executiveSummary": "경영진 요약 (3-5문장)",
|
||||
"overallScore": 0-100,
|
||||
"channelAnalysis": {
|
||||
"naverBlog": { "score": 0-100, "status": "active|inactive|weak", "posts": 0, "recommendation": "추천사항" },
|
||||
"instagram": { "score": 0-100, "status": "active|inactive|weak", "followers": 0, "recommendation": "추천사항" },
|
||||
"youtube": { "score": 0-100, "status": "active|inactive|weak", "subscribers": 0, "recommendation": "추천사항" },
|
||||
"naverPlace": { "score": 0-100, "rating": 0, "reviews": 0, "recommendation": "추천사항" },
|
||||
"gangnamUnni": { "score": 0-100, "rating": 0, "reviews": 0, "recommendation": "추천사항" },
|
||||
"website": { "score": 0-100, "issues": [], "recommendation": "추천사항", "trackingPixels": [{"name": "Google Analytics|Facebook Pixel|Naver Analytics|etc", "installed": true}], "snsLinksOnSite": true, "additionalDomains": [{"domain": "example.com", "purpose": "용도"}], "mainCTA": "주요 전환 유도 요소" }
|
||||
"naverBlog": { "score": 0-100, "status": "active|inactive|weak", "posts": 0, "recommendation": "추천사항", "diagnosis": [{"issue": "구체적 문제", "severity": "critical|warning|good", "recommendation": "개선 방안"}] },
|
||||
"instagram": { "score": 0-100, "status": "active|inactive|weak", "followers": 0, "recommendation": "추천사항", "diagnosis": [{"issue": "구체적 문제", "severity": "critical|warning|good", "recommendation": "개선 방안"}] },
|
||||
"youtube": { "score": 0-100, "status": "active|inactive|weak", "subscribers": 0, "recommendation": "추천사항", "diagnosis": [{"issue": "구체적 문제", "severity": "critical|warning|good", "recommendation": "개선 방안"}] },
|
||||
"naverPlace": { "score": 0-100, "rating": 0, "reviews": 0, "recommendation": "추천사항", "diagnosis": [{"issue": "구체적 문제", "severity": "critical|warning|good", "recommendation": "개선 방안"}] },
|
||||
"gangnamUnni": { "score": 0-100, "rating": 0, "reviews": 0, "recommendation": "추천사항", "diagnosis": [{"issue": "구체적 문제", "severity": "critical|warning|good", "recommendation": "개선 방안"}] },
|
||||
"website": { "score": 0-100, "issues": [], "recommendation": "추천사항", "trackingPixels": [{"name": "Google Analytics|Facebook Pixel|Naver Analytics|etc", "installed": true}], "snsLinksOnSite": true, "additionalDomains": [{"domain": "example.com", "purpose": "용도"}], "mainCTA": "주요 전환 유도 요소", "diagnosis": [{"issue": "구체적 문제", "severity": "critical|warning|good", "recommendation": "개선 방안"}] }
|
||||
},
|
||||
"newChannelProposals": [
|
||||
{ "channel": "제안 채널명", "priority": "P0|P1|P2", "rationale": "채널 개설 근거" }
|
||||
],
|
||||
"competitors": [
|
||||
{ "name": "경쟁병원명", "strengths": ["강점1"], "weaknesses": ["약점1"], "marketingChannels": ["채널1"] }
|
||||
],
|
||||
@@ -130,7 +135,7 @@ ${JSON.stringify(analyzeResult.data?.analysis || {}, null, 2)}
|
||||
{ "area": "포지셔닝", "asIs": "현재 시장 포지셔닝", "toBe": "목표 포지셔닝" }
|
||||
],
|
||||
"kpiTargets": [
|
||||
{ "metric": "지표명 (종합 점수, Instagram 팔로워, YouTube 구독자, 네이버 블로그 방문자, 월간 상담 문의 등)", "current": "현재 수치", "target3Month": "3개월 목표 (현실적)", "target12Month": "12개월 목표 (도전적)" }
|
||||
{ "metric": "외부 측정 가능한 지표만 포함 (종합 점수, Instagram 팔로워, YouTube 구독자/조회수, 네이버 블로그 검색 노출 수, 강남언니 리뷰 수, Google Maps 평점 등). 병원 내부에서만 알 수 있는 지표(상담 문의, 매출, 예약 수 등)는 절대 포함하지 마세요.", "current": "현재 수치", "target3Month": "3개월 목표 (현실적)", "target12Month": "12개월 목표 (도전적)" }
|
||||
],
|
||||
"recommendations": [
|
||||
{ "priority": "high|medium|low", "category": "카테고리", "title": "제목", "description": "설명", "expectedImpact": "기대 효과" }
|
||||
|
||||
@@ -122,9 +122,48 @@ Deno.serve(async (req) => {
|
||||
|
||||
const searchData = await searchResponse.json();
|
||||
|
||||
// Step 4: Extract branding (colors, fonts, logos) from the website
|
||||
let brandingData: Record<string, unknown> = {};
|
||||
try {
|
||||
const brandResponse = await fetch("https://api.firecrawl.dev/v1/scrape", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${FIRECRAWL_API_KEY}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
url,
|
||||
formats: ["json"],
|
||||
jsonOptions: {
|
||||
prompt: "Extract brand identity from this website: primary brand colors (hex codes), accent colors, background colors, font families used (headings and body), logo image URLs (header logo, favicon), and main tagline/slogan",
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
primaryColor: { type: "string" },
|
||||
accentColor: { type: "string" },
|
||||
backgroundColor: { type: "string" },
|
||||
textColor: { type: "string" },
|
||||
headingFont: { type: "string" },
|
||||
bodyFont: { type: "string" },
|
||||
logoUrl: { type: "string" },
|
||||
faviconUrl: { type: "string" },
|
||||
tagline: { type: "string" },
|
||||
},
|
||||
},
|
||||
},
|
||||
waitFor: 3000,
|
||||
}),
|
||||
});
|
||||
const brandResult = await brandResponse.json();
|
||||
brandingData = brandResult.data?.json || {};
|
||||
} catch {
|
||||
// Branding extraction is optional — don't fail the whole scrape
|
||||
}
|
||||
|
||||
// Combine all data
|
||||
const result = {
|
||||
clinic: scrapeData.data?.json || {},
|
||||
branding: brandingData,
|
||||
siteLinks: scrapeData.data?.links || [],
|
||||
siteMap: mapData.success ? mapData.links || [] : [],
|
||||
reviews: searchData.data || [],
|
||||
|
||||
Reference in new issue
Block a user