Frontend Project Structure
Relevant source files
The following files were used as context for generating this wiki page:The frontend of Resume Matcher is a Next.js application built with React and TypeScript. It serves as the user interface for all resume management, tailoring, and configuration tasks. The architecture emphasizes a modular, component-based design, leveraging modern web development practices for a responsive and interactive user experience. The project utilizes Tailwind CSS for styling, following a specific Swiss International Style design system.
The application communicates with a Python FastAPI backend to handle data persistence and AI-powered operations. For more information on the backend, see the Backend Architecture page, and for API contracts, see the Frontend APIs page.
Core Technologies and Dependencies
The frontend relies on a modern technology stack. The primary dependencies are managed in apps/frontend/package.json.
| Dependency | Description |
|---|---|
next | The React framework for server-side rendering, static site generation, and routing. |
react / react-dom | The core UI library for building components. |
tailwindcss | A utility-first CSS framework for styling. Version 4 is used. |
typescript | Provides static typing for the JavaScript codebase. |
lucide-react | A library for icons used throughout the UI. |
tw-animate-css | A Tailwind plugin for animations. |
eslint / prettier | Used for code linting and formatting to maintain code quality. |
Sources: apps/frontend/package.json, install.txt, AGENTS.md
Directory Structure
The apps/frontend/ directory is organized following Next.js conventions, separating pages, components, and business logic.
This diagram illustrates the high-level folder structure of the frontend application.
| Directory | Purpose |
|---|---|
app/ | Contains all application routes, following the Next.js App Router conventions. Key routes include dashboard, builder, tailor, settings, and print. |
components/ | Houses reusable React components, such as UI elements (Button, ConfirmDialog), and complex composite components (ResumeBuilder). |
lib/ | Contains core application logic, including API clients (lib/api/), React context providers (lib/context/), and other utilities. |
hooks/ | Stores custom React hooks for managing complex state or side effects, such as use-enrichment-wizard.ts. |
messages/ | Contains JSON files for internationalization (i18n), with one file per supported language (e.g., en.json). |
State Management and Data Flow
The application employs a combination of local component state, React Context, and browser localStorage for state management.
Data Loading in ResumeBuilder
The ResumeBuilder component demonstrates a clear data loading strategy with multiple fallbacks to ensure a robust user experience.
This diagram shows the prioritized data sources for loading a resume into the builder.
User Flow: Tailoring a Resume
The "Tailor Resume" feature is a key workflow that involves user input, multiple API calls, and state updates via React Context.
The sequence diagram below outlines the process when a user pastes a job description and clicks "Generate Tailored Resume".
State Persistence
-
localStorage: Used to store transient or session-related data.master_resume_id: The ID of the user's primary resume, used as a basis for tailoring.
Sources: apps/frontend/app/(default)/tailor/page.tsx:29-34resume_builder_draft: A draft of the resume being edited in theResumeBuilderis auto-saved tolocalStorageto prevent data loss on browser refresh.
Sources: apps/frontend/components/builder/resume-builder.tsx:210-214resume_builder_settings: User-defined formatting and template settings are persisted.
Sources: apps/frontend/components/builder/resume-builder.tsx:103-113resume_matcher_ui_language/resume_matcher_content_language: Stores the user's language preferences.
Sources: AGENTS.md
-
React Context: Used for sharing global state across components without prop drilling.
useResumePreview: Shares the AI-improved resume data from theTailorPageto theResumeBuilder.
Sources: apps/frontend/app/(default)/tailor/page.tsx:35, apps/frontend/components/builder/resume-builder.tsx:90useStatusCache: Provides a cached view of system status (DB stats, LLM health).
Sources: apps/frontend/app/(default)/settings/page.tsx:43useLanguage: Manages UI and content language state across the application.
Sources: apps/frontend/app/(default)/settings/page.tsx:68
Styling and Theming
The frontend's visual identity is governed by the Swiss International Style design system. This is implemented using Tailwind CSS and a system of CSS custom properties for theming and dynamic styling, particularly for resume templates.
Sources: AGENTS.md
Tailwind CSS
Styling is primarily done using utility classes directly in the TSX components. This approach is consistent across the application, from simple buttons to complex page layouts.
Sources: apps/frontend/app/(default)/tailor/page.tsx:77-123
Resume Template CSS Variables
The resume templates (resume-single-column.tsx, resume-two-column.tsx) are styled dynamically using CSS variables defined in globals.css. These variables are controlled by the "Formatting Controls" in the ResumeBuilder, allowing users to customize the appearance of their exported PDF.
| Variable | Purpose | Controlled By |
|---|---|---|
--section-gap | Vertical space between major resume sections. | Section Spacing |
--item-gap | Vertical space between items within a section (e.g., jobs). | Item Spacing |
--line-height | Text line height. | Line Height |
--font-size-base | The base font size for the entire resume. | Base Font Size |
--header-scale | Multiplier for the main name/header font size. | Header Scale |
--section-header-scale | Multiplier for section title font size. | Header Scale |
--header-font | Font family for name and section headers. | Header Font |
--body-font | Font family for all body text. | Body Font |
--margin-top/bottom/left/right | Page margins (applied as padding in preview, but used by the PDF renderer). | Margins |
Sources: apps/frontend/app/(default)/css/globals.css:170-188, AGENTS.md
Internationalization (i18n)
The application supports multiple languages for both the user interface and the AI-generated content. This is managed through a simple, dependency-free i18n system.
Sources: AGENTS.md
Language Settings
There are two distinct language settings, configurable on the /settings page:
- UI Language: Affects interface text like buttons and labels. Stored in
localStorage. - Content Language: Determines the language for AI-generated content like tailored resumes and cover letters. Stored in
localStorageand sent to the backend with API requests.
Sources: AGENTS.md, apps/frontend/app/(default)/settings/page.tsx:460-545
Implementation
- Translation Files: UI text is stored in JSON files within
apps/frontend/messages/, with one file per locale (e.g.,en.json,es.json). useTranslationsHook: A custom hook (useTranslations) is used within components to access translated strings.- Language Context: A
LanguageProvidermakes the current language settings and translation functions available throughout the component tree.
Example of a translation file:
// apps/frontend/messages/en.json
{
"common": {
"save": "Save",
"cancel": "Cancel",
"delete": "Delete"
},
"dashboard": {
"title": "Dashboard",
"uploadResume": "Upload Resume"
},
"settings": {
"title": "Settings",
"aiProvider": "AI Provider"
}
}
Sources: apps/frontend/messages/en.json, AGENTS.md