# pranavbp525/resumegenerator architecture

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

- Interactive diagram: https://gitdiagram.com/pranavbp525/resumegenerator
- Repository: https://github.com/pranavbp525/resumegenerator

## Overview

##### Main Components
- Streamlit Frontend (app.py): This is the entry point for users. It presents a user interface that accepts job descriptions and triggers resume generation.
- Resume Generation Core (modules in src/):
– llm.py: Manages interactions with the OpenAI API.
– prompts.py: Defines templates and prompt setups for generating resume content.
– responses.py: Handles parsing and processing of responses from the API.
- Template & Resume Configuration:
– assets/resume.yaml: Contains user-specific resume details that merge with generated data.
– LaTeX Template Files (within artifacts/*/latex_src): These are used to compile the final resume document.
- Artifact Management:
– artifacts/ directory: Stores generated outputs including intermediate LaTeX files and the final resume.pdf, along with model outputs in JSON.
- Additional Utilities and Experimentation:
– generate.py, experiments.ipynb, tree.py, and utils.py scripts: Likely support testing, additional generating flows, and system utilities.

##### Relationships and Interactions
- The UI layer (Streamlit app) gathers input (job description) from the user.
- The input is passed to the resume generation core, where prompts are crafted and sent to the OpenAI API (via llm.py), receiving generated content.
- The generated data is combined with the static resume details from assets/resume.yaml.
- The combined data flows into a LaTeX processing pipeline (using the LaTeX template files in the artifacts/*/latex_src directory) to produce a PDF resume.
- Outputs are saved in the artifacts folder, and possibly feedback or logging details are generated.

##### Architectural Patterns and Principles
- Layered Architecture: Separation of concerns between the user interface (Streamlit), business logic (resume generation in the src modules), and storage (assets for configurations; artifacts for outputs).
- Modularity: Distinct modules for prompts, API communication, and response handling.
- External Service Integration: The use of OpenAI’s API is a key dependency and is scoped within the llm module.

##### Technologies, Frameworks, and Libraries
- Python with Streamlit for the front end.
- Pipenv for dependency management.
- OpenAI API for language model-based generation.
- LaTeX for resume formatting and PDF generation.
- YAML for configuration (assets/resume.yaml).

##### Elements
– “User Interface (Streamlit App – app.py)”
– “Resume Generation Core” (with subcomponents for API integration, prompt handling, and response processing from src/llm.py, src/prompts.py, and src/responses.py)
– “Configuration & Templates” (assets/resume.yaml and LaTeX template files under artifacts/*/latex_src)
– “Artifact Storage” (final resume.pdf and intermediate model_outputs.json)
– Flow of job description from UI to the generation core.
– Flow from the generation core to OpenAI API and back.
– Flow of generated data merging with YAML configuration into the LaTeX template for final PDF generation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Layer"
        UI["User Interface (Streamlit App)"]:::frontend
    end

    subgraph "Resume Generation Core"
        PROMPTS["Prompt Handling (src/prompts.py)"]:::backend
        LLM["LLM API Integration (src/llm.py)"]:::backend
        RESP["Response Processing (src/responses.py)"]:::backend
    end

    subgraph "External Dependencies"
        API["External OpenAI API"]:::external
    end

    subgraph "Configuration & Templates"
        CONFIG["Resume Configuration (assets/resume.yaml)"]:::config
        LATEX["LaTeX Templates"]:::config
    end

    subgraph "Artifact Storage"
        STORAGE["Artifact Storage (artifacts/)"]:::storage
    end

    subgraph "Utilities & Experimentation"
        GENERATE["Utility: generate.py"]:::utils
        EXPERIMENTS["Experimentation: experiments.ipynb"]:::utils
        TREE["Utility: tree.py"]:::utils
        UTILS["Utility: utils.py"]:::utils
    end

    UI -->|"jobDescription"| PROMPTS
    PROMPTS -->|"buildPrompt"| LLM
    LLM -->|"sendRequest"| API
    API -->|"returnResponse"| LLM
    LLM -->|"passResult"| RESP
    RESP -->|"mergeWith"| CONFIG
    CONFIG -->|"integrateData"| LATEX
    LATEX -->|"compilePDF"| STORAGE

    classDef frontend fill:#a0d468,stroke:#333,stroke-width:2px;
    classDef backend fill:#4fc1e9,stroke:#333,stroke-width:2px;
    classDef config fill:#ffce54,stroke:#333,stroke-width:2px;
    classDef external fill:#ed5565,stroke:#333,stroke-width:2px;
    classDef storage fill:#ac92ec,stroke:#333,stroke-width:2px;
    classDef utils fill:#e6e9ed,stroke:#333,stroke-width:2px;

    click UI "https://github.com/pranavbp525/resumegenerator/blob/main/app.py"
    click LLM "https://github.com/pranavbp525/resumegenerator/blob/main/src/llm.py"
    click PROMPTS "https://github.com/pranavbp525/resumegenerator/blob/main/src/prompts.py"
    click RESP "https://github.com/pranavbp525/resumegenerator/blob/main/src/responses.py"
    click CONFIG "https://github.com/pranavbp525/resumegenerator/blob/main/assets/resume.yaml"
    click LATEX "https://github.com/pranavbp525/resumegenerator/tree/main/artifacts/5c2b2828-c059-47db-9fce-ac86e8c4aafb/latex_src"
    click LATEX "https://github.com/pranavbp525/resumegenerator/tree/main/artifacts/9c16dc71-534f-4da6-b12d-3cb254341e99/latex_src"
    click STORAGE "https://github.com/pranavbp525/resumegenerator/tree/main/artifacts/"
    click GENERATE "https://github.com/pranavbp525/resumegenerator/blob/main/generate.py"
    click EXPERIMENTS "https://github.com/pranavbp525/resumegenerator/blob/main/experiments.ipynb"
    click TREE "https://github.com/pranavbp525/resumegenerator/blob/main/tree.py"
    click UTILS "https://github.com/pranavbp525/resumegenerator/blob/main/utils.py"
```
