# keven1024/015 architecture

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

- Interactive diagram: https://gitdiagram.com/keven1024/015
- Repository: https://github.com/keven1024/015

## Overview

015 is a self-hosted temporary file and text sharing platform. Users upload files in chunks or submit text; the frontend hashes files for instant-transfer checks and reports upload progress. The API manages files, shares, access and downloads, while queued worker tasks handle lifecycle cleanup and image/text processing. Redis-backed models hold file, share, relationship and statistics data. README capabilities are included, but several backend routes and worker handlers were not sampled, so uncertain internal call links are omitted.

Main entry points: [`backend/route.go`](https://github.com/keven1024/015/blob/main/backend/route.go) (HTTP routing), [`worker/main.go`](https://github.com/keven1024/015/blob/main/worker/main.go) (Task dispatcher), [`backend/internal/controllers/share.go`](https://github.com/keven1024/015/blob/main/backend/internal/controllers/share.go) (Share API), [`backend/internal/controllers/download.go`](https://github.com/keven1024/015/blob/main/backend/internal/controllers/download.go) (Download API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["Nuxt application<br/>[app.vue]"]
  node_upload_ui["Upload interface"]
  node_text_ui["Text interface"]
  node_file_tools["Hash and chunks<br/>[calcFileHash.ts]"]
  node_share_ui["Share views<br/>[FileShareView.vue]"]
  node_share_client["Share and download client<br/>[useMyAppShare.ts]"]
  node_result_ui["Processing results"]
end

subgraph group_api["API service"]
  node_api_routes["HTTP routing<br/>[route.go]"]
  node_file_controller["File API<br/>[file.go]"]
  node_share_controller["Share API<br/>[share.go]"]
  node_download_controller["Download API<br/>[download.go]"]
  node_task_controller["Task API<br/>[task.go]"]
  node_file_service["File service<br/>[file.go]"]
end

subgraph group_domain["Domain data"]
  node_file_model[("File metadata<br/>[service.go]")]
  node_share_model[("Share metadata<br/>[service.go]")]
  node_relation_model[("File-share links<br/>[service.go]")]
  node_stat_model[("Usage statistics<br/>[service.go]")]
end

subgraph group_async["Async processing"]
  node_worker_main["Task dispatcher<br/>[main.go]"]
  node_file_tasks["File lifecycle tasks<br/>[file.go]"]
  node_image_tasks["Image tasks<br/>[image.go]"]
  node_text_tasks["Text tasks<br/>[text.go]"]
  node_image_service["Image processing<br/>[image.go]"]
  node_text_service["Text processing<br/>[text.go]"]
end

subgraph group_integrations["External infrastructure"]
  node_redis[("Redis")]
  node_task_queue["Asynq queue"]
  node_file_storage[("Local file storage")]
  node_mail_service["Email delivery<br/>[mail.go]"]
end

node_visitor(("Visitor"))

node_visitor -->|"uses"| node_webapp
node_webapp -->|"selects files"| node_upload_ui
node_webapp -->|"submits text"| node_text_ui
node_upload_ui -->|"hashes and chunks"| node_file_tools
node_upload_ui -->|"uploads"| node_api_routes
node_text_ui -->|"submits text"| node_api_routes
node_share_ui -->|"requests access"| node_share_client
node_share_client -->|"calls API"| node_api_routes
node_api_routes -->|"dispatches"| node_file_controller
node_api_routes -->|"dispatches"| node_share_controller
node_api_routes -->|"dispatches"| node_download_controller
node_api_routes -->|"dispatches"| node_task_controller
node_file_controller -->|"delegates"| node_file_service
node_file_service -->|"reads and writes"| node_file_model
node_file_controller -->|"stores files"| node_file_storage
node_share_controller -->|"reads and writes"| node_share_model
node_share_controller -->|"links files"| node_relation_model
node_download_controller -->|"checks share"| node_share_model
node_download_controller -->|"resolves files"| node_file_model
node_download_controller -->|"reads files"| node_file_storage
node_task_controller -->|"enqueues tasks"| node_task_queue
node_worker_main -->|"consumes tasks"| node_task_queue
node_worker_main -->|"dispatches"| node_file_tasks
node_worker_main -->|"dispatches"| node_image_tasks
node_worker_main -->|"dispatches"| node_text_tasks
node_file_tasks -->|"manages files"| node_file_storage
node_image_tasks -->|"delegates"| node_image_service
node_text_tasks -->|"delegates"| node_text_service
node_file_tasks -->|"updates metadata"| node_file_model
node_share_controller -.->|"queues share work"| node_task_queue
node_image_service -->|"processes images"| node_file_storage
node_text_service -.->|"returns results"| node_result_ui
node_task_controller -.->|"records statistics"| node_stat_model
node_file_model -->|"stores metadata"| node_redis
node_share_model -->|"stores metadata"| node_redis
node_relation_model -->|"stores links"| node_redis
node_stat_model -->|"stores statistics"| node_redis
node_file_tasks -.->|"sends notices"| node_mail_service

click node_webapp "https://github.com/keven1024/015/blob/main/front/app.vue"
click node_upload_ui "https://github.com/keven1024/015/blob/main/front/components/Home/File/FileUploadIndexView.vue"
click node_text_ui "https://github.com/keven1024/015/blob/main/front/components/Home/Text/TextUploadIndexView.vue"
click node_file_tools "https://github.com/keven1024/015/blob/main/front/lib/calcFileHash.ts"
click node_share_ui "https://github.com/keven1024/015/blob/main/front/components/Share/FileShareView.vue"
click node_share_client "https://github.com/keven1024/015/blob/main/front/composables/useMyAppShare.ts"
click node_result_ui "https://github.com/keven1024/015/blob/main/front/components/Result/ResultIndexView.vue"
click node_api_routes "https://github.com/keven1024/015/blob/main/backend/route.go"
click node_file_controller "https://github.com/keven1024/015/blob/main/backend/internal/controllers/file.go"
click node_share_controller "https://github.com/keven1024/015/blob/main/backend/internal/controllers/share.go"
click node_download_controller "https://github.com/keven1024/015/blob/main/backend/internal/controllers/download.go"
click node_task_controller "https://github.com/keven1024/015/blob/main/backend/internal/controllers/task.go"
click node_file_service "https://github.com/keven1024/015/blob/main/backend/internal/services/file.go"
click node_file_model "https://github.com/keven1024/015/blob/main/pkg/models/file/service.go"
click node_share_model "https://github.com/keven1024/015/blob/main/pkg/models/share/service.go"
click node_relation_model "https://github.com/keven1024/015/blob/main/pkg/models/file_share_relational/service.go"
click node_stat_model "https://github.com/keven1024/015/blob/main/pkg/models/stat/service.go"
click node_worker_main "https://github.com/keven1024/015/blob/main/worker/main.go"
click node_file_tasks "https://github.com/keven1024/015/blob/main/worker/internal/tasks/file.go"
click node_image_tasks "https://github.com/keven1024/015/blob/main/worker/internal/tasks/image.go"
click node_text_tasks "https://github.com/keven1024/015/blob/main/worker/internal/tasks/text.go"
click node_image_service "https://github.com/keven1024/015/blob/main/worker/internal/services/image.go"
click node_text_service "https://github.com/keven1024/015/blob/main/worker/internal/services/text.go"
click node_mail_service "https://github.com/keven1024/015/blob/main/pkg/mail/mail.go"

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_webapp,node_upload_ui,node_text_ui,node_file_tools,node_share_ui,node_share_client,node_result_ui toneBlue
class node_api_routes,node_file_controller,node_share_controller,node_download_controller,node_task_controller,node_file_service toneAmber
class node_file_model,node_share_model,node_relation_model,node_stat_model toneMint
class node_worker_main,node_file_tasks,node_image_tasks,node_text_tasks,node_image_service,node_text_service toneRose
class node_redis,node_task_queue,node_file_storage,node_mail_service,node_visitor toneIndigo
```

## Components

### Web client

- [Nuxt application](https://github.com/keven1024/015/blob/main/front/app.vue): `front/app.vue`
- [Upload interface](https://github.com/keven1024/015/blob/main/front/components/Home/File/FileUploadIndexView.vue): `front/components/Home/File/FileUploadIndexView.vue`
- [Text interface](https://github.com/keven1024/015/blob/main/front/components/Home/Text/TextUploadIndexView.vue): `front/components/Home/Text/TextUploadIndexView.vue`
- [Hash and chunks](https://github.com/keven1024/015/blob/main/front/lib/calcFileHash.ts): `front/lib/calcFileHash.ts`
- [Share views](https://github.com/keven1024/015/blob/main/front/components/Share/FileShareView.vue): `front/components/Share/FileShareView.vue`
- [Share and download client](https://github.com/keven1024/015/blob/main/front/composables/useMyAppShare.ts): `front/composables/useMyAppShare.ts`
- [Processing results](https://github.com/keven1024/015/blob/main/front/components/Result/ResultIndexView.vue): `front/components/Result/ResultIndexView.vue`

### API service

- [HTTP routing](https://github.com/keven1024/015/blob/main/backend/route.go): `backend/route.go`
- [File API](https://github.com/keven1024/015/blob/main/backend/internal/controllers/file.go): `backend/internal/controllers/file.go`
- [Share API](https://github.com/keven1024/015/blob/main/backend/internal/controllers/share.go): `backend/internal/controllers/share.go`
- [Download API](https://github.com/keven1024/015/blob/main/backend/internal/controllers/download.go): `backend/internal/controllers/download.go`
- [Task API](https://github.com/keven1024/015/blob/main/backend/internal/controllers/task.go): `backend/internal/controllers/task.go`
- [File service](https://github.com/keven1024/015/blob/main/backend/internal/services/file.go): `backend/internal/services/file.go`

### Domain data

- [File metadata](https://github.com/keven1024/015/blob/main/pkg/models/file/service.go): `pkg/models/file/service.go`
- [Share metadata](https://github.com/keven1024/015/blob/main/pkg/models/share/service.go): `pkg/models/share/service.go`
- [File-share links](https://github.com/keven1024/015/blob/main/pkg/models/file_share_relational/service.go): `pkg/models/file_share_relational/service.go`
- [Usage statistics](https://github.com/keven1024/015/blob/main/pkg/models/stat/service.go): `pkg/models/stat/service.go`

### Async processing

- [Task dispatcher](https://github.com/keven1024/015/blob/main/worker/main.go): `worker/main.go`
- [File lifecycle tasks](https://github.com/keven1024/015/blob/main/worker/internal/tasks/file.go): `worker/internal/tasks/file.go`
- [Image tasks](https://github.com/keven1024/015/blob/main/worker/internal/tasks/image.go): `worker/internal/tasks/image.go`
- [Text tasks](https://github.com/keven1024/015/blob/main/worker/internal/tasks/text.go): `worker/internal/tasks/text.go`
- [Image processing](https://github.com/keven1024/015/blob/main/worker/internal/services/image.go): `worker/internal/services/image.go`
- [Text processing](https://github.com/keven1024/015/blob/main/worker/internal/services/text.go): `worker/internal/services/text.go`

### External infrastructure

- **Redis**
- **Asynq queue**
- **Local file storage**
- [Email delivery](https://github.com/keven1024/015/blob/main/pkg/mail/mail.go): `pkg/mail/mail.go`

### Other components

- **Visitor**

## Connections

- Visitor → Nuxt application: uses
- Nuxt application → Upload interface: selects files
- Nuxt application → Text interface: submits text
- Upload interface → Hash and chunks: hashes and chunks
- Upload interface → HTTP routing: uploads
- Text interface → HTTP routing: submits text
- Share views → Share and download client: requests access
- Share and download client → HTTP routing: calls API
- HTTP routing → File API: dispatches
- HTTP routing → Share API: dispatches
- HTTP routing → Download API: dispatches
- HTTP routing → Task API: dispatches
- File API → File service: delegates
- File service → File metadata: reads and writes
- File API → Local file storage: stores files
- Share API → Share metadata: reads and writes
- Share API → File-share links: links files
- Download API → Share metadata: checks share
- Download API → File metadata: resolves files
- Download API → Local file storage: reads files
- Task API → Asynq queue: enqueues tasks
- Task dispatcher → Asynq queue: consumes tasks
- Task dispatcher → File lifecycle tasks: dispatches
- Task dispatcher → Image tasks: dispatches
- Task dispatcher → Text tasks: dispatches
- File lifecycle tasks → Local file storage: manages files
- Image tasks → Image processing: delegates
- Text tasks → Text processing: delegates
- File lifecycle tasks → File metadata: updates metadata
- Share API → Asynq queue: queues share work
- Image processing → Local file storage: processes images
- Text processing → Processing results: returns results
- Task API → Usage statistics: records statistics
- File metadata → Redis: stores metadata
- Share metadata → Redis: stores metadata
- File-share links → Redis: stores links
- Usage statistics → Redis: stores statistics
- File lifecycle tasks → Email delivery: sends notices
