TalentSync

AI resume builder and ATS optimizer for job seekers. Tailored resumes, outreach, and interview prep from one profile.

PDF resume generation components

React pieces for building and exporting a tailored resume PDF.

Repository layout#

The resume generation feature is organized into reusable React components and supporting utilities, with separation between UI, data orchestration, and LaTeX generation logic. The frontend components communicate with Next.js API routes, which act as bridges to the backend services responsible for resume tailoring and PDF generation.

Building blocks#

This section introduces the primary components involved in the resume generation workflow:

  • ConfigurationForm: Allows users to choose a resume template, color scheme, and font size.
  • TailoringForm: Enables job-specific customization by providing job role, company details, and job description.
  • ExportTab: Orchestrates the entire export process, including resume tailoring, preview generation, LaTeX code generation, and PDF download.
  • ResumePreview: Renders a human-readable preview of the resume data.
  • LatexOutput: Displays generated LaTeX code and provides actions to copy or open in Overleaf.
  • ResumeSourceSelector: Lets users select an existing resume or upload a new one.
  • latexGenerator: Provides LaTeX templates and generation utilities.
  • latexEscape: Ensures safe LaTeX compilation by escaping special characters.
  • resume-gen.service: Frontend service for interacting with backend resume generation endpoints.
  • tailored-resume/route.ts: Next.js API route that bridges frontend requests to backend services.
  • graph.py: Backend service orchestrating resume tailoring with LLMs and tools.

How it fits together#

The resume generation architecture keeps layers apart:

  • Frontend components collect user preferences and trigger actions.
  • ExportTab coordinates state and orchestrates API calls.
  • Next.js API routes validate requests, enforce authentication, and forward to backend services.
  • Backend services perform resume tailoring and prepare data for LaTeX generation.
  • LaTeX utilities transform structured resume data into compilable LaTeX documents.

ConfigurationForm#

ConfigurationForm provides three customization controls:

  • Template selection: Professional or Modern.
  • Color scheme: Gray, Blue, Green, Red.
  • Font size: Slider from 8pt to 12pt.

These options influence the LaTeX output styling and structure.

TailoringForm#

TailoringForm enables job-specific resume tailoring:

  • Toggle for enabling tailoring.
  • Required job role.
  • Optional company name, website, and job description.

When enabled, these inputs are sent to the backend to tailor the resume data.

ExportTab#

ExportTab is the central orchestrator:

  • Manages state for configuration, tailoring, preview, and LaTeX output.
  • Handles preview generation, LaTeX generation, and PDF download.
  • Integrates with API mutations for tailor, LaTeX generation, and PDF download.
  • Displays loading overlays during generation and shows success/error notifications.

Key flows:

  • Preview: Calls tailor mutation, sets parsed data, and renders ResumePreview.
  • LaTeX: Builds PdfGenerationRequest with selected template and options, calls generate LaTeX mutation, and displays LatexOutput.
  • PDF: Builds PdfGenerationRequest, calls download mutation, handles Blob download, and falls back to LaTeX if PDF service is unavailable.

ResumePreview#

ResumePreview renders a readable preview of the resume data:

  • Header with name and contact information.
  • Sections for Education, Skills, Languages, Experience, Projects, Publications, Positions of Responsibility, Certifications, and Achievements.
  • Uses markdown rendering for rich text display.

LatexOutput#

LatexOutput presents the generated LaTeX code:

  • Provides buttons to copy LaTeX to clipboard and open in Overleaf.
  • Includes a textarea with the full LaTeX code.
  • Offers manual compilation instructions.

ResumeSourceSelector#

ResumeSourceSelector allows users to choose a resume source:

  • Toggle between “Use Existing Resume” and “Upload New Resume”.
  • Dropdown to select from user’s resumes with metadata.
  • Drag-and-drop upload area for new resumes.

LaTeX generation process and template system#

The LaTeX generation pipeline transforms structured resume data into compilable LaTeX:

  • Templates: Professional and Modern, each with distinct styling and packages.
  • Options: Font size, margins, and color scheme.
  • Escaping: Special characters are escaped to ensure LaTeX compilation safety.
  • Utilities: Helper functions format lists, sanitize headers, and escape text.

Backend integration and resume tailoring#

The frontend communicates with backend services through Next.js API routes:

  • Authentication: Session-based checks ensure authorized access.
  • Tailoring: Two pathways, file upload (v1) or existing resume text (v2).
  • Validation: Ensures required fields and prevents conflicting inputs.
  • Error handling: Graceful handling of timeouts, non-JSON responses, and access restrictions.
  • Pipeline: Backend orchestrates LLM-based tailoring and returns structured data.

Dependencies#

The components and utilities depend on each other as follows:

  • ExportTab depends on TailoringForm, ConfigurationForm, ResumePreview, LatexOutput, and resume-gen.service.
  • LatexOutput depends on latexGenerator and latexEscape.
  • ExportTab also integrates with Next.js API routes for backend communication.
  • ResumeSourceSelector supports input modes for existing resumes and uploads.

Performance#

  • Timeout handling: Backend requests use extended timeouts suitable for long-running LLM operations.
  • Error resilience: Non-JSON responses and HTML error pages are handled gracefully with messages.
  • Large payloads: Ensure resume text length is sufficient before tailoring to avoid unnecessary processing.
  • UI responsiveness: Loading overlays and disabled states prevent concurrent operations and improve UX.

Troubleshooting#

Common issues:

  • Authentication failures: Verify session validity; ensure proper sign-in.
  • Missing job role: Tailoring requires a non-empty job role; provide it before enabling tailoring.
  • Access denied to resume: Confirm ownership or administrative privileges for selected resume.
  • Backend connectivity: Timeouts or service unavailability trigger fallback behavior; retry later or use LaTeX output.
  • PDF download failures: When PDF service is unavailable, the system returns LaTeX code for manual compilation.