[feat] solution: 템플릿 정의를 templates.json 한 파일로 — 업종 없는 id · 레이아웃 basic/paper 정리

템플릿 정보가 빌더·렌더러·백엔드에 따로 적혀 어긋나 있었다 — 백엔드 기본값이 없는 id 를
가리켰고, 음식점 강조색 오타, 섹션 간격이 빌더와 서버에서 달랐다.

- shared/src/data/templates.json: 템플릿 4개(simple·magazine·retro·paper)와 업종별 허용·기본
- shared/lib/catalog.ts · backend/common/template_catalog.py: 같은 JSON 을 읽는다, 모르는 id 는 에러
- 저장·미리보기·발행에서 모르는 id 를 거절한다(site_service · site.py 422 · build_service 실패)
- site: 레이아웃 등록표(basic·paper) + LayoutProvider, Shell→Frame, HomePage→SectionList
- 연결 안 된 레이아웃 5개, 배치 고르기(variant), 서체 선택, 빌더 canvas/DevShowcase 삭제
- 빌더: 템플릿을 바꾸면 이전 템플릿이 켠 섹션을 끄고 안내 문구를 띄운다
- postgres-init/migrations/0023: stay-retro → retro, 병원 허용 밖은 NULL(운영 미적용)
- Dockerfile·worker: 백엔드 이미지에 shared/src/data 복사
- docs: TEMPLATES.md 신설(세 폴더 역할·템플릿 추가·렌더링 순서), DATA_MODEL·ARCHITECTURE 등 갱신

shared·site·frontend tsc 통과, site vitest 통과, 백엔드 DB 없는 테스트 41 passed(DB 테스트 미실행)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
minaChoiandClaude Opus 5.5 committed 2026-09-28 15:57:35 +09:00
1 parent 46b74b310b
commit c6908629f3
183 files changed
+1824 -15243

No files matched your search

