# xitanggg/open-resume architecture

> Architecture diagram of the GitHub repository xitanggg/open-resume, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xitanggg/open-resume
- Repository: https://github.com/xitanggg/open-resume

## Overview

##### Project Type & Purpose
- OpenResume is a modern, open-source resume builder and parser built on NextJS. It provides two core functionalities:
- A Resume Builder that allows users to create and download professionally formatted resumes in real time.
- A Resume Parser that processes existing resume PDFs to assess ATS readability.
- The application is a full-stack web application with a strong emphasis on client-side interaction (React, Redux) and local processing (PDF.js and react-pdf).

##### Analyzing the File Structure
- Notice the top-level directories such as public (for static assets) and src, which contains the core application code.
- Under src/app, you have page routes:
- Home (/page.tsx) – landing page with UI features.
- /resume-import – providing a dropzone for PDF imports.
- /resume-builder – where the user builds their resume.
- /resume-parser – showcasing resume parsing.
- Within src/app/components, you see clear splitting of components:
- Components related to the Resume view and PDF rendering.
- Components strictly for displaying UI elements (e.g., Tooltip, TopNavBar, documentation components).
- The src/app/lib folder holds utility functions, parsing logic, and the Redux store along with slices to manage the resume and settings state.

##### Key Components
a. Main UI Layers:
- Pages: Four primary routes (Home, Resume Import, Resume Builder, Resume Parser). Represent each page as a component node.
- Resume Builder Page: Break into major sub-blocks:
- Resume Display Component: Handling resume preview and PDF rendering (using React-pdf).
- Resume Form Block: (Per the provided instruction, group all ResumeForm components into one unified block.) This block captures all user input for the resume, including sub-components for education, work experience, skills, etc.
- Resume Parser Page: Comprises UI for PDF dropzone and parsing results display.
b. State Management & Business Logic:
- Redux Store: Represent the central state container, with slices for resume data and settings.
- Parser Library: The parse-resume-from-pdf logic that handles PDF extraction (powered by PDF.js).
- Utilities: Helper functions (like deep-clone, deep-merge) located in the lib directory.
c. External Services & Libraries:
- PDF.js: For reading and processing PDF files.
- React-pdf: For rendering the resume into a PDF.
- Tailwind CSS & Prettier/Eslint configurations: Denote the styling and code quality layers.
- Additional third-party libraries like React for component building and TypeScript as the underlying language layer.

##### Relationships & Data Flow
- Page routes to their underlying components (e.g., Home page invoking Hero, Features, Testimonials, etc.).
- The Resume Builder page funneling data between the Resume Form Block and the Resume Display (PDF preview) component, showing real-time updates.
- The Redux store interacting bi-directionally with both the Resume Form Block (to capture user input) and the Resume Display (to update the resume PDF view).
- The Resume Parser page leading to the Parser Library where PDF.js initiates content extraction which then flows to the React UI for display.
- Utility layers providing support to both the form rendering and parsing algorithms.

##### Architectural Patterns & Design Principles
- MVC-like separation in that the pages act as controllers that bring together models (Redux store/state) and views (UI components).
- Component-based design using React to build modular, reusable blocks.
- A clear separation of concerns: the Resume Builder page is divided into input (the unified Resume Form block) and output (the live resume preview).
- Emphasis on local processing and privacy, as all data handling (resume building and parsing) is executed in the client without any external backend calls.

## Diagram (Mermaid)

