Phase 1.1: 프로젝트 생성 — 폼 기반 도메인 선택 + 인라인 JSON 생성

백엔드 (crawler_platform/app/api/routes.py):
- POST /projects/inline 추가: 파일 시스템 의존 없이 JSON 본문으로 ProjectConfig 인라인 생성
  - CreateProjectInlineRequest + InlineSourceConfig Pydantic 모델
- GET /domains 추가: 미리 정의된 도메인 목록 (perfume, tea, coffee, candle, supplement, gift)
  - 각 도메인의 entity_types, predicates, attribute_count 반환

프론트엔드 API 레이어 (src/lib/api/):
- domains.ts: domainsApi.list + Zod 스키마
- ontology.ts: ontologyApi.get(domain) + Zod 스키마
- projects.ts: createInline() 메서드 + CreateProjectInlineRequest 타입

TanStack Query 훅 (src/hooks/):
- useDomains: 도메인 목록 (30분 staleTime)
- useOntology(domain): 도메인 상세
- useCreateProjectInline: 인라인 생성 mutation + projects 캐시 무효화
- queryKeys에 domains, ontology 키 팩토리 추가

UI 프리미티브 (src/components/ui/):
- input.tsx, label.tsx, textarea.tsx

OnboardingPage 완전 교체 (src/pages/OnboardingPage.tsx):
- react-hook-form + zod 검증 (project_name 정규식, 도메인 필수)
- 도메인 카드 그리드 선택 (entity/predicate 개수 미리보기)
- 백엔드 /projects/inline POST → 성공 시 sonner 토스트 + /sources/{name}으로 이동
- 로딩/에러/재시도 UI

기타:
- Vite proxy에 /domains prefix 추가
- i18n locale 키 onboarding.* 추가 (한/영)

다음 단계: Phase 1.2 — 온톨로지 엔티티/클레임 직접 입력 + URL 추출

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
lasta
2026-05-14 14:46:03 +09:00
parent 37cad40472
commit 8681ac8ed3
15 changed files with 474 additions and 32 deletions

View File

@@ -5,7 +5,7 @@
},
"nav": {
"dashboard": "Dashboard",
"onboard": "Upload Ontology",
"onboard": "New Project",
"sources": "Sources",
"crawl": "Crawl",
"review": "Review",
@@ -23,6 +23,18 @@
"hint": "Create your first project to start building an ontology"
}
},
"onboarding": {
"title": "Create New Project",
"formTitle": "Choose Ontology Domain",
"formDesc": "Pick the domain of ontology you want to build and give your project a name.",
"projectName": "Project Name",
"projectNameHint": "Letters, digits, _ and - only (2~64 chars)",
"domain": "Domain",
"domainSummary": "{{entities}} entity types · {{predicates}} predicates",
"submit": "Create Project",
"created": "Project created: {{name}}",
"createFailed": "Create failed: {{msg}}"
},
"common": {
"retry": "Retry",
"cancel": "Cancel",

View File

@@ -5,7 +5,7 @@
},
"nav": {
"dashboard": "대시보드",
"onboard": "온톨로지 업로드",
"onboard": "프로젝트 생성",
"sources": "참고 소스",
"crawl": "크롤 진행",
"review": "결과 검토",
@@ -23,6 +23,18 @@
"hint": "첫 프로젝트를 만들어 온톨로지 구축을 시작하세요"
}
},
"onboarding": {
"title": "새 프로젝트 만들기",
"formTitle": "온톨로지 도메인 선택",
"formDesc": "어떤 종류의 온톨로지를 구축할지 도메인을 선택하고 프로젝트 이름을 정해주세요.",
"projectName": "프로젝트 이름",
"projectNameHint": "영문, 숫자, _ , - 만 사용 (2~64자)",
"domain": "도메인",
"domainSummary": "엔티티 {{entities}}종 · 관계 {{predicates}}개",
"submit": "프로젝트 만들기",
"created": "프로젝트가 생성되었습니다: {{name}}",
"createFailed": "생성 실패: {{msg}}"
},
"common": {
"retry": "다시 시도",
"cancel": "취소",