# injaeryou/resumable-upload architecture

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

- Interactive diagram: https://gitdiagram.com/injaeryou/resumable-upload
- Repository: https://github.com/injaeryou/resumable-upload

## Overview

Resumable Upload is a Python TUS v1.0.0 library providing both upload clients and a server. The main workflow sends chunked uploads from a client to the server, which validates protocol requests and persists upload state and data; clients can resume interrupted uploads using fingerprints and stored URLs. The graph also includes async and parallel/concatenation capabilities, download serving, adapters, CLI, observability, and optional storage and locking backends. Edges are limited to relationships supported by the README or source-index references; some unsampled handler and backend details are therefore not expanded.

Main entry points: [`resumable_upload/client/client.py`](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/client.py) (Sync client), [`resumable_upload/server/core.py`](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/server/core.py) (Protocol core), [`resumable_upload/client/aio/client.py`](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/aio/client.py) (Async client), [`resumable_upload/client/uploader.py`](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/uploader.py) (Chunk uploader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Upload clients"]
  node_sync_client["Sync client<br/>[client.py]"]
  node_async_client["Async client<br/>[client.py]"]
  node_uploader["Chunk uploader<br/>[uploader.py]"]
  node_async_uploader["Async uploader<br/>[uploader.py]"]
  node_client_protocol["Protocol helpers<br/>[_protocol.py]"]
  node_file_slice["File slicing<br/>[_fileslice.py]"]
  node_parallel["Parallel uploads<br/>[parallel.py]"]
  node_concatenation["Upload concatenation<br/>[concatenation.py]"]
  node_upload_stats["Progress statistics<br/>[stats.py]"]
  node_fingerprint["File fingerprint<br/>[fingerprint.py]"]
end

subgraph group_server["TUS server"]
  node_tus_server["TUS server<br/>[server.py]"]
  node_server_core["Protocol core<br/>[core.py]"]
  node_handlers["Request handlers"]
  node_headers["Protocol headers<br/>[headers.py]"]
  node_checksum["Chunk checksums<br/>[checksum.py]"]
  node_metrics["Server metrics<br/>[metrics.py]"]
end

subgraph group_persistence["Persistence and coordination"]
  node_url_storage[("URL persistence")]
  node_storage_api["Storage interface<br/>[base.py]"]
  node_sqlite_storage[("SQLite storage<br/>[sqlite_storage.py]")]
  node_cloud_storage[("Cloud storage backends")]
  node_locks["Lock backends"]
end

subgraph group_interfaces["Interfaces and operations"]
  node_http_handler["HTTP handler<br/>[http_handler.py]"]
  node_asgi["ASGI adapter<br/>[asgi.py]"]
  node_cli["CLI<br/>[cli.py]"]
end

node_user(("Application user"))
node_http_client(("HTTP upload endpoint"))
node_completed_download(("Completed uploads"))

node_user -->|"starts upload"| node_sync_client
node_user -->|"starts upload"| node_async_client
node_sync_client -->|"uses helpers"| node_client_protocol
node_async_client -->|"uses helpers"| node_client_protocol
node_sync_client -->|"creates uploader"| node_uploader
node_async_client -->|"creates uploader"| node_async_uploader
node_sync_client -->|"fingerprints files"| node_fingerprint
node_async_client -->|"fingerprints files"| node_fingerprint
node_sync_client -->|"stores upload URLs"| node_url_storage
node_async_client -->|"stores upload URLs"| node_url_storage
node_uploader -->|"reads slices"| node_file_slice
node_async_uploader -->|"reads slices"| node_file_slice
node_sync_client -->|"supports parallel"| node_parallel
node_sync_client -->|"supports concatenation"| node_concatenation
node_uploader -->|"tracks progress"| node_upload_stats
node_async_uploader -->|"tracks progress"| node_upload_stats
node_sync_client -->|"sends requests"| node_http_client
node_async_client -->|"sends requests"| node_http_client
node_http_client -->|"sends TUS requests"| node_http_handler
node_http_handler -->|"dispatches requests"| node_tus_server
node_asgi -->|"awaits requests"| node_server_core
node_cli -->|"runs server"| node_tus_server
node_cli -->|"runs client"| node_sync_client
node_tus_server -->|"inherits protocol core"| node_server_core
node_server_core -->|"dispatches methods"| node_handlers
node_server_core -->|"uses headers"| node_headers
node_server_core -->|"validates checksums"| node_checksum
node_server_core -->|"records metrics"| node_metrics
node_server_core -->|"reads and writes"| node_storage_api
node_server_core -->|"coordinates writes"| node_locks
node_storage_api -->|"implemented by"| node_sqlite_storage
node_storage_api -->|"implemented by"| node_cloud_storage
node_locks -->|"serializes writes"| node_server_core
node_completed_download -->|"requests download"| node_http_handler

click node_sync_client "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/client.py"
click node_async_client "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/aio/client.py"
click node_uploader "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/uploader.py"
click node_async_uploader "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/aio/uploader.py"
click node_client_protocol "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/_protocol.py"
click node_file_slice "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/_fileslice.py"
click node_parallel "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/parallel.py"
click node_concatenation "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/concatenation.py"
click node_upload_stats "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/stats.py"
click node_fingerprint "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/fingerprint.py"
click node_url_storage "https://github.com/injaeryou/resumable-upload/tree/main/resumable_upload/url_storage"
click node_http_handler "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/server/http_handler.py"
click node_asgi "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/asgi.py"
click node_cli "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/cli.py"
click node_tus_server "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/server/server.py"
click node_server_core "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/server/core.py"
click node_handlers "https://github.com/injaeryou/resumable-upload/tree/main/resumable_upload/server/handlers"
click node_headers "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/server/headers.py"
click node_checksum "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/checksum.py"
click node_metrics "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/metrics.py"
click node_storage_api "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/storage/base.py"
click node_sqlite_storage "https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/storage/sqlite_storage.py"
click node_cloud_storage "https://github.com/injaeryou/resumable-upload/tree/main/resumable_upload/storage"
click node_locks "https://github.com/injaeryou/resumable-upload/tree/main/resumable_upload/locks"

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_sync_client,node_async_client,node_uploader,node_async_uploader,node_client_protocol,node_file_slice,node_parallel,node_concatenation,node_upload_stats,node_fingerprint,node_user toneBlue
class node_tus_server,node_server_core,node_handlers,node_headers,node_checksum,node_metrics toneAmber
class node_url_storage,node_storage_api,node_sqlite_storage,node_cloud_storage,node_locks toneMint
class node_http_handler,node_asgi,node_cli toneRose
class node_http_client,node_completed_download toneIndigo
```

## Components

### Upload clients

- [Sync client](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/client.py): `resumable_upload/client/client.py`
- [Async client](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/aio/client.py): `resumable_upload/client/aio/client.py`
- [Chunk uploader](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/uploader.py): `resumable_upload/client/uploader.py`
- [Async uploader](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/aio/uploader.py): `resumable_upload/client/aio/uploader.py`
- [Protocol helpers](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/_protocol.py): `resumable_upload/client/_protocol.py`
- [File slicing](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/_fileslice.py): `resumable_upload/client/_fileslice.py`
- [Parallel uploads](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/parallel.py): `resumable_upload/client/parallel.py`
- [Upload concatenation](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/concatenation.py): `resumable_upload/client/concatenation.py`
- [Progress statistics](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/client/stats.py): `resumable_upload/client/stats.py`
- [File fingerprint](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/fingerprint.py): `resumable_upload/fingerprint.py`

### TUS server

- [TUS server](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/server/server.py): `resumable_upload/server/server.py`
- [Protocol core](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/server/core.py): `resumable_upload/server/core.py`
- [Request handlers](https://github.com/injaeryou/resumable-upload/tree/main/resumable_upload/server/handlers): `resumable_upload/server/handlers`
- [Protocol headers](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/server/headers.py): `resumable_upload/server/headers.py`
- [Chunk checksums](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/checksum.py): `resumable_upload/checksum.py`
- [Server metrics](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/metrics.py): `resumable_upload/metrics.py`

### Persistence and coordination

- [URL persistence](https://github.com/injaeryou/resumable-upload/tree/main/resumable_upload/url_storage): `resumable_upload/url_storage`
- [Storage interface](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/storage/base.py): `resumable_upload/storage/base.py`
- [SQLite storage](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/storage/sqlite_storage.py): `resumable_upload/storage/sqlite_storage.py`
- [Cloud storage backends](https://github.com/injaeryou/resumable-upload/tree/main/resumable_upload/storage): `resumable_upload/storage`
- [Lock backends](https://github.com/injaeryou/resumable-upload/tree/main/resumable_upload/locks): `resumable_upload/locks`

### Interfaces and operations

- [HTTP handler](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/server/http_handler.py): `resumable_upload/server/http_handler.py`
- [ASGI adapter](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/asgi.py): `resumable_upload/asgi.py`
- [CLI](https://github.com/injaeryou/resumable-upload/blob/main/resumable_upload/cli.py): `resumable_upload/cli.py`

### Other components

- **Application user**
- **HTTP upload endpoint**
- **Completed uploads**

## Connections

- Application user → Sync client: starts upload (evidence: `README.md`)
- Application user → Async client: starts upload (evidence: `README.md`)
- Sync client → Protocol helpers: uses helpers (evidence: `resumable_upload/client/client.py`)
- Async client → Protocol helpers: uses helpers (evidence: `resumable_upload/client/aio/client.py`)
- Sync client → Chunk uploader: creates uploader (evidence: `resumable_upload/client/client.py`)
- Async client → Async uploader: creates uploader (evidence: `resumable_upload/client/aio/client.py`)
- Sync client → File fingerprint: fingerprints files (evidence: `resumable_upload/client/client.py`)
- Async client → File fingerprint: fingerprints files (evidence: `resumable_upload/client/aio/client.py`)
- Sync client → URL persistence: stores upload URLs (evidence: `README.md`)
- Async client → URL persistence: stores upload URLs (evidence: `resumable_upload/client/aio/client.py`)
- Chunk uploader → File slicing: reads slices (evidence: `resumable_upload/client/uploader.py`)
- Async uploader → File slicing: reads slices (evidence: `resumable_upload/client/aio/client.py`)
- Sync client → Parallel uploads: supports parallel (evidence: `resumable_upload/client/client.py`)
- Sync client → Upload concatenation: supports concatenation (evidence: `resumable_upload/client/client.py`)
- Chunk uploader → Progress statistics: tracks progress (evidence: `resumable_upload/client/uploader.py`)
- Async uploader → Progress statistics: tracks progress (evidence: `resumable_upload/client/aio/uploader.py`)
- Sync client → HTTP upload endpoint: sends requests (evidence: `README.md`)
- Async client → HTTP upload endpoint: sends requests (evidence: `README.md`)
- HTTP upload endpoint → HTTP handler: sends TUS requests (evidence: `README.md`)
- HTTP handler → TUS server: dispatches requests (evidence: `resumable_upload/server/http_handler.py`)
- ASGI adapter → Protocol core: awaits requests (evidence: `README.md`)
- CLI → TUS server: runs server (evidence: `resumable_upload/cli.py`)
- CLI → Sync client: runs client (evidence: `resumable_upload/cli.py`)
- TUS server → Protocol core: inherits protocol core (evidence: `resumable_upload/server/server.py`)
- Protocol core → Request handlers: dispatches methods (evidence: `resumable_upload/server/core.py`)
- Protocol core → Protocol headers: uses headers (evidence: `resumable_upload/server/core.py`)
- Protocol core → Chunk checksums: validates checksums (evidence: `resumable_upload/server/core.py`)
- Protocol core → Server metrics: records metrics (evidence: `resumable_upload/server/core.py`)
- Protocol core → Storage interface: reads and writes (evidence: `resumable_upload/server/core.py`)
- Protocol core → Lock backends: coordinates writes (evidence: `resumable_upload/server/core.py`)
- Storage interface → SQLite storage: implemented by (evidence: `resumable_upload/storage/__init__.py`)
- Storage interface → Cloud storage backends: implemented by (evidence: `resumable_upload/storage/__init__.py`)
- Lock backends → Protocol core: serializes writes (evidence: `resumable_upload/server/server.py`)
- Completed uploads → HTTP handler: requests download (evidence: `README.md`)
