# chenbin3625/opensync architecture

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

- Interactive diagram: https://gitdiagram.com/chenbin3625/opensync
- Repository: https://github.com/chenbin3625/opensync

## Overview

OpenSync is a visual scheduler and task manager for syncing storage exposed through AList/OpenList. Users configure engines and sync jobs, run them manually or on a schedule, then follow per-file progress and history; notifications and system settings support that workflow. The README documents the product capabilities, while excerpts show selected frontend routing, API, and realtime behavior. Backend service-to-service wiring is not excerpted, so uncertain internal links are omitted or marked unverified.

Main entry points: [`frontend/src/api/request.ts`](https://github.com/chenbin3625/opensync/blob/main/frontend/src/api/request.ts) (HTTP API client), [`frontend/src/router/index.tsx`](https://github.com/chenbin3625/opensync/blob/main/frontend/src/router/index.tsx) (Authenticated routes), [`backend/internal/handler`](https://github.com/chenbin3625/opensync/tree/main/backend/internal/handler) (HTTP handlers), [`backend/internal/service/task_executor.go`](https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/task_executor.go) (Task execution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_webapp["Web app shell<br/>[App.tsx]"]
  node_routing["Authenticated routes<br/>[index.tsx]"]
  node_jobui["Job management<br/>[index.tsx]"]
  node_taskdetail["Task history and detail<br/>[TaskDetail.tsx]"]
  node_realtimeui["Realtime task view<br/>[useRealtimeTask.ts]"]
  node_engineui["Engine management UI<br/>[index.tsx]"]
  node_notifyui["Notification settings UI<br/>[index.tsx]"]
  node_settingsui["System settings UI<br/>[index.tsx]"]
  node_api["HTTP API client<br/>[request.ts]"]
end

subgraph group_jobs["Sync task runtime"]
  node_http["HTTP handlers"]
  node_jobservice["Job management<br/>[job_service.go]"]
  node_scheduler["Job scheduler<br/>[job_scheduler.go]"]
  node_taskruntime["Task execution<br/>[task_executor.go]"]
  node_taskscan["Directory scanning<br/>[task_scan.go]"]
  node_copy["File transfer<br/>[copy_item.go]"]
end

subgraph group_integrations["Storage and notifications"]
  node_alist["AList/OpenList clients<br/>[alist_client.go]"]
  node_notify["Notification delivery<br/>[notify_service.go]"]
end

subgraph group_account["Accounts and settings"]
  node_auth["Authentication<br/>[auth.go]"]
  node_userservice["User and recovery<br/>[user_service.go]"]
  node_systemhandler["Runtime settings<br/>[system_handler.go]"]
end

subgraph group_data["Persistent data"]
  node_mapper["Database mappers"]
  node_sqlite[("SQLite data")]
end

node_operator(("NAS operator"))
node_externalstorage["AList/OpenList storage"]
node_notificationservices["Webhook and messaging services"]

node_operator -->|"uses"| node_webapp
node_webapp -->|"checks session"| node_api
node_webapp -->|"renders"| node_routing
node_routing -->|"routes to"| node_jobui
node_routing -->|"routes to"| node_taskdetail
node_routing -->|"routes to"| node_engineui
node_routing -->|"routes to"| node_notifyui
node_routing -->|"routes to"| node_settingsui
node_jobui -.->|"requests jobs"| node_api
node_taskdetail -.->|"requests history"| node_api
node_realtimeui -->|"fetches progress"| node_api
node_jobui -.->|"shows progress"| node_realtimeui
node_engineui -.->|"manages engines"| node_api
node_notifyui -->|"manages channels"| node_api
node_settingsui -.->|"updates settings"| node_api
node_api -->|"sends requests"| node_http
node_http -.->|"checks access"| node_auth
node_http -.->|"handles jobs"| node_jobservice
node_jobservice -.->|"schedules jobs"| node_scheduler
node_scheduler -.->|"starts runs"| node_taskruntime
node_jobservice -.->|"runs jobs"| node_taskruntime
node_taskruntime -.->|"scans paths"| node_taskscan
node_taskruntime -.->|"transfers files"| node_copy
node_taskscan -.->|"lists paths"| node_alist
node_copy -.->|"copies items"| node_alist
node_alist -->|"accesses storage"| node_externalstorage
node_http -.->|"configures channels"| node_notify
node_notify -->|"sends messages"| node_notificationservices
node_http -.->|"handles accounts"| node_userservice
node_http -.->|"handles settings"| node_systemhandler
node_jobservice -.->|"persists jobs"| node_mapper
node_taskruntime -.->|"persists history"| node_mapper
node_userservice -.->|"persists users"| node_mapper
node_systemhandler -.->|"persists settings"| node_mapper
node_mapper -.->|"reads and writes"| node_sqlite

click node_webapp "https://github.com/chenbin3625/opensync/blob/main/frontend/src/App.tsx"
click node_routing "https://github.com/chenbin3625/opensync/blob/main/frontend/src/router/index.tsx"
click node_jobui "https://github.com/chenbin3625/opensync/blob/main/frontend/src/pages/Home/index.tsx"
click node_taskdetail "https://github.com/chenbin3625/opensync/blob/main/frontend/src/pages/Home/TaskDetail.tsx"
click node_realtimeui "https://github.com/chenbin3625/opensync/blob/main/frontend/src/pages/Home/useRealtimeTask.ts"
click node_engineui "https://github.com/chenbin3625/opensync/blob/main/frontend/src/pages/Engine/index.tsx"
click node_notifyui "https://github.com/chenbin3625/opensync/blob/main/frontend/src/pages/Notify/index.tsx"
click node_settingsui "https://github.com/chenbin3625/opensync/blob/main/frontend/src/pages/Setting/index.tsx"
click node_api "https://github.com/chenbin3625/opensync/blob/main/frontend/src/api/request.ts"
click node_http "https://github.com/chenbin3625/opensync/tree/main/backend/internal/handler"
click node_auth "https://github.com/chenbin3625/opensync/blob/main/backend/internal/middleware/auth.go"
click node_jobservice "https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/job_service.go"
click node_scheduler "https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/job_scheduler.go"
click node_taskruntime "https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/task_executor.go"
click node_taskscan "https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/task_scan.go"
click node_copy "https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/copy_item.go"
click node_alist "https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/alist_client.go"
click node_notify "https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/notify_service.go"
click node_userservice "https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/user_service.go"
click node_systemhandler "https://github.com/chenbin3625/opensync/blob/main/backend/internal/handler/system_handler.go"
click node_mapper "https://github.com/chenbin3625/opensync/tree/main/backend/internal/mapper"

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_routing,node_jobui,node_taskdetail,node_realtimeui,node_engineui,node_notifyui,node_settingsui,node_api toneBlue
class node_http,node_jobservice,node_scheduler,node_taskruntime,node_taskscan,node_copy,node_externalstorage toneAmber
class node_alist,node_notify,node_notificationservices toneMint
class node_auth,node_userservice,node_systemhandler toneRose
class node_mapper,node_sqlite,node_operator toneIndigo
```

## Components

### Web application

- [Web app shell](https://github.com/chenbin3625/opensync/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Authenticated routes](https://github.com/chenbin3625/opensync/blob/main/frontend/src/router/index.tsx): `frontend/src/router/index.tsx`
- [Job management](https://github.com/chenbin3625/opensync/blob/main/frontend/src/pages/Home/index.tsx): `frontend/src/pages/Home/index.tsx`
- [Task history and detail](https://github.com/chenbin3625/opensync/blob/main/frontend/src/pages/Home/TaskDetail.tsx): `frontend/src/pages/Home/TaskDetail.tsx`
- [Realtime task view](https://github.com/chenbin3625/opensync/blob/main/frontend/src/pages/Home/useRealtimeTask.ts): `frontend/src/pages/Home/useRealtimeTask.ts`
- [Engine management UI](https://github.com/chenbin3625/opensync/blob/main/frontend/src/pages/Engine/index.tsx): `frontend/src/pages/Engine/index.tsx`
- [Notification settings UI](https://github.com/chenbin3625/opensync/blob/main/frontend/src/pages/Notify/index.tsx): `frontend/src/pages/Notify/index.tsx`
- [System settings UI](https://github.com/chenbin3625/opensync/blob/main/frontend/src/pages/Setting/index.tsx): `frontend/src/pages/Setting/index.tsx`
- [HTTP API client](https://github.com/chenbin3625/opensync/blob/main/frontend/src/api/request.ts): `frontend/src/api/request.ts`

### Sync task runtime

- [HTTP handlers](https://github.com/chenbin3625/opensync/tree/main/backend/internal/handler): `backend/internal/handler`
- [Job management](https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/job_service.go): `backend/internal/service/job_service.go`
- [Job scheduler](https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/job_scheduler.go): `backend/internal/service/job_scheduler.go`
- [Task execution](https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/task_executor.go): `backend/internal/service/task_executor.go`
- [Directory scanning](https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/task_scan.go): `backend/internal/service/task_scan.go`
- [File transfer](https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/copy_item.go): `backend/internal/service/copy_item.go`

### Storage and notifications

- [AList/OpenList clients](https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/alist_client.go): `backend/internal/service/alist_client.go`
- [Notification delivery](https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/notify_service.go): `backend/internal/service/notify_service.go`

### Accounts and settings

- [Authentication](https://github.com/chenbin3625/opensync/blob/main/backend/internal/middleware/auth.go): `backend/internal/middleware/auth.go`
- [User and recovery](https://github.com/chenbin3625/opensync/blob/main/backend/internal/service/user_service.go): `backend/internal/service/user_service.go`
- [Runtime settings](https://github.com/chenbin3625/opensync/blob/main/backend/internal/handler/system_handler.go): `backend/internal/handler/system_handler.go`

### Persistent data

- [Database mappers](https://github.com/chenbin3625/opensync/tree/main/backend/internal/mapper): `backend/internal/mapper`
- **SQLite data**

### Other components

- **NAS operator**
- **AList/OpenList storage**
- **Webhook and messaging services**

## Connections

- NAS operator → Web app shell: uses (evidence: `README.md`)
- Web app shell → HTTP API client: checks session (evidence: `frontend/src/App.tsx`)
- Web app shell → Authenticated routes: renders (evidence: `frontend/src/App.tsx`)
- Authenticated routes → Job management: routes to (evidence: `frontend/src/router/index.tsx`)
- Authenticated routes → Task history and detail: routes to (evidence: `frontend/src/router/index.tsx`)
- Authenticated routes → Engine management UI: routes to (evidence: `frontend/src/router/index.tsx`)
- Authenticated routes → Notification settings UI: routes to (evidence: `frontend/src/router/index.tsx`)
- Authenticated routes → System settings UI: routes to (evidence: `frontend/src/router/index.tsx`)
- Job management → HTTP API client: requests jobs
- Task history and detail → HTTP API client: requests history
- Realtime task view → HTTP API client: fetches progress (evidence: `frontend/src/pages/Home/useRealtimeTask.ts`)
- Job management → Realtime task view: shows progress
- Engine management UI → HTTP API client: manages engines
- Notification settings UI → HTTP API client: manages channels (evidence: `frontend/src/pages/Notify/index.tsx`)
- System settings UI → HTTP API client: updates settings
- HTTP API client → HTTP handlers: sends requests (evidence: `README.md`)
- HTTP handlers → Authentication: checks access
- HTTP handlers → Job management: handles jobs
- Job management → Job scheduler: schedules jobs
- Job scheduler → Task execution: starts runs
- Job management → Task execution: runs jobs
- Task execution → Directory scanning: scans paths
- Task execution → File transfer: transfers files
- Directory scanning → AList/OpenList clients: lists paths
- File transfer → AList/OpenList clients: copies items
- AList/OpenList clients → AList/OpenList storage: accesses storage (evidence: `README.md`)
- HTTP handlers → Notification delivery: configures channels
- Notification delivery → Webhook and messaging services: sends messages (evidence: `README.md`)
- HTTP handlers → User and recovery: handles accounts
- HTTP handlers → Runtime settings: handles settings
- Job management → Database mappers: persists jobs
- Task execution → Database mappers: persists history
- User and recovery → Database mappers: persists users
- Runtime settings → Database mappers: persists settings
- Database mappers → SQLite data: reads and writes
