# alistgo/alist architecture

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

- Interactive diagram: https://gitdiagram.com/alistgo/alist
- Repository: https://github.com/alistgo/alist

## Overview

AList is a self-hosted file-list and file-access service that unifies local and cloud storage behind mounted paths. Its central workflow is a client request routed through HTTP handlers to filesystem operations and a selected storage driver, with storage configuration persisted in the database. It also provides search, sharing and authentication, offline downloads, and alternate access interfaces such as WebDAV, S3, FTP/SFTP, and MCP. The graph reflects documented capabilities; unsampled subsystems are shown at their existing directory paths, and edges are limited to relationships evidenced by excerpts, the source index, or the README.

Main entry points: [`server/handles`](https://github.com/alistgo/alist/tree/main/server/handles) (Request Handlers), [`internal/op/storage.go`](https://github.com/alistgo/alist/blob/main/internal/op/storage.go) (Storage Operations), [`server/router.go`](https://github.com/alistgo/alist/blob/main/server/router.go) (HTTP API), [`internal/offline_download`](https://github.com/alistgo/alist/tree/main/internal/offline_download) (Offline Downloads)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access Interfaces"]
  node_http["HTTP API<br/>[router.go]"]
  node_handlers["Request Handlers"]
  node_webdav["WebDAV<br/>[webdav.go]"]
  node_s3["S3 Interface"]
  node_ftp["FTP / SFTP"]
  node_mcp["MCP Tools"]
end

subgraph group_domain["File Services"]
  node_filesystem["Filesystem Operations"]
  node_search["Search"]
  node_sharing["Sharing"]
  node_offline["Offline Downloads"]
end

subgraph group_storage["Storage Layer"]
  node_storage_ops["Storage Operations<br/>[storage.go]"]
  node_drivers["Storage Drivers"]
  node_database[("Database")]
end

subgraph group_support["Platform Services"]
  node_bootstrap["Startup Loading<br/>[storage.go]"]
  node_auth["Authentication<br/>[authn.go]"]
  node_tasks["Task Manager<br/>[manager.go]"]
end

node_client(("Client"))

node_client -->|"requests"| node_http
node_http -->|"routes to"| node_handlers
node_handlers -->|"manages storage"| node_storage_ops
node_handlers -->|"queries"| node_database
node_handlers -.->|"serves file actions"| node_filesystem
node_webdav -->|"uses"| node_filesystem
node_mcp -.->|"exposes tools"| node_handlers
node_storage_ops -->|"persists storage"| node_database
node_storage_ops -->|"loads driver"| node_drivers
node_bootstrap -->|"loads enabled storages"| node_database
node_bootstrap -->|"initializes storage"| node_storage_ops
node_search -->|"searches files"| node_storage_ops
node_offline -->|"uses cloud driver"| node_drivers
node_offline -->|"creates download folder"| node_filesystem
node_tasks -.->|"runs downloads"| node_offline
node_client -->|"accesses files"| node_webdav
node_client -.->|"accesses files"| node_s3
node_client -.->|"accesses files"| node_ftp
node_client -.->|"uses tools"| node_mcp
node_client -.->|"searches files"| node_search
node_client -.->|"shares files"| node_sharing
node_http -.->|"protects routes"| node_auth

click node_http "https://github.com/alistgo/alist/blob/main/server/router.go"
click node_handlers "https://github.com/alistgo/alist/tree/main/server/handles"
click node_webdav "https://github.com/alistgo/alist/blob/main/server/webdav/webdav.go"
click node_s3 "https://github.com/alistgo/alist/tree/main/server/s3"
click node_ftp "https://github.com/alistgo/alist/tree/main/server"
click node_mcp "https://github.com/alistgo/alist/tree/main/server/mcp"
click node_filesystem "https://github.com/alistgo/alist/tree/main/internal/fs"
click node_search "https://github.com/alistgo/alist/tree/main/internal/search"
click node_sharing "https://github.com/alistgo/alist/tree/main/internal/share"
click node_offline "https://github.com/alistgo/alist/tree/main/internal/offline_download"
click node_storage_ops "https://github.com/alistgo/alist/blob/main/internal/op/storage.go"
click node_drivers "https://github.com/alistgo/alist/tree/main/drivers"
click node_database "https://github.com/alistgo/alist/tree/main/internal/db"
click node_bootstrap "https://github.com/alistgo/alist/blob/main/internal/bootstrap/storage.go"
click node_auth "https://github.com/alistgo/alist/blob/main/internal/authn/authn.go"
click node_tasks "https://github.com/alistgo/alist/blob/main/pkg/task/manager.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_http,node_handlers,node_webdav,node_s3,node_ftp,node_mcp,node_client toneBlue
class node_filesystem,node_search,node_sharing,node_offline toneAmber
class node_storage_ops,node_drivers,node_database toneMint
class node_bootstrap,node_auth,node_tasks toneRose
```

## Components

### Access Interfaces

- [HTTP API](https://github.com/alistgo/alist/blob/main/server/router.go): `server/router.go`
- [Request Handlers](https://github.com/alistgo/alist/tree/main/server/handles): `server/handles`
- [WebDAV](https://github.com/alistgo/alist/blob/main/server/webdav/webdav.go): `server/webdav/webdav.go`
- [S3 Interface](https://github.com/alistgo/alist/tree/main/server/s3): `server/s3`
- [FTP / SFTP](https://github.com/alistgo/alist/tree/main/server): `server`
- [MCP Tools](https://github.com/alistgo/alist/tree/main/server/mcp): `server/mcp`

### File Services

- [Filesystem Operations](https://github.com/alistgo/alist/tree/main/internal/fs): `internal/fs`
- [Search](https://github.com/alistgo/alist/tree/main/internal/search): `internal/search`
- [Sharing](https://github.com/alistgo/alist/tree/main/internal/share): `internal/share`
- [Offline Downloads](https://github.com/alistgo/alist/tree/main/internal/offline_download): `internal/offline_download`

### Storage Layer

- [Storage Operations](https://github.com/alistgo/alist/blob/main/internal/op/storage.go): `internal/op/storage.go`
- [Storage Drivers](https://github.com/alistgo/alist/tree/main/drivers): `drivers`
- [Database](https://github.com/alistgo/alist/tree/main/internal/db): `internal/db`

### Platform Services

- [Startup Loading](https://github.com/alistgo/alist/blob/main/internal/bootstrap/storage.go): `internal/bootstrap/storage.go`
- [Authentication](https://github.com/alistgo/alist/blob/main/internal/authn/authn.go): `internal/authn/authn.go`
- [Task Manager](https://github.com/alistgo/alist/blob/main/pkg/task/manager.go): `pkg/task/manager.go`

### Other components

- **Client**

## Connections

- Client → HTTP API: requests (evidence: `README.md`)
- HTTP API → Request Handlers: routes to (evidence: `server/router.go`)
- Request Handlers → Storage Operations: manages storage (evidence: `server/handles/storage.go`)
- Request Handlers → Database: queries (evidence: `server/handles/storage.go`)
- Request Handlers → Filesystem Operations: serves file actions (evidence: `README.md`)
- WebDAV → Filesystem Operations: uses (evidence: `server/webdav/webdav.go`)
- MCP Tools → Request Handlers: exposes tools
- Storage Operations → Database: persists storage (evidence: `internal/op/storage.go`)
- Storage Operations → Storage Drivers: loads driver (evidence: `internal/op/storage.go`)
- Startup Loading → Database: loads enabled storages (evidence: `internal/bootstrap/storage.go`)
- Startup Loading → Storage Operations: initializes storage (evidence: `internal/bootstrap/storage.go`)
- Search → Storage Operations: searches files (evidence: `internal/search/search.go`)
- Offline Downloads → Storage Drivers: uses cloud driver (evidence: `internal/offline_download/115/client.go`)
- Offline Downloads → Filesystem Operations: creates download folder (evidence: `internal/offline_download/115/client.go`)
- Task Manager → Offline Downloads: runs downloads
- Client → WebDAV: accesses files (evidence: `README.md`)
- Client → S3 Interface: accesses files (evidence: `README.md`)
- Client → FTP / SFTP: accesses files (evidence: `README.md`)
- Client → MCP Tools: uses tools (evidence: `README.md`)
- Client → Search: searches files (evidence: `README.md`)
- Client → Sharing: shares files (evidence: `README.md`)
- HTTP API → Authentication: protects routes
