CV Processing
CV processing is a core frontend feature spanning upload, AI extraction, face photo extraction, manual editing (CV builder), and structured data mutations.
Upload and Extraction Pipeline
Upload Flow
The useCvUploadAndParse hook orchestrates the two-step process:
- Upload -- File is sent to background-tasks via GraphQL mutation
- Parse -- AI extraction begins automatically after upload
State: isUploading → isParsing → complete (CVParseResult)
Returns structured data: firstName, lastName, email, skills, experiences, education. Timeout: 5 minutes.
Real-Time Extraction
The useCvExtractionGraphQL hook uses a GraphQL subscription for real-time progress:
Input: CVExtractionInput { fileUrl, sequential }
Events: progress updates → structured CV data
Output: contact info, skills (with proficiency), experiences, education, languages
Skill proficiency levels: BASIC, INTERMEDIATE, ADVANCED, EXPERT.
Components:
| Component | File | Purpose |
|---|---|---|
| CVExtractor | components/cv/CVExtractor.tsx | Main extraction interface |
| ContextCVExtractor | components/cv/ContextCVExtractor.tsx | Context-aware extractor |
| CVUploadStep | components/cv/CVUploadStep.tsx | Upload step in CV builder |
| ProcessingIndicator | components/cv/ProcessingIndicator.tsx | Extraction progress display |
| ConnectionStatus | components/cv/ConnectionStatus.tsx | WebSocket connection indicator |
| DebugPanel | components/cv/DebugPanel.tsx | Development-only debug panel |
Face Extraction
The useFaceExtraction hook extracts profile photos from CV documents:
Input: FaceExtractionInput { id, fileUrl, originalFilename }
States: idle → processing → completed / failed
Output: FaceExtracted with face image data
Component: FaceExtractionDisplay.tsx renders the extracted face.
CV Builder
The CV builder is a multi-step form backed by CVBuilderContext:
Context state:
- Personal info (name, email, phone, links)
- Skills (with proficiency levels)
- Work experiences
- Education
- Portfolio links
isFromExtractionflag (distinguishes AI-uploaded vs manually entered)
Key components:
| Component | File | Purpose |
|---|---|---|
| ProfileForm | components/cv/ProfileForm.tsx | Main profile editing form (33KB) |
| ProfileBuilderStep | components/cv/ProfileBuilderStep.tsx | Step in the builder wizard |
| StepFooter | components/cv/StepFooter.tsx | Step navigation (back/next) |
| StepSidebar | components/cv/StepSidebar.tsx | Step progress indicator |
Structured CV Mutations
The useStructuredCvMutations hook is the central CV save orchestrator. It uses a diff algorithm to determine what changed and sends parallel mutations:
- Computes diffs: items added, updated, or removed
- Maps form data to mutation input types
- Sends parallel mutations for: profile, work experiences, education, certifications, languages
- Provides transaction-like behavior (all-or-nothing intent)
See Structured CV Migration for the full field reference and migration guide.
Related Hooks
| Hook | Purpose |
|---|---|
useCvUploadAndParse | Upload + parse orchestration |
useCvExtractionGraphQL | Subscription-based extraction |
useCvProcessorGraphQL | CV processing via subscription |
useCvManager | CV lifecycle CRUD operations |
useCvWithFaceExtraction | Combined CV + face extraction |
useFaceExtraction | Standalone face extraction |
useStructuredCvMutations | Diff-based save orchestrator |
useCreateCv | Create new CV from scratch or template |