# sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b architecture

> Architecture diagram of the GitHub repository sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b
- Repository: https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b

## Overview

This repository is a browser-based PDF merger backed by a FastAPI service. The main workflow is selecting PDFs in the frontend, submitting them to `/merge`, validating and combining their pages on the backend, then downloading the streamed PDF response. The backend also exposes health and home routes. `Backend/utils.py` contains PDF validation, merging, and inspection helpers, but the sampled `main.py` does not import or call them. Frontend markup and styling are present in the tree, but their relationships to the JavaScript could not be verified from the excerpts.

Main entry points: [`Backend/main.py`](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py) (Merge endpoint), [`Frontend/script.js`](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Frontend/script.js) (File selection and download), [`Frontend/index.html`](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Frontend/index.html) (Merger interface), [`Backend/config.json`](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/config.json) (Service configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser frontend"]
  node_ui["Merger interface<br/>[index.html]"]
  node_styles["Interface styling<br/>[style.css]"]
  node_frontend_logic["File selection and download<br/>[script.js]"]
end

subgraph group_backend["PDF API"]
  node_api["FastAPI service<br/>[main.py]"]
  node_config["Service configuration<br/>[config.json]"]
  node_merge_route["Merge endpoint<br/>[main.py]"]
  node_validation["Upload checks<br/>[main.py]"]
  node_pdf_merge["Page combination<br/>[main.py]"]
  node_download_response["PDF response<br/>[main.py]"]
  node_health["Health and home routes<br/>[main.py]"]
end

subgraph group_helpers["PDF helpers"]
  node_pdf_helpers["PDF helper functions<br/>[utils.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_ui
node_ui -.->|"interacts through"| node_frontend_logic
node_frontend_logic -->|"checks health"| node_api
node_frontend_logic -->|"posts files"| node_merge_route
node_merge_route -->|"checks uploads"| node_validation
node_merge_route -->|"combines pages"| node_pdf_merge
node_merge_route -->|"streams PDF"| node_download_response
node_api -->|"loads settings"| node_config
node_api -->|"serves routes"| node_health

click node_ui "https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Frontend/index.html"
click node_styles "https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Frontend/style.css"
click node_frontend_logic "https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Frontend/script.js"
click node_api "https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py"
click node_config "https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/config.json"
click node_merge_route "https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py"
click node_validation "https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py"
click node_pdf_merge "https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py"
click node_download_response "https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py"
click node_health "https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py"
click node_pdf_helpers "https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui,node_styles,node_frontend_logic,node_user toneBlue
class node_api,node_config,node_merge_route,node_validation,node_pdf_merge,node_download_response,node_health toneAmber
class node_pdf_helpers toneMint
```

## Components

### Browser frontend

- [Merger interface](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Frontend/index.html): `Frontend/index.html`
- [Interface styling](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Frontend/style.css): `Frontend/style.css`
- [File selection and download](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Frontend/script.js): `Frontend/script.js`

### PDF API

- [FastAPI service](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py): `Backend/main.py`
- [Service configuration](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/config.json): `Backend/config.json`
- [Merge endpoint](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py): `Backend/main.py`
- [Upload checks](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py): `Backend/main.py`
- [Page combination](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py): `Backend/main.py`
- [PDF response](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py): `Backend/main.py`
- [Health and home routes](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/main.py): `Backend/main.py`

### PDF helpers

- [PDF helper functions](https://github.com/sudeepmadare18/pragyanai_super30_python_pdfmerger_f-b/blob/main/Backend/utils.py): `Backend/utils.py`

### Other components

- **User**

## Connections

- User → Merger interface: uses
- Merger interface → File selection and download: interacts through
- File selection and download → FastAPI service: checks health (evidence: `Frontend/script.js`)
- File selection and download → Merge endpoint: posts files (evidence: `Frontend/script.js`)
- Merge endpoint → Upload checks: checks uploads (evidence: `Backend/main.py`)
- Merge endpoint → Page combination: combines pages (evidence: `Backend/main.py`)
- Merge endpoint → PDF response: streams PDF (evidence: `Backend/main.py`)
- FastAPI service → Service configuration: loads settings (evidence: `Backend/main.py`)
- FastAPI service → Health and home routes: serves routes (evidence: `Backend/main.py`)
