Resume Builder
Relevant source files
The following files were used as context for generating this wiki page:- apps/frontend/components/builder/resume-builder.tsx
- apps/frontend/components/builder/resume-form.tsx
- apps/frontend/lib/api/resume.ts
- apps/backend/app/prompts/templates.py
- AGENTS.md
- apps/frontend/app/(default)/css/globals.css
- apps/frontend/components/resume/resume-single-column.tsx
- apps/frontend/components/resume/resume-two-column.tsx
- apps/frontend/app/print/resumes/[id]/page.tsx
- apps/frontend/app/(default)/tailor/page.tsx
The Resume Builder is a core module within the Resume Matcher application, providing a comprehensive interface for creating, editing, and customizing resumes. It serves as the central hub where users can interact with their resume data, whether it's a master resume or one tailored for a specific job. The builder features a two-panel layout with an editor on the left and a live preview on the right, enabling real-time feedback on changes.
This module integrates form-based data entry, template formatting controls, and dynamic preview rendering. It also provides access to auxiliary features like a Cover Letter editor, an Outreach Message generator, and a Job Description (JD) Match analysis view. The builder is responsible for loading existing resume data, managing unsaved changes, and persisting updates back to the server.
Sources: apps/frontend/components/builder/resume-builder.tsx, README.md
Architecture and Core Components
The Resume Builder is architected as a client-side, stateful component that orchestrates several child components to provide its functionality. The main component, ResumeBuilderContent, manages the overall state, data fetching, and user actions.
Sources: apps/frontend/components/builder/resume-builder.tsx:64-70
The following diagram illustrates the high-level component architecture of the Resume Builder UI.
Key Components
| Component | File | Description |
|---|---|---|
ResumeBuilder | resume-builder.tsx | The main wrapper component that handles suspense for data loading. |
ResumeBuilderContent | resume-builder.tsx | Manages all state, data fetching, user actions (save, download, reset), and layout. |
ResumeForm | resume-form.tsx | Renders the dynamic form for editing all resume sections, including custom ones. |
FormattingControls | formatting-controls.tsx | Provides UI controls for adjusting resume template settings like fonts, margins, and spacing. |
PaginatedPreview | preview.tsx | Renders the live preview of the resume, applying template settings. |
RetroTabs | retro-tabs.tsx | The tab component for switching between Resume, Cover Letter, Outreach, and JD Match views. |
CoverLetterEditor | cover-letter-editor.tsx | A text editor for the cover letter. |
JDComparisonView | jd-comparison-view.tsx | A split view that compares the resume against the job description, highlighting keywords. |
Sources: apps/frontend/components/builder/resume-builder.tsx, AGENTS.md
Data Flow and State Management
The Resume Builder manages complex state, including the resume data itself, unsaved changes, and template settings. It employs a clear data loading strategy to ensure a consistent user experience.
Data Loading
On component mount, ResumeBuilderContent attempts to load resume data in a specific order of priority:
- API Fetch: If a
resumeIdis present in the URL, it callsfetchResumeto get the latest data from the server. - Context Data: If navigating from the "Tailor" flow, it uses
improvedDatafrom theuseResumePreviewcontext. - Local Storage: As a recovery mechanism (e.g., after a browser refresh), it checks for a draft in
localStorageunder the keyresume_builder_draft. - Initial Data: If all else fails, it falls back to a default
INITIAL_DATAstructure.
Sources: apps/frontend/components/builder/resume-builder.tsx:162-224
This diagram shows the data loading sequence.
State Variables
| State Variable | Type | Storage Key | Description |
|---|---|---|---|
resumeData | ResumeData | resume_builder_draft | The current state of the resume being edited. Auto-saved to localStorage on change. |
lastSavedData | ResumeData | - | A copy of the data from the last successful save, used for the "Reset" functionality. |
hasUnsavedChanges | boolean | - | A flag that tracks if resumeData differs from lastSavedData. |
templateSettings | TemplateSettings | resume_builder_settings | The user's selected formatting options. Persisted to localStorage. |
activeTab | TabId | - | Controls which view is active (resume, cover-letter, etc.). |
Sources: apps/frontend/components/builder/resume-builder.tsx:65-130
Saving Data
When the user clicks "Save", the handleSave function is triggered. It sends the current resumeData to the backend via the updateResume API call. On success, lastSavedData is updated to match the new state, and the hasUnsavedChanges flag is reset.
Features
Multi-Tab Interface
The builder uses a tabbed interface to switch between different but related functionalities.
| Tab | ID | Availability | Description |
|---|---|---|---|
| RESUME | resume | Always available | The main editor for resume content and formatting. |
| COVER LETTER | cover-letter | When a cover letter exists for the resume. | An editor and previewer for the AI-generated cover letter. |
| OUTREACH MAIL | outreach | When an outreach message exists. | An editor and previewer for a shorter outreach email/message. |
| JD MATCH | jd-match | For tailored resumes with an associated job description. | A side-by-side view of the resume and the job description, with matching keywords highlighted. |
Sources: apps/frontend/components/builder/resume-builder.tsx:694-702, AGENTS.md
Formatting and Templates
The FormattingControls component allows users to customize the appearance of their exported PDF. These settings are stored in localStorage and are passed to the backend during PDF generation.
The styling is applied using CSS custom properties defined in globals.css, which are updated dynamically based on user selections.
| Control | CSS Variable | Description |
|---|---|---|
| Margins | --margin-top, etc. | Sets the page margins for the PDF. |
| Section Spacing | --section-gap | Controls the vertical space between resume sections. |
| Item Spacing | --item-gap | Controls the space between items within a section (e.g., two jobs). |
| Line Height | --line-height | Adjusts the line spacing of text. |
| Font Size | --font-size-base | Sets the base font size for the body text. |
| Header Scale | --header-scale | A multiplier for the main name and section headers. |
| Header/Body Font | --header-font, --body-font | Sets the font family for headers and body text. |
| Compact Mode | - | Applies a multiplier to reduce spacing for a denser layout. |
| Contact Icons | - | Toggles visibility of icons next to contact info. |
Sources: AGENTS.md, apps/frontend/app/(default)/css/globals.css:128-146
PDF Generation
The "Download" button triggers the handleDownload function, which calls the downloadResumePdf API utility. This function constructs a GET request to the /resumes/{resume_id}/pdf endpoint, passing all templateSettings as URL query parameters. The backend then uses Playwright (headless Chromium) to render the print page and generate a PDF.
This flow is illustrated below:
Resume Data Schema
The resume data structure is a critical part of the application, shared between the frontend and backend. The backend defines a JSON schema example in its prompts to guide the LLM, and the frontend uses a corresponding TypeScript interface.
The diagram below represents the entity relationships within the resume data structure.