Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nayalsaurav/resume-analyzer/llms.txt
Use this file to discover all available pages before exploring further.
Upload is a self-contained client component that houses the entire resume submission workflow — from the input form through the loading state to the results display. It owns all form state internally, orchestrates the call to the analyzeResume server action, and swaps between three distinct UI states depending on where the user is in the analysis flow.
Import & Usage
Upload takes no props and can be dropped directly into any page component.
Internal State
All state is managed locally inside the component withuseState. There are no external stores or props required.
| State | Type | Description |
|---|---|---|
isProcessing | boolean | true while the AI analysis request is in flight |
statusText | string | Current status message displayed during the processing state |
file | File | null | The currently selected resume file; null when no file has been chosen |
errors | FormErrors | Per-field validation error messages keyed by field name |
feedback | Feedback | null | The AI analysis result returned by analyzeResume; null until analysis completes |
FormErrors interface covers all four user-facing fields:
Form Fields
The form collects four pieces of information before analysis can begin.The name of the company the candidate is applying to. Used by Gemini AI to tailor feedback to the employer context. Required — validation fails if empty.
The title of the role being applied for (e.g. “Senior Frontend Engineer”). Required — validation fails if empty.
The full job description text. Must be at least 50 characters to give the AI sufficient context for a meaningful comparison against the resume.
The candidate’s resume file. Accepted formats: PDF, DOC, and DOCX (enforced via the
accept attribute on the file input). Maximum size: 10 MB.UI States
The component renders one of three mutually exclusive states at a time:Form Submission Flow
When the user submits the form,handleSubmit executes the following steps in order:
- Validate all fields client-side; populate
errorsand abort if any field fails. - Set
isProcessingtotrueandstatusTextto"Analyzing your resume...". - Call
await analyzeResume({ companyName, jobTitle, jobDescription, file }). - On success, call
setFeedback(result)andsetIsProcessing(false)to transition to the feedback state.
analyzeResume is a Next.js Server Action defined in @/app/actions/analyze-resume. The component never makes a raw fetch call — the server action boundary handles serialization, file upload to ImageKit, and the Gemini AI request.resetForm()
The resetForm function is passed to FeedbackDisplay as the onReset callback. When the user clicks “Analyze Another Resume”, it restores all state to its initial values: