git
https://github.com/AppFlowy-IO/appflowy
也就 1 周 star 9.8k,我以为他是刷的。
目标&特色
目标替代 Notion
数据 100% 自己管理
开源方式提供,你可以自己改
多平台支持
原生体验,估计是用了 flutter 关系
编译运行
- git clone
1 | git clone https://github.com/AppFlowy-IO/appflowy.git |
- 安装 rust
1 |
|
- 切换 flutter dev
1 | flutter channel dev |
- flutter 启用 desktop
1 | # for windows |
- 用 vscode 或者其它 idea 打开
1 | open appflowy/frontend |
代码架构
技术选型
flutter: 多端适配
rust: ffi 平台接口、服务端
flutter 端
frontend/app_flowy
- 前端业务 rust 层
frontend/rust-lib
- 共享库 shared-lib
shared-lib
- 后端 rust api
backend
参阅技术说明 doc
- 系统设计说明
doc/APPFLOWY_SYSTEM_DESIGN.md
1 | Frontend FLowySDK |
Here are the event flow:
- User click on the
Widget
(The user interface) that invokes theBloc
actions Bloc
calls the repositories to perform additional operations to handle the actions.Repository
offers the functionalities by combining the event, defined in theFlowySDK
.Events
will be passed in theFlowySDK
through the FFI interface.Dispatcher
parses the event and generates the specific action scheduled in theFlowySDK
runtime.Dispatcher
find the event handler declared by the modules.Handler
consumes the event and generates the response. The response will be returned to the widget through theFFI
.
The event flow will be discussed in two parts: the frontend implemented in flutter and the FlowySDK implemented in Rust.
linux 编译说明
doc/BUILD_ON_LINUX.md
windows 编译说明
doc/BUILD_ON_WINDOWS.md
贡献参与说明
doc/CONTRIBUTING.md
DDD 设计说明
doc/DOMAIN_DRIVEN_DESIGN.md
1 | ┌──────────────────────────────────────────────────┐ ─────────▶ |
Presentation Layer:
- Responsible for presenting information to the user and interpreting user commands.
- Consists of Widgets and also the state of the Widgets.
Application Layer:
- Defines the jobs the software is supposed to do. (Shouldn’t find any UI code or network code)
- Coordinates the application activity and delegates work to the next layer down.
- It doesn’t contain any complex business logic but the basic validation on the user input before
passing to the other layer.
Domain Layer:
- Responsible for representing concepts of the business.
- Manages the business state or delegated to the infrastructure layer.
- Self contained and it doesn’t depend on any other layers. Domain should be well isolated from the
other layers.
Infrastructure Layer:
- Provides generic technical capabilities that support the higher layers. It deals with APIs, persistence and network, etc.
- Implements the repository interface and hiding the complexity of the Domain layer.
编辑器
doc/EDITOR.md
roadmap
https://trello.com/b/NCyXCXXh/appflowy-roadmap
看看本地文件在哪里
- 找到 sqlite
- 搜索本地
1 | find ~ -iname 'flowy-database.db' |
flutter 插件
- flutter-quill
https://github.com/singerdmx/flutter-quill
富文本编辑器
- freezed
https://pub.flutter-io.cn/packages/freezed
数据 model 生成器,支持注解方式
- flutter_colorpicker
https://pub.flutter-io.cn/packages/flutter_colorpicker
颜色选取工具
- styled_widget
https://pub.flutter-io.cn/packages/styled_widget
简化小组件定义
1 | Icon(OMIcons.home, color: Colors.white) |
- get_it
https://pub.flutter-io.cn/packages/get_it
全局访问你的业务对象,你可以拆分业务和 UI
1 | // 定义 |
总结
- 看到人家的架构,感觉自己弱爆了,我还是先领域分层设计做做干净
- flutter bloc , rust ffi web protobuf 感觉还是成熟的选择
- 如果持续更新的话,我也很想看看架构的演变
- 现阶段估计还是在测试架构设计,应该不会上很多功能
© 猫哥
微信群 ducafecat
往期
开源
GetX Quick Start
https://github.com/ducafecat/getx_quick_start
新闻客户端
https://github.com/ducafecat/flutter_learn_news
strapi 手册译文
微信讨论群 ducafecat
系列集合
译文
https://ducafecat.tech/categories/%E8%AF%91%E6%96%87/
开源项目
https://ducafecat.tech/categories/%E5%BC%80%E6%BA%90/
Dart 编程语言基础
https://space.bilibili.com/404904528/channel/detail?cid=111585
Flutter 零基础入门
https://space.bilibili.com/404904528/channel/detail?cid=123470
Flutter 实战从零开始 新闻客户端
https://space.bilibili.com/404904528/channel/detail?cid=106755
Flutter 组件开发
https://space.bilibili.com/404904528/channel/detail?cid=144262
Flutter Bloc
https://space.bilibili.com/404904528/channel/detail?cid=177519
Flutter Getx4
https://space.bilibili.com/404904528/channel/detail?cid=177514
Docker Yapi
https://space.bilibili.com/404904528/channel/detail?cid=130578