Implemented Resume upload feature, Fixes #43#61
Implemented Resume upload feature, Fixes #43#61Kmadhav824 merged 5 commits intoshivamxverma:mainfrom
Conversation
|
@Kmadhav824 is attempting to deploy a commit to the Shivam verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Adds an optional “resume context” flow so interview questions can be tailored to a candidate’s extracted resume text, end-to-end from UI upload/parsing through backend validation and prompt construction.
Changes:
- Extend the interview-question generation request to include optional
resumeContextand validate it server-side. - Add client-side resume parsing (PDF/TXT) + a resume upload UI component, and plumb the extracted text into the interview session payload.
- Update the interview prompt to conditionally include the resume profile and tailor questions accordingly.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/src/api/interview/interview-types.ts | Adds optional resumeContext to the request type. |
| backend/src/api/interview/interview-service.ts | Injects the resume text into the LLM prompt with a defensive char cap and tailoring instruction. |
| backend/src/api/interview/interview-schema.ts | Adds Yup validation for resumeContext length. |
| Frontend/src/views/interview/InterviewPage.jsx | Wires resume state/handlers through to selection/ready steps. |
| Frontend/src/components/Interview/useInterviewSession.js | Stores resume parsing state + includes resumeContext in the API payload when present. |
| Frontend/src/components/Interview/InterviewSelectionStep.jsx | Adds a Resume section with upload UI; updates focus hint copy. |
| Frontend/src/components/Interview/InterviewReadyStep.jsx | Shows a “resume loaded” indicator on the ready screen. |
| Frontend/src/components/Interview/ResumeUploadField.jsx | New upload/drop-zone UI that parses files client-side and reports extracted text. |
| Frontend/src/utils/resumeParser.js | New resume parsing utility using pdfjs-dist for PDFs and FileReader for TXT. |
| Frontend/src/views/interview/components/ResumeUploadField.jsx | Adds a second ResumeUploadField implementation under views/ (appears unused/duplicative). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const processFile = useCallback( | ||
| async (file) => { | ||
| if (!file) return; | ||
| setParseError(''); | ||
| setIsParsing(true); | ||
| try { | ||
| const result = await parseResume(file); | ||
| setFileName(file.name); |
| ${isParsing ? 'pointer-events-none opacity-60' : ''} | ||
| `} | ||
| onClick={() => inputRef.current?.click()} | ||
| onKeyDown={(e) => (e.key === 'Enter' || e.key === ' ') ? inputRef.current?.click() : undefined} |
| <div className="text-[10px] text-gray-600 border border-white/[0.06] bg-white/[0.02] rounded-full px-3 py-1 font-medium tracking-wide"> | ||
| 🔒 Parsed locally — nothing uploaded to a server | ||
| </div> |
| icon="✨" | ||
| label="Focus Areas" | ||
| hint="e.g. System design tradeoffs, React hooks, conflict resolution." | ||
| hint="e.g. System design tradeoffs, React hooks, conflict resolution. Leave blank — the AI will draw from your resume." |
| const resumeLine = resumeContext?.trim() | ||
| ? `\nCANDIDATE RESUME PROFILE:\n${resumeContext.slice(0, MAX_RESUME_CHARS)}\n\nIMPORTANT: Use the resume profile above to personalise the questions. Reference specific technologies, projects, or experiences mentioned. Prioritise gaps or depth opportunities visible in the resume.` |
| // Build the resume section only when provided; cap defensively to avoid runaway tokens. | ||
| const MAX_RESUME_CHARS = 3500; | ||
| const resumeLine = resumeContext?.trim() | ||
| ? `\nCANDIDATE RESUME PROFILE:\n${resumeContext.slice(0, MAX_RESUME_CHARS)}\n\nIMPORTANT: Use the resume profile above to personalise the questions. Reference specific technologies, projects, or experiences mentioned. Prioritise gaps or depth opportunities visible in the resume.` | ||
| : ''; |
| @@ -0,0 +1,194 @@ | |||
| import React, { useRef, useState, useCallback } from 'react'; | |||
| import { parseResume } from '../../utils/resumeParser.js'; | |||
| * resumeParser.js | ||
| * Client-side resume text extraction. | ||
| * Supports PDF (via pdf.js) and plain-text (.txt) files. | ||
| * All processing is in-browser — nothing is uploaded to a server. |
| export async function parseResume(file) { | ||
| if (!file) throw new Error('No file provided.'); | ||
|
|
||
| const ext = file.name.split('.').pop()?.toLowerCase(); | ||
| let raw = ''; | ||
|
|
||
| if (ext === 'pdf') { | ||
| raw = await extractFromPdf(file); | ||
| } else if (ext === 'txt') { |
There was a problem hiding this comment.
@copilot apply changes based on this feedback
|
@Kmadhav824 currently there is an issue with this branch can you check once and try to resolve it |
Resume upload feature was implemented