How I built an AI Resume Analyzer with Next.js and the Vercel AI SDK
By Adarsh Raut ·

I'm Adarsh Raut, a full stack software developer based in Pune. AI Resume Analyzer takes a PDF resume and returns a score, feedback for each section, a match against a job description and a set of interview questions to prepare. The code is on GitHub.
It's built with Next.js 16, TypeScript, Tailwind, shadcn/ui and the Vercel AI SDK. Most of the interesting problems were at the edges: PDFs, and trusting what a language model sends back.
What it does
You drop in a PDF, and optionally paste a job description. You get an overall score out of 100, a score and a list of issues and suggestions for five sections (formatting, summary, experience, skills and education), and the top three improvements to make first. With a job description, you also get a match score, the keywords your resume is missing and suggestions tailored to that role.

Select Try the demo on the upload page to explore the scorecard, job match, and interview questions for a fictional resume without uploading your own.
Reading PDFs is harder than it looks
An earlier version used pdf2json. I handled two extraction quirks in that version:
- It leaves a literal
%(as in "35%") unescaped, which makesdecodeURIComponentthrow. The fix is to escape a%that isn't followed by two hex digits and retry. - Words can come out glued together ("Developerwith"). A couple of small regexes put spaces back between lowercase and uppercase letters and between digits and letters, so the model sees clean text.
The current version uses PDF.js and preserves line breaks from the PDF's text layer. If it can't find selectable text, the app prompts you to upload a text-based PDF or paste your resume.
Getting reliable JSON from a model
The prompt asks for JSON only, in an exact shape. Models still sometimes wrap it in code fences, return it as a quoted string or put raw newlines inside strings. So the response goes through a forgiving parser first, which:
- tries
JSON.parsedirectly, - strips code fences,
- unwraps JSON that was encoded twice,
- escapes raw control characters inside strings.
Then Zod validates the result against a schema, with every score limited to 0–100. If the shape is wrong, the request fails with an error instead of putting bad data on the page. The job-match fields come from the same schema extended with job_match_score, missing_keywords and tailored_suggestions, so one code path handles both modes.
Interview questions as a separate call
Interview questions are generated by their own endpoint, so the analysis shows up first and the questions follow. The model returns 6–10 questions, each with a category such as Technical, Behavioral or Leadership and a short suggested approach. If you pasted a job description, the questions are tailored to it.

Bring your own model
The app defaults to a free Groq-hosted model, so it works out of the box. Because it's built on the Vercel AI SDK, switching providers is a small change. In settings you can choose Groq, OpenAI, Google Gemini or Anthropic Claude, pick a model and use your own API key. The key is sent with the request and used for that call.
Privacy
There's no database. Your last 10 analyses are saved in your browser's localStorage, so you can revisit them, and you can delete them whenever you like. The resume text is sent to the AI provider you choose in order to be analysed.
Small details
- Dark mode follows the system setting, with an inline script that sets it before the first paint so the page doesn't flash.
- The scorecard shows the overall score alongside five expandable section scores, with three suggested improvements below.
- The sample screenshots use a fictional resume.
What I'd do next
- Use the AI SDK's structured output support instead of parsing JSON by hand.
- Add rate limiting on the free default model.
- Support scanned PDFs with OCR.
You can try AI Resume Analyzer here, and I'm happy to talk about it on LinkedIn.