# gabrielvesal/x2pdf architecture

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

- Interactive diagram: https://gitdiagram.com/gabrielvesal/x2pdf
- Repository: https://github.com/gabrielvesal/x2pdf

## Overview

##### Project type and purpose
- This is a lightweight, single-service web API (“X2Pdf”) built on .NET 9 Minimal APIs.
- Purpose: accept multiple image files, convert each to a PDF page, and return a single PDF.

##### File structure
- Program.cs: entry point, defines Minimal API endpoints.
- X2Pdf.csproj / X2Pdf.sln: .NET project and solution files.
- appsettings.json / appsettings.Development.json: configuration.
- Dockerfile: container build instructions.
- Properties/launchSettings.json: local launch profiles.
- No separate frontend or database—pure backend service.

##### Extract insights from README
- Exposes POST /api/convert/images-to-pdf
- Uses Kestrel under the hood and Swagger UI for interactive testing.
- Packaged and deployed as a Docker container exposing port 8080.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client["HTTP Client\n(curl, PowerShell)"]:::client
    Client --> API

    subgraph "Docker Container (Port 8080)"
        style DockerContainer container
        API["Kestrel HTTP Listener\n(.NET 9 Minimal API)"]:::api
        Endpoint["Minimal API Endpoint Handler\nPOST /api/convert/images-to-pdf"]:::api
        Service["Conversion Service\nImage-to-PDF processing"]:::logic
        Library["PDF Generation Library\n(PdfSharpCore)"]:::lib
        Swagger["Swagger UI"]:::lib

        API --> Endpoint
        Endpoint --> Service
        Service --> Library
        Endpoint --> Swagger
        Service --> Endpoint
        Endpoint --> Client
    end

    subgraph "Project Files"
        csproj["X2Pdf.csproj"]:::lib
        sln["X2Pdf.sln"]:::lib
        readme["README.md"]:::lib
        dockerfile["Dockerfile"]:::lib
        appjson["appsettings.json"]:::lib
        devjson["appsettings.Development.json"]:::lib
        launch["Properties/launchSettings.json"]:::lib
    end

    click API "https://github.com/gabrielvesal/x2pdf/blob/main/Program.cs"
    click Endpoint "https://github.com/gabrielvesal/x2pdf/blob/main/Program.cs"
    click Service "https://github.com/gabrielvesal/x2pdf/blob/main/Program.cs"
    click Swagger "https://github.com/gabrielvesal/x2pdf/blob/main/Program.cs"
    click csproj "https://github.com/gabrielvesal/x2pdf/blob/main/X2Pdf.csproj"
    click sln "https://github.com/gabrielvesal/x2pdf/blob/main/X2Pdf.sln"
    click readme "https://github.com/gabrielvesal/x2pdf/blob/main/README.md"
    click dockerfile "https://github.com/gabrielvesal/x2pdf/tree/main/Dockerfile"
    click appjson "https://github.com/gabrielvesal/x2pdf/blob/main/appsettings.json"
    click devjson "https://github.com/gabrielvesal/x2pdf/blob/main/appsettings.Development.json"
    click launch "https://github.com/gabrielvesal/x2pdf/blob/main/Properties/launchSettings.json"

    classDef client fill:#D6E9FF,stroke:#3399FF,color:#000
    classDef api fill:#DFF0D8,stroke:#3C763D,color:#000
    classDef logic fill:#FCF8E3,stroke:#8A6D3B,color:#000
    classDef lib fill:#F2F2F2,stroke:#AAA,color:#000
    classDef container stroke:#999,stroke-dasharray:5 5
```
