# surajvarma1/file_conversion architecture

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

- Interactive diagram: https://gitdiagram.com/surajvarma1/file_conversion
- Repository: https://github.com/surajvarma1/file_conversion

## Overview

This is a Next.js/FastAPI file-conversion platform. Users choose a tool, select files, submit a conversion or extraction request, and receive a download link or extracted-file listing. The backend exposes separate image, PDF, and ZIP routes; application services validate inputs and dispatch operations through converter factories to format-specific strategies. Local storage and signed-download routes handle outputs. The README documents the broader tool set, though some route and service excerpts are incomplete; dashed edges mark the frontend-to-API connection that was not shown in source excerpts.

Main entry points: [`backend/app/main.py`](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/main.py) (FastAPI app), [`backend/app/application/services/conversion_services.py`](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/application/services/conversion_services.py) (Conversion services), [`backend/app/infrastructure/converters/factories.py`](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/infrastructure/converters/factories.py) (Strategy factories), [`backend/app/infrastructure/file_storage/local_storage.py`](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/infrastructure/file_storage/local_storage.py) (Local file storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Tool interface"]
  node_tool_catalog["Tool catalog<br/>[page.tsx]"]
  node_tool_page["Tool page<br/>[page.tsx]"]
  node_file_picker["File picker<br/>[DragDrop.tsx]"]
  node_tool_form["Tool form<br/>[ToolForm.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["API entry points"]
  node_image_routes["Image routes<br/>[routes.py]"]
  node_pdf_routes["PDF routes<br/>[routes.py]"]
  node_zip_routes["ZIP routes<br/>[routes.py]"]
  node_download_routes["Download routes<br/>[routes.py]"]
end

subgraph group_processing["Conversion processing"]
  node_validation["File validation<br/>[validator.py]"]
  node_services["Conversion services"]
  node_factories["Strategy factories<br/>[factories.py]"]
  node_image_strategies["Image strategies<br/>[strategies.py]"]
  node_pdf_strategies["PDF strategies<br/>[strategies.py]"]
  node_zip_strategies["ZIP strategies<br/>[strategies.py]"]
end

subgraph group_infrastructure["Files and downloads"]
  node_storage[("Local file storage<br/>[local_storage.py]")]
end

subgraph group_runtime["Application runtime"]
  node_app_entry["FastAPI app<br/>[main.py]"]
  node_settings["Configuration<br/>[settings.py]"]
end

node_user(("User"))

node_user -->|"chooses tool"| node_tool_catalog
node_tool_catalog -.->|"opens tool"| node_tool_page
node_tool_page -.->|"presents form"| node_tool_form
node_tool_form -->|"renders picker"| node_file_picker
node_user -->|"selects files"| node_file_picker
node_tool_form -.->|"submits request"| node_api_client
node_api_client -.->|"sends request"| node_app_entry
node_app_entry -->|"registers routes"| node_image_routes
node_app_entry -->|"registers routes"| node_pdf_routes
node_app_entry -->|"registers routes"| node_zip_routes
node_app_entry -->|"registers routes"| node_download_routes
node_image_routes -->|"calls conversion"| node_services
node_pdf_routes -->|"calls PDF service"| node_services
node_zip_routes -->|"calls ZIP service"| node_services
node_services -->|"validates inputs"| node_validation
node_services -->|"gets strategy"| node_factories
node_factories -->|"dispatches image"| node_image_strategies
node_factories -->|"dispatches PDF"| node_pdf_strategies
node_factories -->|"dispatches ZIP"| node_zip_strategies
node_image_routes -->|"creates download link"| node_storage
node_pdf_routes -->|"creates download link"| node_storage
node_zip_routes -->|"creates download link"| node_storage
node_download_routes -->|"verifies signature"| node_storage
node_app_entry -->|"loads settings"| node_settings

click node_tool_catalog "https://github.com/surajvarma1/file_conversion/blob/main/frontend/src/app/page.tsx"
click node_tool_page "https://github.com/surajvarma1/file_conversion/blob/main/frontend/src/app/tools/%5Btool%5D/page.tsx"
click node_file_picker "https://github.com/surajvarma1/file_conversion/blob/main/frontend/src/components/tool/DragDrop.tsx"
click node_tool_form "https://github.com/surajvarma1/file_conversion/blob/main/frontend/src/components/tool/ToolForm.tsx"
click node_api_client "https://github.com/surajvarma1/file_conversion/blob/main/frontend/src/services/api.ts"
click node_app_entry "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/main.py"
click node_image_routes "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/api/v1/image_tools/routes.py"
click node_pdf_routes "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/api/v1/pdf_tools/routes.py"
click node_zip_routes "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/api/v1/zip_tools/routes.py"
click node_download_routes "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/api/v1/downloads/routes.py"
click node_validation "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/core/security/validator.py"
click node_services "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/application/services/conversion_services.py"
click node_factories "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/infrastructure/converters/factories.py"
click node_image_strategies "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/strategies/image/strategies.py"
click node_pdf_strategies "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/strategies/pdf/strategies.py"
click node_zip_strategies "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/strategies/zip/strategies.py"
click node_storage "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/infrastructure/file_storage/local_storage.py"
click node_settings "https://github.com/surajvarma1/file_conversion/blob/main/backend/app/core/config/settings.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_tool_catalog,node_tool_page,node_file_picker,node_tool_form,node_api_client,node_user toneBlue
class node_image_routes,node_pdf_routes,node_zip_routes,node_download_routes toneAmber
class node_validation,node_services,node_factories,node_image_strategies,node_pdf_strategies,node_zip_strategies toneMint
class node_storage toneRose
class node_app_entry,node_settings toneIndigo
```

## Components

### Tool interface

- [Tool catalog](https://github.com/surajvarma1/file_conversion/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Tool page](https://github.com/surajvarma1/file_conversion/blob/main/frontend/src/app/tools/%5Btool%5D/page.tsx): `frontend/src/app/tools/[tool]/page.tsx`
- [File picker](https://github.com/surajvarma1/file_conversion/blob/main/frontend/src/components/tool/DragDrop.tsx): `frontend/src/components/tool/DragDrop.tsx`
- [Tool form](https://github.com/surajvarma1/file_conversion/blob/main/frontend/src/components/tool/ToolForm.tsx): `frontend/src/components/tool/ToolForm.tsx`
- [API client](https://github.com/surajvarma1/file_conversion/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### API entry points

- [Image routes](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/api/v1/image_tools/routes.py): `backend/app/api/v1/image_tools/routes.py`
- [PDF routes](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/api/v1/pdf_tools/routes.py): `backend/app/api/v1/pdf_tools/routes.py`
- [ZIP routes](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/api/v1/zip_tools/routes.py): `backend/app/api/v1/zip_tools/routes.py`
- [Download routes](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/api/v1/downloads/routes.py): `backend/app/api/v1/downloads/routes.py`

### Conversion processing

- [File validation](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/core/security/validator.py): `backend/app/core/security/validator.py`
- [Conversion services](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/application/services/conversion_services.py): `backend/app/application/services/conversion_services.py`
- [Strategy factories](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/infrastructure/converters/factories.py): `backend/app/infrastructure/converters/factories.py`
- [Image strategies](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/strategies/image/strategies.py): `backend/app/strategies/image/strategies.py`
- [PDF strategies](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/strategies/pdf/strategies.py): `backend/app/strategies/pdf/strategies.py`
- [ZIP strategies](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/strategies/zip/strategies.py): `backend/app/strategies/zip/strategies.py`

### Files and downloads

- [Local file storage](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/infrastructure/file_storage/local_storage.py): `backend/app/infrastructure/file_storage/local_storage.py`

### Application runtime

- [FastAPI app](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/main.py): `backend/app/main.py`
- [Configuration](https://github.com/surajvarma1/file_conversion/blob/main/backend/app/core/config/settings.py): `backend/app/core/config/settings.py`

### Other components

- **User**

## Connections

- User → Tool catalog: chooses tool
- Tool catalog → Tool page: opens tool
- Tool page → Tool form: presents form
- Tool form → File picker: renders picker (evidence: `frontend/src/components/tool/ToolForm.tsx`)
- User → File picker: selects files (evidence: `frontend/src/components/tool/DragDrop.tsx`)
- Tool form → API client: submits request
- API client → FastAPI app: sends request
- FastAPI app → Image routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → PDF routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → ZIP routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Download routes: registers routes (evidence: `backend/app/main.py`)
- Image routes → Conversion services: calls conversion (evidence: `backend/app/api/v1/image_tools/routes.py`)
- PDF routes → Conversion services: calls PDF service (evidence: `backend/app/api/v1/pdf_tools/routes.py`)
- ZIP routes → Conversion services: calls ZIP service (evidence: `backend/app/api/v1/zip_tools/routes.py`)
- Conversion services → File validation: validates inputs (evidence: `backend/app/application/services/conversion_services.py`)
- Conversion services → Strategy factories: gets strategy (evidence: `backend/app/application/services/conversion_services.py`)
- Strategy factories → Image strategies: dispatches image (evidence: `backend/app/infrastructure/converters/factories.py`)
- Strategy factories → PDF strategies: dispatches PDF (evidence: `backend/app/infrastructure/converters/factories.py`)
- Strategy factories → ZIP strategies: dispatches ZIP (evidence: `backend/app/infrastructure/converters/factories.py`)
- Image routes → Local file storage: creates download link (evidence: `backend/app/api/v1/image_tools/routes.py`)
- PDF routes → Local file storage: creates download link (evidence: `backend/app/api/v1/pdf_tools/routes.py`)
- ZIP routes → Local file storage: creates download link (evidence: `backend/app/api/v1/zip_tools/routes.py`)
- Download routes → Local file storage: verifies signature (evidence: `backend/app/api/v1/downloads/routes.py`)
- FastAPI app → Configuration: loads settings (evidence: `backend/app/main.py`)