```mermaid
flowchart TD
    NextJSApp["NextJS App"]:::nextjs
    HomePage["Home Page"]:::page
    ResumeImportPage["Resume Import Page"]:::page
    ResumeBuilderPage["Resume Builder Page"]:::page
    ResumeParserPage["Resume Parser Page"]:::page
    ReduxStore["Redux Store"]:::state
    PDFParserLib["PDF Parser Library"]:::lib
    Utilities["Utilities & Helpers"]:::lib
    ReactPdf["React-pdf"]:::external
    PDFjs["PDF.js"]:::external

    ResumeDisplay["Resume Display (PDF Renderer)"]:::component
    ResumeFormBlock["Resume Form Block"]:::component

    %% NextJS App as the central framework routing to pages
    NextJSApp -->|"routes"| HomePage
    NextJSApp -->|"routes"| ResumeImportPage
    NextJSApp -->|"routes"| ResumeBuilderPage
    NextJSApp -->|"routes"| ResumeParserPage

    %% Resume Builder Page internal components
    ResumeBuilderPage -->|"contains"| ResumeDisplay
    ResumeBuilderPage -->|"contains"| ResumeFormBlock

    %% Data flow between Resume Form Block and Resume Display via Redux Store
    ResumeFormBlock -->|"updateState"| ReduxStore
    ReduxStore -->|"refreshPDF"| ResumeDisplay

    %% Resume Parser Page flow to and from the Parser Library
    ResumeParserPage -->|"parsePDF"| PDFParserLib
    PDFParserLib -->|"displayResult"| ResumeParserPage

    %% Supporting Utilities
    Utilities -->|"supports"| ResumeFormBlock
    Utilities -->|"supports"| PDFParserLib

    %% External library usage
    ResumeDisplay -->|"renderUsing"| ReactPdf
    PDFParserLib -->|"extraction"| PDFjs

    %% Click Events for component mappings
    click NextJSApp "https://github.com/xitanggg/open-resume/blob/main/next.config.js"
    click NextJSApp "https://github.com/xitanggg/open-resume/blob/main/src/app/layout.tsx"
    click NextJSApp "https://github.com/xitanggg/open-resume/blob/main/package.json"

    click HomePage "https://github.com/xitanggg/open-resume/blob/main/src/app/page.tsx"
    click HomePage "https://github.com/xitanggg/open-resume/tree/main/src/app/home"

    click ResumeImportPage "https://github.com/xitanggg/open-resume/blob/main/src/app/resume-import/page.tsx"
    click ResumeImportPage "https://github.com/xitanggg/open-resume/blob/main/src/app/components/ResumeDropzone.tsx"

    click ResumeBuilderPage "https://github.com/xitanggg/open-resume/blob/main/src/app/resume-builder/page.tsx"
    click ResumeDisplay "https://github.com/xitanggg/open-resume/tree/main/src/app/components/Resume/ResumePDF"
    click ResumeFormBlock "https://github.com/xitanggg/open-resume/tree/main/src/app/components/ResumeForm"

    click ResumeParserPage "https://github.com/xitanggg/open-resume/blob/main/src/app/resume-parser/page.tsx"
    click ResumeParserPage "https://github.com/xitanggg/open-resume/blob/main/src/app/components/ResumeParserAlgorithmArticle.tsx"
    click ResumeParserPage "https://github.com/xitanggg/open-resume/blob/main/src/app/components/ResumeTable.tsx"

    click ReduxStore "https://github.com/xitanggg/open-resume/blob/main/src/app/lib/redux/store.ts"
    click ReduxStore "https://github.com/xitanggg/open-resume/blob/main/src/app/lib/redux/resumeSlice.ts"
    click ReduxStore "https://github.com/xitanggg/open-resume/blob/main/src/app/lib/redux/settingsSlice.ts"

    click PDFParserLib "https://github.com/xitanggg/open-resume/tree/main/src/app/lib/parse-resume-from-pdf"

    click Utilities "https://github.com/xitanggg/open-resume/tree/main/src/app/lib"

    %% Styles
    classDef nextjs fill:#e1bee7,stroke:#6a1b9a,stroke-width:2px;
    classDef page fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef component fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px;
    classDef state fill:#ffe082,stroke:#f9a825,stroke-width:2px;
    classDef lib fill:#ffcc80,stroke:#f57c00,stroke-width:2px;
    classDef external fill:#ffe0b2,stroke:#ff9800,stroke-width:2px;
```
