# dynocoder/lazy-resume-editor architecture

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

- Interactive diagram: https://gitdiagram.com/dynocoder/lazy-resume-editor
- Repository: https://github.com/dynocoder/lazy-resume-editor

## Overview

##### Project type and purpose
- This is a full-stack web application (“Lazy Resume Editor”) that lets users edit HTML/CSS resumes in real time, preview changes live, and export the result as a PDF.
- The frontend is a React/Vite single-page application with Monaco Editor integration. The backend is a Python Flask service exposing REST endpoints and orchestrating PDF export (and potentially AI-powered enhancements via OpenAI).

##### File structure
- Top-level directories:
- backend/ – Flask application
- frontend/ – React single-page app (Vite)
- Backend substructure:
- app.py – entry point
- app/config.py – configuration (e.g., OpenAI API keys)
- app/routes/ – Flask route handlers (context_engine.py, resume.py)
- app/services/ – business logic (resume_service.py)
- Frontend substructure:
- public/ – static assets (index.html)
- src/ – React components, CSS, data fixtures, main.jsx
- components/ – UI modules (AIEdit, FileExplorer, ResumeUploader, DirectTextEditor, APIKeyModal)
- data/initialFiles.js & sampleFiles.js – initial file system tree
- Infrastructure:
- frontend/nginx.conf – static file server config
- Docker Compose (referenced in README)

##### README for additional insights
- Real-time editing powered by Monaco Editor
- Live preview pane served by Nginx (or directly via React dev server)
- Export to PDF functionality (likely triggered by a backend endpoint)
- Uses Docker Compose to spin up both services together

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External client
    Browser["User Browser"]:::external

    subgraph "Docker Compose" 
        direction TB
        subgraph "Frontend Container"
            direction TB
            Nginx["Nginx<br/>(serves static assets)"]:::frontend
            ReactSPA["React SPA"]:::frontend

            ReactSPA --> Monaco["Monaco Editor<br/>(DirectTextEditor)"]:::frontend
            ReactSPA --> FileExplorer["File Explorer"]:::frontend
            ReactSPA --> ResumeUploader["Resume Uploader"]:::frontend
            ReactSPA --> AIEdit["AI-powered Edit"]:::frontend
            ReactSPA --> APIKeyModal["API Key Modal"]:::frontend
            ReactSPA --> Preview["Live Preview<br/>(iframe)"]:::frontend
            ReactSPA --> InitialFiles["initialFiles.js"]:::frontend
            ReactSPA --> SampleFiles["sampleFiles.js"]:::frontend
            ReactSPA --> IndexHTML["index.html"]:::frontend
            ReactSPA --> ViteConfig["vite.config.js"]:::frontend
            ReactSPA --> CSS["Global CSS Files"]:::frontend

            Nginx --> Browser
            Browser --> Nginx
            Browser --> ReactSPA
        end

        subgraph "Backend Container"
            direction TB
            FlaskApp["Flask App<br/>(app.py)"]:::backend
            Config["Config<br/>(config.py)"]:::backend
            subgraph "Routes"
                direction TB
                ResumeRoute["/resume Endpoint"]:::backend
                ContextRoute["/context Endpoint"]:::backend
            end
            subgraph "Services"
                direction TB
                ResumeService["Resume Service"]:::service
            end

            FlaskApp --> Config
            FlaskApp --> ResumeRoute
            FlaskApp --> ContextRoute
            ResumeRoute --> ResumeService
            ContextRoute --> ResumeService
            ResumeService --> PDFService
            ContextRoute --> OpenAI
        end
    end

    %% External services
    PDFService["PDF Generation Service"]:::external
    OpenAI["OpenAI API"]:::external

    %% Data flows
    ReactSPA -->|POST /resume| ResumeRoute
    ReactSPA -->|POST /context| ContextRoute
    ResumeRoute -->|HTML/CSS payload| ResumeService
    ResumeService -->|PDF binary| ReactSPA
    ContextRoute -->|AI suggestions| ReactSPA

    %% Click Events
    click Monaco "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/src/components/DirectTextEditor.jsx"
    click FileExplorer "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/src/components/FileExplorer.jsx"
    click ResumeUploader "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/src/components/ResumeUploader.jsx"
    click AIEdit "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/src/components/AIEdit.jsx"
    click APIKeyModal "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/src/components/APIKeyModal.jsx"
    click InitialFiles "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/src/data/initialFiles.js"
    click SampleFiles "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/src/sampleFiles.js"
    click ReactSPA "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/src/main.jsx"
    click ReactSPA "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/src/App.jsx"
    click IndexHTML "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/index.html"
    click ViteConfig "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/vite.config.js"
    click Nginx "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/nginx.conf"
    click CSS "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/src/index.css"
    click CSS "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/src/styles.css"
    click CSS "https://github.com/dynocoder/lazy-resume-editor/blob/main/frontend/src/App.css"
    click FlaskApp "https://github.com/dynocoder/lazy-resume-editor/blob/main/backend/app.py"
    click Config "https://github.com/dynocoder/lazy-resume-editor/blob/main/backend/app/config.py"
    click ResumeRoute "https://github.com/dynocoder/lazy-resume-editor/blob/main/backend/app/routes/resume.py"
    click ContextRoute "https://github.com/dynocoder/lazy-resume-editor/blob/main/backend/app/routes/context_engine.py"
    click ResumeService "https://github.com/dynocoder/lazy-resume-editor/blob/main/backend/app/services/resume_service.py"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#66b0ff,stroke-width:1px
    classDef backend fill:#d4edda,stroke:#7fc97f,stroke-width:1px
    classDef service fill:#d4edda,stroke:#3c763d,stroke-width:1px,stroke-dasharray: 5 5
    classDef external fill:#ffe5b4,stroke:#ff9900,stroke-width:1px,stroke-dasharray: 2 2
```
