# manyiwang01/appflowy architecture

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

- Interactive diagram: https://gitdiagram.com/manyiwang01/appflowy
- Repository: https://github.com/manyiwang01/appflowy

## Overview

AppFlowy is a cross-platform AI workspace built with Flutter and Rust. Its user-facing capabilities include organizing workspaces and pages, editing collaborative documents, working with database views, searching, and using AI features. The Rust modules shown cover workspace and account management, database operations, AI chat and local inference, search, and file storage; the tree excerpt does not expose the Flutter product UI. Edges are limited to relationships visible in excerpts or the source index; README-level capabilities are retained without guessing their internal wiring.

Main entry points: [`frontend/rust-lib/flowy-ai/src/ai_manager.rs`](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/ai_manager.rs) (AI orchestration), [`frontend/rust-lib/flowy-ai/src/local_ai/controller.rs`](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/local_ai/controller.rs) (Local AI control), [`frontend/rust-lib/flowy-folder/src/manager.rs`](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-folder/src/manager.rs) (Workspace pages), [`frontend/rust-lib/flowy-database2/src/manager.rs`](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-database2/src/manager.rs) (Database operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace and accounts"]
  node_folder["Workspace pages<br/>[manager.rs]"]
  node_account["Account management<br/>[manager.rs]"]
end

subgraph group_content["Content and databases"]
  node_document["Document editing<br/>[manager.rs]"]
  node_database["Database operations<br/>[manager.rs]"]
  node_db_view["Database views<br/>[view_editor.rs]"]
  node_db_fields["Fields and types<br/>[field_entities.rs]"]
  node_db_group["Row grouping<br/>[controller.rs]"]
end

subgraph group_ai["AI and search"]
  node_ai_manager["AI orchestration<br/>[ai_manager.rs]"]
  node_chat["AI chat<br/>[chat.rs]"]
  node_local_ai["Local AI control<br/>[controller.rs]"]
  node_local_resources["Local AI resources<br/>[resource.rs]"]
  node_chat_middleware["Chat middleware<br/>[chat_service_mw.rs]"]
  node_ai_notifications["AI notifications<br/>[notification.rs]"]
  node_ai_stream["AI stream messages<br/>[stream_message.rs]"]
  node_search["Search<br/>[manager.rs]"]
end

subgraph group_services["Storage and services"]
  node_storage["File storage<br/>[manager.rs]"]
  node_storage_db[("Upload state<br/>[manager.rs]")]
  node_cloud["Cloud service<br/>[server.rs]"]
end

node_user(("Workspace user"))

node_user -.->|"organizes pages"| node_folder
node_user -.->|"manages account"| node_account
node_user -.->|"edits content"| node_document
node_user -.->|"works with data"| node_database
node_user -.->|"searches workspace"| node_search
node_user -.->|"requests AI"| node_ai_manager
node_ai_manager -->|"creates chat"| node_chat
node_ai_manager -->|"controls local AI"| node_local_ai
node_ai_manager -->|"uses middleware"| node_chat_middleware
node_local_ai -->|"checks resources"| node_local_resources
node_local_ai -->|"sends status"| node_ai_notifications
node_local_ai -->|"emits progress"| node_ai_stream
node_database -->|"manages views"| node_db_view
node_db_view -.->|"uses field entities"| node_db_fields
node_db_group -.->|"groups by field"| node_db_fields
node_storage -->|"persists upload state"| node_storage_db
node_folder -->|"loads folder state"| node_cloud

click node_folder "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-folder/src/manager.rs"
click node_account "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-user/src/user_manager/manager.rs"
click node_document "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-document/src/manager.rs"
click node_database "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-database2/src/manager.rs"
click node_db_view "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-database2/src/services/database_view/view_editor.rs"
click node_db_fields "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-database2/src/entities/field_entities.rs"
click node_db_group "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-database2/src/services/group/controller.rs"
click node_ai_manager "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/ai_manager.rs"
click node_chat "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/chat.rs"
click node_local_ai "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/local_ai/controller.rs"
click node_local_resources "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/local_ai/resource.rs"
click node_chat_middleware "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/middleware/chat_service_mw.rs"
click node_ai_notifications "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/notification.rs"
click node_ai_stream "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/stream_message.rs"
click node_search "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-search/src/services/manager.rs"
click node_storage "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-storage/src/manager.rs"
click node_storage_db "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-storage/src/manager.rs"
click node_cloud "https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-server/src/af_cloud/server.rs"

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_folder,node_account,node_user toneBlue
class node_document,node_database,node_db_view,node_db_fields,node_db_group toneAmber
class node_ai_manager,node_chat,node_local_ai,node_local_resources,node_chat_middleware,node_ai_notifications,node_ai_stream,node_search toneMint
class node_storage,node_storage_db,node_cloud toneRose
```

## Components

### Workspace and accounts

- [Workspace pages](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-folder/src/manager.rs): `frontend/rust-lib/flowy-folder/src/manager.rs`
- [Account management](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-user/src/user_manager/manager.rs): `frontend/rust-lib/flowy-user/src/user_manager/manager.rs`

### Content and databases

- [Document editing](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-document/src/manager.rs): `frontend/rust-lib/flowy-document/src/manager.rs`
- [Database operations](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-database2/src/manager.rs): `frontend/rust-lib/flowy-database2/src/manager.rs`
- [Database views](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-database2/src/services/database_view/view_editor.rs): `frontend/rust-lib/flowy-database2/src/services/database_view/view_editor.rs`
- [Fields and types](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-database2/src/entities/field_entities.rs): `frontend/rust-lib/flowy-database2/src/entities/field_entities.rs`
- [Row grouping](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-database2/src/services/group/controller.rs): `frontend/rust-lib/flowy-database2/src/services/group/controller.rs`

### AI and search

- [AI orchestration](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/ai_manager.rs): `frontend/rust-lib/flowy-ai/src/ai_manager.rs`
- [AI chat](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/chat.rs): `frontend/rust-lib/flowy-ai/src/chat.rs`
- [Local AI control](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/local_ai/controller.rs): `frontend/rust-lib/flowy-ai/src/local_ai/controller.rs`
- [Local AI resources](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/local_ai/resource.rs): `frontend/rust-lib/flowy-ai/src/local_ai/resource.rs`
- [Chat middleware](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/middleware/chat_service_mw.rs): `frontend/rust-lib/flowy-ai/src/middleware/chat_service_mw.rs`
- [AI notifications](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/notification.rs): `frontend/rust-lib/flowy-ai/src/notification.rs`
- [AI stream messages](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-ai/src/stream_message.rs): `frontend/rust-lib/flowy-ai/src/stream_message.rs`
- [Search](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-search/src/services/manager.rs): `frontend/rust-lib/flowy-search/src/services/manager.rs`

### Storage and services

- [File storage](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-storage/src/manager.rs): `frontend/rust-lib/flowy-storage/src/manager.rs`
- [Upload state](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-storage/src/manager.rs): `frontend/rust-lib/flowy-storage/src/manager.rs`
- [Cloud service](https://github.com/manyiwang01/appflowy/blob/my_main/frontend/rust-lib/flowy-server/src/af_cloud/server.rs): `frontend/rust-lib/flowy-server/src/af_cloud/server.rs`

### Other components

- **Workspace user**

## Connections

- Workspace user → Workspace pages: organizes pages
- Workspace user → Account management: manages account
- Workspace user → Document editing: edits content
- Workspace user → Database operations: works with data
- Workspace user → Search: searches workspace
- Workspace user → AI orchestration: requests AI
- AI orchestration → AI chat: creates chat (evidence: `frontend/rust-lib/flowy-ai/src/ai_manager.rs`)
- AI orchestration → Local AI control: controls local AI (evidence: `frontend/rust-lib/flowy-ai/src/ai_manager.rs`)
- AI orchestration → Chat middleware: uses middleware (evidence: `frontend/rust-lib/flowy-ai/src/ai_manager.rs`)
- Local AI control → Local AI resources: checks resources (evidence: `frontend/rust-lib/flowy-ai/src/local_ai/controller.rs`)
- Local AI control → AI notifications: sends status (evidence: `frontend/rust-lib/flowy-ai/src/local_ai/controller.rs`)
- Local AI control → AI stream messages: emits progress (evidence: `frontend/rust-lib/flowy-ai/src/local_ai/controller.rs`)
- Database operations → Database views: manages views (evidence: `frontend/rust-lib/flowy-database2/src/manager.rs`)
- Database views → Fields and types: uses field entities
- Row grouping → Fields and types: groups by field
- File storage → Upload state: persists upload state (evidence: `frontend/rust-lib/flowy-storage/src/manager.rs`)
- Workspace pages → Cloud service: loads folder state (evidence: `frontend/rust-lib/flowy-folder/src/manager.rs`)
