# koksalkapucuoglu/resume-enhance architecture

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

- Interactive diagram: https://gitdiagram.com/koksalkapucuoglu/resume-enhance
- Repository: https://github.com/koksalkapucuoglu/resume-enhance

## Overview

##### Main Components

A. Web Application Layer:
- Django Web Server (ASGI/WSGI)
- URL Router (core/urls.py)
- Views Layer (resume/views.py)
- Forms Handler (resume/forms.py)
- Models Layer (resume/models.py)

B. AI Integration Layer:
- OpenAI Service (resume/openai_engine.py)
- API Communication Handler

C. PDF Generation Layer:
- LaTeX Renderer Service (latex_renderer/services.py)
- Template Handler (latex_renderer/template_handler.py)
- Template Storage (latex_renderer/templates/)

D. External Services:
- OpenAI API
- PDFLatex System

##### Component Relationships

- User → Django Web Server
- Django Web Server → URL Router → Views
- Views ↔ Forms Handler
- Views ↔ Models Layer
- Views ↔ OpenAI Service
- Views ↔ LaTeX Renderer Service
- OpenAI Service ↔ OpenAI API
- LaTeX Renderer Service → Template Handler
- Template Handler ↔ Template Storage
- LaTeX Renderer Service → PDFLatex System

##### Specific Implementation Details

**Web Application Layer:**
- Django
- Handles form submissions
- Manages resume data
- Controls view logic
- Template rendering (Jinja2)
- HTMX integration for dynamic updates

**AI Enhancement Layer:**
- OpenAI Integration
- Processes resume content
- Provides enhancement suggestions
- Real-time field improvements

**PDF Generation Layer:**
- LaTeX Processing
- Template management
- PDF compilation
- File handling

##### Data Flow Indicators

Following flows:
##### User Input Flow
Form Data → Django Views → Models
##### AI Enhancement Flow
Form Data → OpenAI Service → Enhanced Content → Views
##### PDF Generation Flow
Form Data → LaTeX Renderer → Template Handler → PDF Output

##### Additional Elements

Include:
- Docker container boundaries
- Database connections
- Static file handling
- Template processing pipeline
- Error handling paths
- API endpoints

##### Important Notes

- Three main workflows: form handling, AI enhancement, and PDF generation
- Async nature of AI operations
- Template variation handling
- Future integration points (LinkedIn, PDF import)
- Environment configuration dependencies
- Security boundaries

This system design should clearly communicate how the application handles the complete flow from user input through AI enhancement to final PDF generation, while showing the extensibility points for planned features.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Legend"
        L1[Django Components]:::django
        L2[AI Components]:::ai
        L3[PDF Components]:::pdf
        L4[External Services]:::external
        L5[Template Components]:::template
    end

    subgraph "Web Application Layer"
        User(("User"))
        WebServer["Django Web Server"]:::django
        Router["URL Router"]:::django
        Views["Views Layer"]:::django
        Forms["Forms Handler"]:::django
        Models["Models Layer"]:::django
        Admin["Admin Interface"]:::django
        DB[(Database)]:::django
    end

    subgraph "AI Integration Layer"
        OpenAIService["OpenAI Service"]:::ai
        OpenAIAPI["OpenAI API"]:::external
    end

    subgraph "PDF Generation Layer"
        LatexRenderer["LaTeX Renderer"]:::pdf
        TemplateHandler["Template Handler"]:::pdf
        PDFLatex["PDFLatex System"]:::external
    end

    subgraph "Template Storage"
        Templates["Template Files"]:::template
        ResumeClass["Resume Class"]:::template
        MainTemplate["Main Resume Template"]:::template
    end

    %% Connections
    User --> WebServer
    WebServer --> Router
    Router --> Views
    Views <--> Forms
    Views <--> Models
    Models <--> DB
    Admin --> Models
    Views <--> OpenAIService
    OpenAIService <--> OpenAIAPI
    Views <--> LatexRenderer
    LatexRenderer --> TemplateHandler
    TemplateHandler <--> Templates
    TemplateHandler <--> ResumeClass
    TemplateHandler <--> MainTemplate
    LatexRenderer --> PDFLatex

    %% Click Events
    click WebServer "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/core/asgi.py"
    click WebServer "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/core/wsgi.py"
    click Router "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/core/urls.py"
    click Router "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/resume/urls.py"
    click Views "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/resume/views.py"
    click Forms "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/resume/forms.py"
    click Models "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/resume/models.py"
    click OpenAIService "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/resume/openai_engine.py"
    click LatexRenderer "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/latex_renderer/services.py"
    click TemplateHandler "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/latex_renderer/template_handler.py"
    click Templates "https://github.com/koksalkapucuoglu/resume-enhance/tree/main/latex_renderer/templates/"
    click MainTemplate "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/latex_renderer/templates/faangpath_simple_template.tex"
    click ResumeClass "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/latex_renderer/templates/resume.cls"
    click Admin "https://github.com/koksalkapucuoglu/resume-enhance/blob/main/resume/admin.py"

    %% Styles
    classDef django fill:#3498db,stroke:#2980b9,color:white
    classDef ai fill:#2ecc71,stroke:#27ae60,color:white
    classDef pdf fill:#e67e22,stroke:#d35400,color:white
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef template fill:#9b59b6,stroke:#8e44ad,color:white
```
