# lucasnevespereira/resumme-builder architecture

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

- Interactive diagram: https://gitdiagram.com/lucasnevespereira/resumme-builder
- Repository: https://github.com/lucasnevespereira/resumme-builder

## Overview

##### Main Components
- User Interface / Templates: Represented by the “ui” folder, which contains various templates (basic, classic, figacy, modern, oldman, simple, stackoverflow) used to generate the visual resume.
- Input & Data Layer: A JSON resume is provided (examples/example.resume.json) which acts as the data source. Also include the data validation and parsing layers encapsulated in internal/pkg/parser and internal/models.
- Service Layer: The business logic is mostly in internal/services (e.g., resume processing) and internal/api/handlers that manage HTTP API requests.
- PDF Generation and HTML Template Management: Located in internal/pkg/pdf and internal/pkg/template.
- API & CLI Entry Points: Two main entry points are in the “cmd” directory:
- cmd/local handles local CLI-based resume building.
- cmd/server handles the API server which receives requests.
- Utility Components: The project also includes utility packages (inside internal/utils for file operations, JSON handling, language internationalization with locales, and logging).

##### Relationships/Interactions
- For local usage, the CLI (cmd/local) reads the JSON file (using fs and json utilities) → parses the resume data into defined models → hands off to the service layer to apply the appropriate template (from ui/*) → uses the template manager and PDF generator to produce the output files (saved in an output folder).
- For API usage, the process is similar, except that HTTP requests (using internal/api/router and handlers) trigger the same processing pipeline and return the generated PDF as a response.

##### Important Architectural Patterns & Design Principles
- Layered Architecture / Separation of Concerns: Different layers for API handling, business logic, and utility functions.
- Modularity: The clear separation between internal packages (API, models, parser, pdf, template, utils, etc.) makes it easier to isolate changes.
- Command Pattern / Multi-Entry Points: Two command entry points (local and server) that both invoke a common core.
- Extensibility: The “ui” folder structure supports multiple resume templates, while internal/utils/lang supports multiple languages.

##### Relevant Technologies & Frameworks
- Primary language is Go.
- Use of standard Go package structure with “internal” for private packages.
- Docker for containerized deployment (supported by Dockerfile and make targets).
- External JSON Resume standard (supported through examples and parsing logic).

- “CLI (cmd/local)” and “API Server (cmd/server)”
- “JSON Resume Data Source”
- “Parser & Models (internal/pkg/parser, internal/models)”
- “Service Layer (internal/services/resume)”
- “Template Management (internal/pkg/template)”
- “PDF Generator (internal/pkg/pdf)”
- “UI Templates (ui/ directory with subfolders for each style)”
- “Utility Layer (internal/utils – fs, json, lang, logger)”
- Data flow from the JSON resume data → Parser/Models → Service Layer
- Processing flow from the Service Layer → both the HTML generator (via Template Manager) and PDF Generator
- Interaction paths from the user commands/API request to the processing components.
- Annotations describing that both CLI and API use a shared core processing engine.
- Output components (e.g., generated HTML/PDF files)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry Points
    subgraph "Entry Points"
        E1["CLI (cmd/local)"]:::entry
        E2["API Server (cmd/server)"]:::entry
    end

    %% Core Processing Engine
    subgraph "Core Processing Engine"
        P1["JSON Resume Data Source"]:::processing
        P2["Parser (internal/pkg/parser)"]:::processing
        P3["Models (internal/models)"]:::processing
        P4["Service Layer (internal/services/resume)"]:::processing
        P5["Template Management (internal/pkg/template)"]:::processing
        P6["PDF Generator (internal/pkg/pdf)"]:::processing
    end

    %% Auxiliary Components
    subgraph "Auxiliary Components"
        O1["UI Templates"]:::output
        U1["Utility Layer (internal/utils)"]:::utility
    end

    %% Output
    O2["Generated Resume Output"]:::output

    %% Connections from Entry Points to Core Processing
    E1 -->|"initiates"| P1
    E2 -->|"initiates"| P1

    %% Processing Pipeline Flow
    P1 -->|"provides-data"| P2
    P2 -->|"parses-data"| P3
    P3 -->|"feeds"| P4
    P4 -->|"triggers"| P5
    P4 -->|"triggers"| P6
    O1 -->|"provides templates to"| P5
    P5 -->|"renders HTML"| O2
    P6 -->|"generates PDF"| O2

    %% Utility support (dashed lines)
    U1 ---|"supports"| P2
    U1 ---|"supports"| P3
    U1 ---|"supports"| P4
    U1 ---|"supports"| P5
    U1 ---|"supports"| P6

    %% Click Events
    click E1 "https://github.com/lucasnevespereira/resumme-builder/blob/main/cmd/local/local.go"
    click E2 "https://github.com/lucasnevespereira/resumme-builder/blob/main/cmd/server/server.go"
    click P1 "https://github.com/lucasnevespereira/resumme-builder/blob/main/examples/example.resume.json"
    click P2 "https://github.com/lucasnevespereira/resumme-builder/tree/main/internal/pkg/parser"
    click P3 "https://github.com/lucasnevespereira/resumme-builder/tree/main/internal/models"
    click P4 "https://github.com/lucasnevespereira/resumme-builder/blob/main/internal/services/resume.go"
    click P5 "https://github.com/lucasnevespereira/resumme-builder/blob/main/internal/pkg/template/manager.go"
    click P6 "https://github.com/lucasnevespereira/resumme-builder/blob/main/internal/pkg/pdf/generator.go"
    click O1 "https://github.com/lucasnevespereira/resumme-builder/tree/main/ui/"
    click U1 "https://github.com/lucasnevespereira/resumme-builder/tree/main/internal/utils"

    %% Styles
    classDef entry fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef processing fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef utility fill:#D3D3D3,stroke:#000,stroke-width:2px;
    classDef output fill:#FFD700,stroke:#000,stroke-width:2px;
```