+651
View File
@@ -0,0 +1,651 @@
{
"templates": {
"simple": {
"name": "심플",
"tag": "깔끔한 기본",
"description": "흰 바탕에 고딕. 읽기 쉽고 어디에도 어울립니다. 무엇을 고를지 모르겠으면 이것.",
"layout": "basic",
"colors": {
"primary": "#18181b",
"secondary": "#52525b",
"bg": "#ffffff",
"card": "#fafafa",
"text": "#09090b",
"accent": "#2563eb"
},
"look": {
"fontHeading": "'Pretendard Variable', 'Noto Sans KR', system-ui, sans-serif",
"fontBody": "'Pretendard Variable', 'Noto Sans KR', system-ui, sans-serif",
"radius": "0.75rem",
"borderWidth": "1px",
"shadow": "0 1px 2px rgb(0 0 0 / 0.06)",
"headingTracking": "-0.02em",
"headingWeight": "700",
"sectionSpace": "3.5rem"
},
"addSections": []
},
"magazine": {
"name": "매거진",
"tag": "잡지 편집",
"description": "명조 제목에 각진 모서리, 그림자 없이 선으로만. 사진과 글이 많을 때 품이 납니다.",
"layout": "basic",
"colors": {
"primary": "#111111",
"secondary": "#57534e",
"bg": "#ffffff",
"card": "#f7f6f4",
"text": "#111111",
"accent": "#2563eb"
},
"look": {
"fontHeading": "'Noto Serif KR', 'Batang', 'Times New Roman', serif",
"fontBody": "'Pretendard Variable', 'Noto Sans KR', system-ui, sans-serif",
"radius": "0px",
"borderWidth": "1px",
"shadow": "none",
"headingTracking": "-0.03em",
"headingWeight": "700",
"sectionSpace": "5rem"
},
"addSections": []
},
"retro": {
"name": "레트로",
"tag": "레트로 감성",
"description": "갱지 바탕에 간판체. 도넛판·일력·승차권이 함께 들어옵니다.",
"layout": "basic",
"colors": {
"primary": "#1b1a15",
"secondary": "#4c4739",
"bg": "#e4dac0",
"card": "#efe7d3",
"text": "#1b1a15",
"accent": "#bf2f1b"
},
"look": {
"fontHeading": "'Gugi', 'Noto Sans KR', sans-serif",
"fontBody": "'Gowun Batang', 'Noto Serif KR', serif",
"radius": "0px",
"borderWidth": "2px",
"shadow": "4px 4px 0 rgb(27 26 21 / 0.16)",
"headingTracking": "0em",
"headingWeight": "400",
"sectionSpace": "4rem",
"texture": "repeating-linear-gradient(0deg,rgba(27,26,21,.028) 0 1px,transparent 1px 3px),repeating-linear-gradient(90deg,rgba(27,26,21,.02) 0 1px,transparent 1px 4px)"
},
"addSections": [
"event",
"video",
"festival",
"itinerary",
"story"
]
},
"paper": {
"name": "고택",
"tag": "고택 지면",
"description": "크림빛 종이에 가는 명조. 그림자도 장식도 없이 정갈한 인상을 줍니다.",
"layout": "paper",
"colors": {
"primary": "#1f1d19",
"secondary": "#726c61",
"bg": "#fdfcfa",
"card": "#f2efe8",
"text": "#1f1d19",
"accent": "#1f1d19"
},
"look": {
"fontHeading": "'Noto Serif KR', 'AppleMyungjo', 'Nanum Myeongjo', serif",
"fontBody": "'Pretendard Variable', 'Noto Sans KR', system-ui, sans-serif",
"radius": "0px",
"borderWidth": "1px",
"shadow": "none",
"headingTracking": "0.03em",
"headingWeight": "400",
"sectionSpace": "4.5rem"
},
"addSections": []
}
},
"industries": {
"stay": {
"name": "숙박",
"subName": "펜션 · 스테이",
"description": "감성 스테이, 풀빌라, 독채 펜션, 게스트하우스",
"channels": [
{
"id": "stay_platforms",
"name": "야놀자 · 여기어때",
"checked": true
},
{
"id": "naver_place",
"name": "네이버 플레이스",
"checked": true
},
{
"id": "instagram",
"name": "인스타그램",
"checked": true
}
],
"defaultTemplate": "retro",
"templates": [
"retro",
"simple",
"magazine",
"paper"
],
"sections": [
{
"id": "hero",
"type": "hero",
"name": "히어로",
"locked": true,
"enabled": true,
"description": "상단 메인 비주얼과 대표 문구"
},
{
"id": "intro",
"type": "intro",
"name": "소개",
"locked": false,
"enabled": true,
"description": "스테이의 철학과 공간 스토리"
},
{
"id": "rooms",
"type": "rooms",
"name": "객실 안내",
"locked": false,
"enabled": true,
"description": "객실 타입, 구조, 비치 물품"
},
{
"id": "event",
"type": "event",
"name": "소식",
"locked": false,
"enabled": true,
"description": "지금 하는 행사 · 공지"
},
{
"id": "info",
"type": "info",
"name": "기본 정보",
"locked": true,
"enabled": true,
"description": "체크인, 주차, 시설 핵심 정보"
},
{
"id": "booking",
"type": "booking",
"name": "예약 안내",
"locked": false,
"enabled": true,
"description": "요금 · 예약 창구 안내"
},
{
"id": "video",
"type": "video",
"name": "영상",
"locked": false,
"enabled": true,
"description": "유튜브 주소 하나면 됩니다"
},
{
"id": "photos",
"type": "photos",
"name": "사진 갤러리",
"locked": false,
"enabled": true,
"description": "감성 인테리어와 외부 풍경"
},
{
"id": "map",
"type": "map",
"name": "오시는 길",
"locked": true,
"enabled": true,
"description": "위치 안내 및 대중교통 경로"
},
{
"id": "festival",
"type": "festival",
"name": "계절별 축제",
"locked": false,
"enabled": true,
"description": "주변에서 열리는 축제 — 계절로 묶어 보여줍니다"
},
{
"id": "local",
"type": "local",
"name": "지역 정보",
"locked": false,
"enabled": true,
"description": "주변 관광지 및 맛집 추천"
},
{
"id": "itinerary",
"type": "itinerary",
"name": "추천 일정",
"locked": false,
"enabled": true,
"description": "숙소에서 출발하는 하루 코스"
},
{
"id": "story",
"type": "story",
"name": "지역 이야기",
"locked": false,
"enabled": true,
"description": "가요·인물·연표·엽서·퀴즈를 탭으로"
},
{
"id": "faq",
"type": "faq",
"name": "자주 묻는 질문",
"locked": false,
"enabled": true,
"description": "고객들이 자주 묻는 질문과 답변"
},
{
"id": "weather",
"type": "weather",
"name": "날씨",
"locked": false,
"enabled": true,
"description": "현재 기온과 사업장 주변 날씨"
},
{
"id": "social",
"type": "social",
"name": "SNS 게시글",
"locked": false,
"enabled": false,
"description": "승인해 함께 발행한 소식 · 홈페이지 맨 아래"
}
]
},
"cafe": {
"name": "카페",
"subName": "대형카페 · 로스터리",
"description": "스페셜티 로스터리, 베이커리 카페, 오션·마운틴 뷰 대형 카페",
"channels": [
{
"id": "naver_place",
"name": "네이버 플레이스",
"checked": true
},
{
"id": "instagram",
"name": "인스타그램",
"checked": true
},
{
"id": "kakao_map",
"name": "카카오맵",
"checked": true
}
],
"defaultTemplate": "simple",
"templates": [
"simple",
"magazine",
"retro",
"paper"
],
"sections": [
{
"id": "hero",
"type": "hero",
"name": "히어로",
"locked": true,
"enabled": true,
"description": "시그니처 비주얼과 카페 슬로건"
},
{
"id": "intro",
"type": "intro",
"name": "소개",
"locked": false,
"enabled": true,
"description": "로스팅 철학과 공간 스토리"
},
{
"id": "menu",
"type": "menu",
"name": "시그니처 메뉴",
"locked": false,
"enabled": true,
"description": "대표 원두, 음료, 시그니처 디저트"
},
{
"id": "info",
"type": "info",
"name": "기본 정보",
"locked": true,
"enabled": true,
"description": "영업시간, 좌석수, 편의시설 정보"
},
{
"id": "space",
"type": "space",
"name": "공간 · 좌석 안내",
"locked": false,
"enabled": true,
"description": "1/2층 공간 구성 및 야외 테라스석"
},
{
"id": "photos",
"type": "photos",
"name": "사진 갤러리",
"locked": false,
"enabled": true,
"description": "인테리어, 커피, 베이커리 비주얼"
},
{
"id": "inquiry",
"type": "inquiry",
"name": "대관 및 단체 문의",
"locked": false,
"enabled": true,
"description": "촬영 대관 및 단체 예약 접수"
},
{
"id": "map",
"type": "map",
"name": "오시는 길",
"locked": true,
"enabled": true,
"description": "드라이브 코스 및 주차 진입로 안내"
},
{
"id": "weather",
"type": "weather",
"name": "날씨",
"locked": false,
"enabled": true,
"description": "현재 기온과 매장 주변 날씨"
},
{
"id": "local",
"type": "local",
"name": "주변 나들이",
"locked": false,
"enabled": true,
"description": "양평 드라이브 코스 및 명소"
},
{
"id": "faq",
"type": "faq",
"name": "자주 묻는 질문",
"locked": false,
"enabled": true,
"description": "반려견 동반, 주차, 케어키즈존 안내"
},
{
"id": "social",
"type": "social",
"name": "SNS 게시글",
"locked": false,
"enabled": false,
"description": "승인해 함께 발행한 소식 · 홈페이지 맨 아래"
}
]
},
"restaurant": {
"name": "음식점",
"subName": "식당 · 주점",
"description": "한식 다이닝, 일식 오마카세, 이탈리안 비스트로, 고기집",
"channels": [
{
"id": "naver_place",
"name": "네이버 플레이스",
"checked": true
},
{
"id": "catchtable",
"name": "캐치테이블",
"checked": true
},
{
"id": "instagram",
"name": "인스타그램",
"checked": true
}
],
"defaultTemplate": "simple",
"templates": [
"simple",
"magazine",
"retro",
"paper"
],
"sections": [
{
"id": "hero",
"type": "hero",
"name": "히어로",
"locked": true,
"enabled": true,
"description": "대표 요리 비주얼 및 다이닝 소개"
},
{
"id": "intro",
"type": "intro",
"name": "소개",
"locked": false,
"enabled": true,
"description": "셰프의 조리 철학과 식재료 원산지 이야기"
},
{
"id": "menu",
"type": "menu",
"name": "코스 및 메뉴",
"locked": false,
"enabled": true,
"description": "점심/저녁 코스, 단품 요리, 주류 페어링"
},
{
"id": "info",
"type": "info",
"name": "기본 정보",
"locked": true,
"enabled": true,
"description": "영업시간, 휴무일, 주차, 예약 안내"
},
{
"id": "booking",
"type": "booking",
"name": "예약 · 포장 안내",
"locked": false,
"enabled": true,
"description": "캐치테이블 실시간 룸 예약 및 포장"
},
{
"id": "photos",
"type": "photos",
"name": "사진 갤러리",
"locked": false,
"enabled": true,
"description": "플레이팅, 룸 인테리어, 정갈한 상차림"
},
{
"id": "inquiry",
"type": "inquiry",
"name": "단체 행사 문의",
"locked": false,
"enabled": true,
"description": "상견례, 돌잔치, 기업 대관 문의"
},
{
"id": "map",
"type": "map",
"name": "오시는 길",
"locked": true,
"enabled": true,
"description": "지하철역 출구 및 발렛부스 위치"
},
{
"id": "weather",
"type": "weather",
"name": "날씨",
"locked": false,
"enabled": true,
"description": "현재 기온과 매장 주변 날씨"
},
{
"id": "local",
"type": "local",
"name": "주변 안내",
"locked": false,
"enabled": true,
"description": "청담 명품거리 및 갤러리 안내"
},
{
"id": "faq",
"type": "faq",
"name": "자주 묻는 질문",
"locked": false,
"enabled": true,
"description": "콜키지 정책, 알러지 케어, 주차 안내"
},
{
"id": "social",
"type": "social",
"name": "SNS 게시글",
"locked": false,
"enabled": false,
"description": "승인해 함께 발행한 소식 · 홈페이지 맨 아래"
}
]
},
"clinic": {
"name": "피부과 · 성형외과",
"subName": "의원 · 클리닉",
"description": "피부과, 성형외과, 미용 클리닉",
"channels": [
{
"id": "naver_place",
"name": "네이버 플레이스",
"checked": true
},
{
"id": "kakao_channel",
"name": "카카오톡 채널",
"checked": true
},
{
"id": "instagram",
"name": "인스타그램",
"checked": true
}
],
"defaultTemplate": "simple",
"templates": [
"simple",
"magazine"
],
"sections": [
{
"id": "hero",
"type": "hero",
"name": "히어로",
"locked": true,
"enabled": true,
"description": "병원 대표 이미지와 진료 분야"
},
{
"id": "intro",
"type": "intro",
"name": "병원 소개",
"locked": false,
"enabled": true,
"description": "진료 철학과 의료진 소개"
},
{
"id": "programs",
"type": "programs",
"name": "시술 안내",
"locked": false,
"enabled": true,
"description": "시술명, 소요 시간, 비용"
},
{
"id": "info",
"type": "info",
"name": "기본 정보",
"locked": true,
"enabled": true,
"description": "진료시간, 휴진일, 예약, 주차"
},
{
"id": "exhibition",
"type": "exhibition",
"name": "진료 안내",
"locked": false,
"enabled": true,
"description": "상담 절차와 보험 적용 안내"
},
{
"id": "photos",
"type": "photos",
"name": "사진 갤러리",
"locked": false,
"enabled": true,
"description": "진료실, 상담실, 대기 공간"
},
{
"id": "inquiry",
"type": "inquiry",
"name": "상담 문의",
"locked": false,
"enabled": true,
"description": "방문·전화 상담 접수"
},
{
"id": "map",
"type": "map",
"name": "오시는 길",
"locked": true,
"enabled": true,
"description": "역에서 오는 길과 주차장"
},
{
"id": "weather",
"type": "weather",
"name": "날씨",
"locked": false,
"enabled": false,
"description": "현재 기온과 주변 날씨"
},
{
"id": "local",
"type": "local",
"name": "주변 정보",
"locked": false,
"enabled": false,
"description": "주변 편의시설"
},
{
"id": "faq",
"type": "faq",
"name": "자주 묻는 질문",
"locked": false,
"enabled": true,
"description": "예약 변경, 회복 기간, 주의사항"
},
{
"id": "social",
"type": "social",
"name": "SNS 게시글",
"locked": false,
"enabled": false,
"description": "승인해 함께 발행한 소식 · 홈페이지 맨 아래"
}
]
}
}
}
+1
View File
@@ -5,3 +5,4 @@ export * from './lib/facts';
export * from './lib/section-data';
export * from './lib/section-prompts';
export * from './lib/color';
export * from './lib/catalog';
+46
View File
@@ -0,0 +1,46 @@
import catalog from '../data/templates.json';
import type {IndustryDef, IndustryType, LayoutId, TemplateDef} from '../types';
export type TemplateId = keyof typeof catalog.templates;
export const LAYOUT_IDS: readonly LayoutId[] = ['basic', 'paper'];
export const TEMPLATES = catalog.templates as Record<TemplateId, TemplateDef>;
export const INDUSTRIES = catalog.industries as Record<IndustryType, IndustryDef>;
export function isTemplateId(id: string): id is TemplateId {
return Object.hasOwn(TEMPLATES, id);
}
export function templateOf(id: string): TemplateDef {
if (!isTemplateId(id)) throw new Error(`등록되지 않은 템플릿: ${id}`);
return TEMPLATES[id];
}
export function industryTemplates(industry: IndustryType): TemplateId[] {
return INDUSTRIES[industry].templates as TemplateId[];
}
export function resolveTemplateId(industry: IndustryType, stored: string | null | undefined): TemplateId {
const id = stored?.trim() || INDUSTRIES[industry].defaultTemplate;
if (!INDUSTRIES[industry].templates.includes(id)) {
throw new Error(`${industry} 업종에서 쓸 수 없는 템플릿: ${id}`);
}
return id as TemplateId;
}
for (const [id, template] of Object.entries(TEMPLATES)) {
if (!LAYOUT_IDS.includes(template.layout)) {
throw new Error(`템플릿 ${id}의 레이아웃이 등록되지 않았다: ${template.layout}`);
}
}
for (const [industry, def] of Object.entries(INDUSTRIES)) {
for (const id of [def.defaultTemplate, ...def.templates]) {
if (!isTemplateId(id)) throw new Error(`${industry} 업종이 없는 템플릿을 가리킨다: ${id}`);
}
if (!def.templates.includes(def.defaultTemplate)) {
throw new Error(`${industry} 업종의 기본 템플릿이 허용 목록에 없다: ${def.defaultTemplate}`);
}
}
+52 -120
View File
@@ -1,22 +1,14 @@
/**
* 관리자 빌더(위저드 + 에디터)가 쓰는 화면 타입.
*
* SitePayload 와 다른 층이다 — 이쪽은 "사장님이 편집 중인 상태",
* SitePayload 는 "발행 잡이 구운 결과". 편집 상태는 저장 전까지 서버에 없다.
*/
/** 관리자 빌더(위저드 + 에디터)가 쓰는 화면 타입. */
export type IndustryType = 'stay' | 'cafe' | 'restaurant' | 'clinic';
export type TemplateTone = 'photo' | 'info' | 'book';
export type ViewportMode = 'pc' | 'tablet' | 'mobile';
export interface InfoField {
id: string;
label: string;
value: string;
/** 캔버스 미리보기용 축약문. intro/room_intro 원문이 길 때만 백엔드가 채워 보낸다(응답 전용,
* place_facts 에는 저장되지 않는다). 없으면 값이 짧거나 요약에 실패한 것 — 원문(value)으로 폴백한다. */
/** 캔버스 미리보기용 축약문. */
summary?: string;
/** 수집됐지만 사장님 확인이 필요한 값(백엔드 FactStatus.UNVERIFIED / PENDING_OWNER 대응). */
requiresVerification: boolean;
@@ -26,7 +18,7 @@ export interface InfoField {
source?: string;
placeholder?: string;
category?: string;
/** ★ 틀리면 예약 클레임이 나는 항목. 미검증이면 캔버스에서도 가린다. */
/** 틀리면 예약 클레임이 나는 항목. 미검증이면 캔버스에서도 가린다. */
critical?: boolean;
}
@@ -40,106 +32,68 @@ export interface SectionItem {
description?: string;
/** 사장님이 직접 편집하는 섹션 본문. 수집된 값과 분리해 자동 수집이 덮어쓰지 않는다. */
body?: string;
/**
* 붙여넣기 아이템(가요·일력·코스)의 원문 JSON.
*
* ★ 파싱해서 넣지 않고 **문자열 그대로** 둔다. 편집 중인 JSON 은 늘 깨져 있고,
* 파싱본만 들고 있으면 깨진 순간 사장님이 쓴 걸 잃는다.
*/
/** 붙여넣기 아이템(가요·일력·코스)의 원문 JSON. */
data?: string;
/**
* 이 섹션을 어떤 레이아웃으로 그릴지 — 사장님이 [디자인] 탭에서 고른 값.
* 비어 있으면 렌더러가 해당 타입의 기본 배리에이션으로 떨어진다(빈 화면을 만들지 않는다).
* 담기는 값은 배리에이션 레지스트리의 id (예: 'hero.editorial', 'faq.two-column').
*/
variantId?: string;
}
export interface TemplateItem {
export interface TemplateItem extends TemplateDef {
id: string;
industryId: IndustryType;
name: string;
tone: TemplateTone;
toneLabel: string;
description: string;
colors: {
primary: string;
secondary: string;
bg: string;
card: string;
text: string;
accent: string;
};
/** 사람에게 보이는 서체 이름('고딕' · '명조 제목'). 실제 서체는 look 이 정한다. */
fontStyle: string;
/**
* 실제로 화면을 가르는 값.
*
* ★ 예전엔 색 여섯 개뿐이라 템플릿을 바꿔도 색조만 달라졌다 — 다섯 개가 다 같아 보였다.
* 서체·모서리·테두리·그림자·여백이 여기 있고, 캔버스가 CSS 변수로 그대로 내려보낸다.
*/
look: TemplateLook;
/**
* 이 템플릿을 고르면 함께 들어오는 섹션(canvas/addable 의 타입).
*
* ★ 넣기만 하고 빼지 않는다. 템플릿을 이리저리 눌러보다 사장님이 넣어 둔 섹션이 사라지면
* 그게 템플릿 때문인 줄 모른다.
*/
defaultSectionTypes?: string[];
/**
* 이 템플릿에서 **꺼고 시작하는** 섹션(타입).
*
* ★ "넣기만 하고 빼지 않는다"(defaultSectionTypes)와 어긋나 보이지만 다른 일이다 —
* 여기는 **지우지 않는다.** 목록에 그대로 남고 사장님이 한 번 눌러 되살린다.
* 지워서 없어지는 것과, 꺼진 채로 보이는 것은 사장님이 겪는 일이 다르다.
* ★ 왜 필요한가: 시안(`/s/stay`)의 옛 항구는 예약 안내가 없다. 오래된 항구 도시의
* 인상으로 묵는 곳을 보여주는 템플릿이라 실시간 예약 창구를 첫 화면에 세우지 않는다.
* `defaultSectionTypes` 로는 켤 수만 있어서 이 선택을 표현할 자리가 없었다.
*/
disabledSectionTypes?: string[];
/**
* 섹션 타입 → 배리에이션 id. 템플릿이 고르는 "그 섹션의 모양".
*
* ★ 시안의 사진 갤러리는 캐러셀(`photos.carousel`)이다. 색·서체만 템플릿을 따르고
* 섹션 모양은 늘 기본이면, 템플릿을 골라도 시안과 같은 화면이 안 된다.
* ★ 사장님이 이미 고른 배리에이션은 덮지 않는다 — 템플릿을 눌러 보다가 자기 선택이
* 사라지면 그게 템플릿 때문인 줄 모른다(`defaultSectionTypes` 와 같은 이유).
* ★ 발행본은 아직 이 값을 해석하지 않는다(`site/pages/HomePage.tsx`). 지금 달라지는 것은
* 에디터 캔버스뿐이고, 발행본까지 가려면 배리에이션을 렌더러로 옮기는 별도 작업이 필요하다.
*/
defaultVariants?: Record<string, string>;
}
/**
* 템플릿의 생김새. 값은 전부 CSS 에 그대로 들어가는 문자열이다 —
* 숫자로 들고 있다가 쓰는 쪽에서 단위를 붙이면, 빠뜨린 곳이 조용히 0 이 된다.
*/
export interface TemplateColors {
primary: string;
secondary: string;
bg: string;
card: string;
text: string;
accent: string;
}
// 값은 CSS에 그대로 들어가는 문자열이다(단위 포함).
export interface TemplateLook {
/** 제목 서체 스택. `--tpl-font-heading` */
fontHeading: string;
/** 본문 서체 스택. `--tpl-font-body` */
fontBody: string;
/** 모서리. Tailwind 의 `--radius-*` 를 캔버스 안에서만 덮어 rounded-* 전부가 따라온다. */
radius: string;
/** 카드·패널 테두리 두께. */
borderWidth: string;
/** 카드 그림자. Tailwind 의 `--shadow-*` 를 덮는다. 'none' 이면 평평해진다. */
shadow: string;
/** 제목 자간. */
headingTracking: string;
/** 제목 굵기. 간판체처럼 한 굵기뿐인 서체는 400 이어야 한다. */
// 간판체처럼 굵기가 한 벌뿐인 서체는 400이어야 가짜 볼드가 안 생긴다.
headingWeight: string;
/** 섹션 세로 여백. 이 값 하나로 페이지의 호흡이 바뀐다. */
sectionSpace: string;
/**
* 바탕 질감. CSS `background-image` 값 그대로다(갱지 결·격자).
*
* ★ 색·서체만으로는 '인쇄물'이 안 된다. 레트로의 정체성 절반이 이 갱지 결이라
* 토큰으로 내려보낸다 — 없는 템플릿은 이 칸을 비우면 그만이다.
*/
texture?: string;
}
export type LayoutId = 'basic' | 'paper';
export interface TemplateDef {
name: string;
tag: string;
description: string;
layout: LayoutId;
colors: TemplateColors;
look: TemplateLook;
addSections: string[];
}
export interface IndustrySection {
id: string;
type: string;
name: string;
locked: boolean;
enabled: boolean;
description: string;
}
export interface IndustryDef {
name: string;
subName: string;
description: string;
channels: {id: string; name: string; checked: boolean}[];
defaultTemplate: string;
templates: string[];
sections: IndustrySection[];
}
export interface PhotoItem {
id: string;
url: string;
@@ -155,13 +109,7 @@ export interface FaqItem {
answer: string;
}
/**
* Slate 문서 노드.
*
* 업종 시드의 `editor_script`(예약 문의 대화 예시)가 이 모양이다.
* 렌더러(SlateScriptRenderer)와 데이터가 같은 타입을 봐야
* "children 에 뭐가 들어올지 모르는" 상태가 안 생긴다.
*/
/** Slate 문서 노드. */
export interface SlateTextNode {
text: string;
bold?: boolean;
@@ -180,12 +128,7 @@ export interface SlateElementNode {
export type SlateNode = SlateElementNode | SlateTextNode;
/**
* 업종 고유 목록의 한 줄(객실 · 메뉴 · 코스 · 프로그램).
*
* 업종마다 채우는 칸이 달라 전부 선택값이다 — 없는 칸은 화면에서 그냥 빠진다.
* (숙박은 size/spec, 카페는 tag, 피부과·성형외과는 duration/target 을 쓴다.)
*/
/** 업종 고유 목록의 한 줄(객실 · 메뉴 · 코스 · 프로그램). */
export interface IndustryListItem {
name: string;
desc?: string;
@@ -197,12 +140,7 @@ export interface IndustryListItem {
target?: string;
}
/**
* 업종별 부가 데이터.
*
* `Record<string, unknown>` 로 두면 쓰는 쪽마다 캐스팅이 필요하고,
* 캐스팅은 틀려도 컴파일이 통과한다. 실제로 들어오는 키만 적어 둔다.
*/
/** 업종별 부가 데이터. */
export interface IndustryCustomData {
/** 숙박 — 객실 목록 */
rooms?: IndustryListItem[];
@@ -218,14 +156,7 @@ export interface IndustryCustomData {
editor_script?: SlateNode[];
}
/**
* 업종 설정.
*
* ★ **구조만** 담는다. 상호·주소·소개문·정보표·사진·FAQ·메뉴 같은 콘텐츠 시드는 전부 지웠다.
* 그 값들이 있던 시절에는 아직 아무 가게도 고르지 않은 화면이 가공의 업소로 가득 찼고
* ('달빛스테이 제주', '포레스트 힐 로스터스'), 사장님은 그걸 자기 가게 내용으로 읽고
* 그대로 발행했다. 콘텐츠의 출처는 서버(fact · unit · faq · media) 하나뿐이다.
*/
/** 업종 설정. */
export interface IndustryData {
id: IndustryType;
name: string;
@@ -233,5 +164,6 @@ export interface IndustryData {
description: string;
channels: { id: string; name: string; checked: boolean }[];
sections: SectionItem[];
defaultTemplate: string;
templates: TemplateItem[];
}
+22 -157
View File
@@ -1,4 +1,4 @@
import type {TemplateLook} from './builder';
import type {TemplateColors, TemplateLook} from './builder';
import type {
FactStatus,
LinkChannel,
@@ -7,17 +7,7 @@ import type {
SourceType,
} from './domain';
/**
* SitePayload — 발행 사이트 렌더러(`site/`)의 유일한 입력.
*
* 백엔드의 BUILD 잡이 이 JSON 을 만들어 넘기고, `site/scripts/prerender.ts` 가
* 그걸로 정적 HTML 을 굽는다. 렌더러는 이 타입 밖의 것을 절대 모른다 —
* DB 도, API 도, 로그인도 모른다. 그래서 같은 payload 면 항상 같은 HTML 이 나온다.
*
* ★ 이 payload 는 "이미 게이트를 통과한 것"이 아니다. fact 마다 status 가 그대로 실려 온다.
* 노출 필터링은 렌더러가 `selectPublishable()` 로 한 번 더 한다 —
* 백엔드 게이트가 뚫려도 미검증 값이 화면·JSON-LD 로 새지 않게 하는 2중 방어다.
*/
/** SitePayload — 발행 사이트 렌더러(`site/`)의 유일한 입력. */
export interface SitePayload {
/** 스키마 버전. 렌더러가 모르는 버전이면 빌드를 실패시킨다(조용히 반쪽 렌더하지 않는다). */
schemaVersion: 1;
@@ -41,17 +31,11 @@ export interface SitePayload {
/** 주요 거점까지의 이동 시간. */
routes: RouteEntry[];
/**
* 이 숙소의 노래. 발행할 때마다 한 곡 만든다(가사 Gemini → 작곡 Suno).
*
* ★ 발행이 노래를 기다리므로 발행본에는 보통 한 곡이 실려 있다. 그래도 빌 수 있다 —
* 키가 없거나(SUNO_API_KEY) 작곡이 실패하면 **노래 없이** 발행한다(발행을 막지는 않는다).
* 렌더러는 비면 플레이어를 아예 그리지 않는다.
*/
/** 이 숙소의 노래. */
songs: SongTrack[];
/** 미니 블로그 글. 전부 HTML 에 들어가고 화면이 나눠 보여준다(docs/MINI_BLOG.md). */
posts?: PostEntry[];
/** 검수를 통과한 이용 후기. 별점은 없다(2026-09-16 회의). */
/** 검수를 통과한 이용 후기. 별점은 없다. */
reviews?: ReviewEntry[];
/** 같은 원고의 발행된 사본. 고유 콘텐츠·SEO 메타의 근거로 세지 않는다. */
socialPosts?: SocialPostItem[];
@@ -62,12 +46,7 @@ export interface SitePayload {
/** 템플릿 — 색/서체/섹션 순서. 관리자 에디터가 정한 값이 그대로 온다. */
theme: SiteTheme;
/**
* 검색 키워드 — SiteOntology 가 고르고 백엔드가 **이 가게 자료로 거른** 것(services/seo_keywords).
*
* ★ 선택 필드다. 옛 payload·목업·SiteOntology 가 꺼진 빌드에는 없고, 그때 제목·메타는 예전 그대로 나간다.
* 필드를 더했을 뿐 기존 모양은 그대로라 schemaVersion 은 올리지 않는다.
*/
/** 검색 키워드 — SiteOntology 가 고르고 백엔드가 **이 가게 자료로 거른** 것(services/seo_keywords). */
seo?: SiteSeo;
}
@@ -87,7 +66,6 @@ export interface ReviewEntry {
export interface SiteSeo {
/** `<meta name="keywords">` 로 나간다. SiteOntology 융합 순위 그대로, 최대 10개. */
keywords: string[];
/** 제목의 업종어 자리(`<상호> · <이 값>`). 시·군 이름을 품은 유형 키워드. 없으면 예전 제목. */
titleKeyword?: string;
}
@@ -105,13 +83,7 @@ export interface SiteMeta {
updatedAt: string;
/** 사이트 버전. 빌드 산출물 캐시 무효화 키이자 `out/versions/<slug>/<version>/` 산출 경로. */
version: number;
/**
* 이 렌더가 **공개 주소(`/s/<slug>`)를 이 버전으로 넘겨도 되는가**.
*
* ★ false(미리보기·재빌드)면 렌더러가 `out/versions/<slug>/<version>/` 에만 굽고
* 공개 심볼릭 링크는 건드리지 않는다 — 방문자는 계속 직전 버전을 본다.
* BUILD 잡의 `publish=false` 가 그대로 여기로 온다(services/site_payload._publish_target).
*/
/** 이 렌더가 **공개 주소(`/s/<slug>`)를 이 버전으로 넘겨도 되는가**. */
publish: boolean;
}
@@ -151,9 +123,7 @@ export interface LegalInfo {
licenseLabel?: string;
}
/**
* fact 한 건. 업종 스키마(`common/category_schema`)의 필드 정의가 label/unit/critical 을 준다.
*/
/** fact 한 건. */
export interface FactEntry {
key: string;
label: string;
@@ -166,7 +136,7 @@ export interface FactEntry {
status: FactStatus;
sourceType: SourceType;
sourceUrl?: string | null;
/** ★ 틀리면 헛걸음·예약 클레임이 나는 항목. 미검증이면 절대 노출하지 않는다. */
/** 틀리면 헛걸음·예약 클레임이 나는 항목. 미검증이면 절대 노출하지 않는다. */
critical: boolean;
required: boolean;
/** scope=unit 인 fact 가 어느 단위에 속하는지. */
@@ -194,7 +164,7 @@ export interface MediaItem {
width?: number;
height?: number;
isPrimary?: boolean;
/** ★ 이미지 재게시 권리(DECISIONS 1-2)가 결론 날 때까지 출처를 보존한다. */
/** 이미지 재게시 권리(DECISIONS 1-2)가 결론 날 때까지 출처를 보존한다. */
sourceType: SourceType;
originUrl?: string | null;
unitId?: string | null;
@@ -240,24 +210,9 @@ export interface LocalContents {
attractions: LocalPlace[];
restaurants: LocalPlace[];
festivals: FestivalEntry[];
/**
* 업장 좌표로 **서버가 조립한** 추천 일정(1박2일·2박3일).
*
* ★ 사장님이 붙여넣는 아이템(`theme.sections[].data`)과 자리를 나눈다 — 이건 우리가
* 만든 값이라 payload 의 서버 영역에 둔다. 화면은 사장님 값을 먼저 보고, 없을 때
* 이걸 쓴다(`ItinerarySection`).
* ★ 저장하지 않는다. 재료(주변 정보)가 갱신되면 다음 빌드에서 저절로 최신이 된다.
*/
/** 업장 좌표로 **서버가 조립한** 추천 일정(1박2일·2박3일). */
itineraries?: ItineraryItem[];
/**
* 지역 이야기 — 서버가 지역 단위로 생성한 가요·일력·인물·연표·읽기·엽서·퀴즈.
*
* ★ 사장님이 붙여넣는 같은 종류의 JSON(`theme.sections[].data`)과 **모양이 같다.**
* 화면은 둘을 한 배열로 이어 그린다(`StorySection`) — 사장님 값이 앞이다.
* 그래서 여기 항목을 다른 모양으로 바꾸면 안 된다(`site_payload._local` 주석).
* ★ 왜 업장이 아니라 여기인가: 군산 이야기는 군산 숙소가 같이 쓴다. 업장별로 복제하면
* 같은 곡 목록이 사이트 수만큼 생긴다(`area_contents` 가 region_code 를 키로 두는 이유).
*/
/** 지역 이야기 — 서버가 지역 단위로 생성한 가요·일력·인물·연표·읽기·엽서·퀴즈. */
story?: LocalStories;
/** 지역 정보를 마지막으로 갱신한 시각. 화면에 그대로 노출한다(오래된 정보를 숨기지 않는다). */
syncedAt?: string;
@@ -274,18 +229,7 @@ export interface LocalStories {
quiz?: QuizItem[];
}
/**
* 기온을 다섯으로 가른다 — **밖에서 뭘 할 수 있느냐**가 갈리는 단위다.
*
* ★ 하늘(mood)과 따로 두는 이유: 같은 '맑음' 이라도 34도의 맑음과 3도의 맑음은
* 손님이 할 수 있는 일이 정반대다. 여름 맑음에 "골목을 걸어 보세요"라고 쓰면
* 폭염에 손님을 내보내는 문장이 된다.
* ★ 경계는 관광 기준이다(기상특보 기준이 아니다).
* 30 — 낮 골목 산책이 무리가 되는 선. 33도(폭염주의보)는 이미 늦다.
* 25 — 바다·물놀이가 답이 되는 선.
* 20 — 하루 종일 걸어도 되는 구간의 아래끝.
* 10 — 실외에서 오래 서 있기 어려워지는 선.
*/
/** 기온을 다섯으로 가른다 — **밖에서 뭘 할 수 있느냐**가 갈리는 단위다. */
export type WeatherBand = '혹서' | '더움' | '선선' | '쌀쌀' | '추움';
/** 날씨를 넷으로만 가른다 — 문장과 그림이 갈리는 최소 단위다. */
@@ -326,28 +270,11 @@ export interface WeatherSnapshot {
condition: string;
/** 날씨에 따른 안내 문구. LLM 문장이므로 사실 주장(가격·시간)을 담지 않는다. */
note?: string;
/**
* 날씨별 한 줄.
*
* ★ `note` 한 칸으로는 안 된다 (2026-09-04, 사장님: "저렇게만 말고 콘텐츠가 있어야")
* 발행본은 정적이라 굽는 순간의 문장이 박히는데, 날씨는 브라우저에서 갱신된다.
* 비 오는 날 "마당에 앉기 좋습니다"가 뜨는 사고가 난다. 그래서 **조건별로 미리 적어 두고**
* 화면이 지금 날씨에 맞는 것을 고른다.
* ★ 사장님이 자기 집을 두고 쓰는 문장이다 — 날씨 예보가 아니다.
*/
/** 날씨별 한 줄. */
notes?: Partial<Record<WeatherMood, string>>;
noteSets?: Partial<Record<WeatherSky, string[]>>;
tempNoteSets?: Partial<Record<WeatherBand, string[]>>;
/**
* 기온대별 한 줄 — **오늘 이 동네에서 뭘 하면 되나.**
*
* ★ `notes` 와 갈라 둔다 (2026-09-09, 사장님: "기온에 따라서 문구 다르게, 펜션지역의 관광에 맞춰")
* `notes` 는 하늘을 보고 **집 안에서** 뭘 할지 적은 문장이고(마당·CAFÉ·기와),
* 이쪽은 기온을 보고 **밖에서** 어디를 갈지 적은 문장이다. 축이 둘이라 한 칸에
* 담으면 4×5 스무 문장을 사장님이 적어야 한다 — 두 줄로 나란히 내면 넷+다섯이면 된다.
* ★ 여기 적는 곳은 이 사이트에 **이미 있는 자리**여야 한다(주변 안내·축제).
* 화면에 없는 곳을 날씨 칸에서만 권하면 손님이 그걸 찾을 데가 없다.
*/
/** 기온대별 한 줄. */
tempNotes?: Partial<Record<WeatherBand, string>>;
observedAt: string;
}
@@ -359,22 +286,11 @@ export interface LocalPlace {
location?: string;
/** 업장 좌표 기준 거리("850m"/"1.2km"). 지역 캐시에서 온 항목엔 없을 수 있다. */
distanceText?: string;
/**
* 업장 좌표 기준 거리(m).
*
* ★ 사람이 읽는 `distanceText` 와 따로 싣는다 — 화면이 도보 시간 필터(분속 80m 환산)를
* 계산하려면 숫자가 필요하고, "1.2km" 를 화면이 다시 파싱하면 백엔드와 규칙이 갈린다.
*/
/** 업장 좌표 기준 거리(m). */
distanceMeters?: number;
durationText?: string;
description?: string;
/**
* 대표 사진.
*
* ★ 이 칸이 없어서 주변 안내가 이름만 적힌 상자였다 — 아무도 보지 않는다.
* ★ 우리가 찾아 붙이는 사진이 아니다. 출처(공공데이터)가 그 장소의 사진으로 준 것만 싣고,
* **저작권 유형이 상업적 이용을 막는 건은 수집 단계에서 뺀다**(services/external/tour_places).
*/
/** 대표 사진. */
imageUrl?: string;
/** 외부 검색으로 보내는 질의어. 우리가 지어낸 URL 을 링크하지 않는다. */
searchQuery: string;
@@ -388,11 +304,7 @@ export interface FestivalEntry {
description?: string;
officialUrl?: string;
searchQuery: string;
/**
* 봄·여름·가을·겨울. 축제를 계절로 묶어 보여주려면(FestivalSection) 화면이 날짜를
* 다시 계절로 환산해야 하는데, 그 규칙이 렌더러에 생기면 수집 쪽과 갈라진다.
* 시작일에서 한 번만 정해 payload 에 싣는다. 비어 있으면 계절을 타지 않는 행사로 본다.
*/
/** 봄·여름·가을·겨울. */
season?: string;
/** 시작·종료일(YYYY-MM-DD). `period` 는 사람이 읽는 문구라 기계가 못 읽는다 — 정렬·계절 산출의 근거. */
startDate?: string;
@@ -433,12 +345,7 @@ export interface SongTrack {
/** 장르·분위기(Suno 에 넘긴 값). */
style?: string | null;
durationSec?: number | null;
/**
* 재생 주소. **우리 쪽 경로**다(`/s/<slug>/<파일>`).
*
* ★ Suno 가 준 주소를 그대로 쓰지 않는다 — 만료되는 주소라, 발행 직후에는 재생되고
* 몇 주 뒤 조용히 죽는다. 백엔드가 파일을 받아 두고 프리렌더가 사이트로 복사한다.
*/
/** 재생 주소. */
audioUrl: string;
/** 프리렌더가 원본을 찾을 때 쓰는 파일명. 렌더러는 쓰지 않는다. */
fileName?: string;
@@ -446,61 +353,19 @@ export interface SongTrack {
export interface SiteTheme {
templateId: string;
colors: {
primary: string;
secondary: string;
bg: string;
card: string;
text: string;
accent: string;
};
fontStyle: string;
/**
* 템플릿의 생김새 — 서체 · 모서리 · 테두리 두께 · 그림자 · 섹션 여백.
*
* ★ 이 필드가 없던 동안 발행본은 **색만** 템플릿을 따랐다. 사장님이 레트로(간판체)를 골라도
* 발행 페이지는 늘 같은 고딕·명조로 나갔다 — 캔버스와 발행본이 다르게 보이는 가장 큰 이유였다.
* ★ 값은 전부 CSS 에 그대로 들어가는 문자열이다(`TemplateLook`). 렌더러는 이걸 `--tpl-*` 로
* 내려보내기만 한다. 비어 있으면 렌더러 기본 서체로 떨어진다 — 화면이 깨지지 않는다.
*/
look?: TemplateLook;
/** 섹션 순서와 노출 여부. 관리자 에디터의 좌측 패널이 만든 결과 그대로. */
colors: TemplateColors;
look: TemplateLook;
sections: SectionSetting[];
}
export interface SectionSetting {
id: string;
/** 사장님이 붙인 섹션 제목. 발행본의 소제목이 이 값을 따른다. */
name: string;
enabled: boolean;
/** SEO·필수 마크업 때문에 끌 수 없는 섹션. */
locked: boolean;
/**
* 사장님이 [디자인] 탭에서 고른 레이아웃(배리에이션 레지스트리 키, 예: 'hero.editorial').
*
* ★ 이 필드가 없던 동안, 에디터에서 고른 배리에이션은 payload 경계에서 통째로 버려졌다 —
* 40개를 고를 수 있는데 발행본은 언제나 같은 한 벌로 나갔다.
* ★ 비어 있으면 렌더러가 그 섹션의 기본 레이아웃으로 떨어진다(화면이 깨지지 않는다).
* 렌더러가 모르는 키를 만나도 마찬가지다 — 서버는 값을 해석하지 않고 그대로 싣는다.
*/
variantId?: string;
/**
* 사장님이 에디터에서 직접 쓴 섹션 본문.
*
* ★ variantId 와 같은 사연이다 — 이 필드가 없던 동안 캔버스에 쓴 소개문은 payload 경계에서
* 버려졌다. 저장(sites.theme)은 되는데 발행본에 안 나왔고, 고유 콘텐츠로도 세지 않아
* "소개를 썼는데 고유 콘텐츠 0건으로 발행이 막힌다" 가 됐다.
* ★ 줄바꿈이 문단 구분이다. 렌더러가 빈 줄을 기준으로 <p> 를 나눈다.
*/
// 사장님이 쓴 본문.
body?: string;
/**
* 붙여넣기 아이템(가요·일력·승차권·인물…)의 원문 JSON.
*
* ★ body·variantId 와 같은 사연이다 — 이 필드가 없으면 사장님이 붙여넣은 곡 목록이
* payload 경계에서 버려져 빌더에서는 보이는데 발행본에는 없다.
* ★ **문자열 그대로** 싣는다. 서버는 파싱하지 않는다 — 렌더러가 `parseSectionData()`
* (shared/lib/section-data.ts)로 읽고, 깨진 JSON 이면 그 섹션만 조용히 비운다.
*/
// 붙여넣기 아이템 원문 JSON.
data?: string;
}