Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
update some doc
appflowy685643be364c
diff --git a/README.md b/README.mdindex 6d9fbfe8e2..ceaac09643 100644--- a/README.md+++ b/README.md@@ -8,13 +8,13 @@## Documentation-* [**Getting Started**](doc/getting_started.md)-* [**Roadmap**](doc/roadmap.md)-* [**Deep Dive AppFlowy**](doc/architecture.md)+* [**Getting Started**](doc/GETTING_STARTED.md)+* [**Roadmap**](doc/ROADMAP.md)+* [**Deep Dive AppFlowy**](doc/APPFLOWY_SYSTEM_DESIGN.md)## Contributing-Read the [Contributing Doc](doc/contribute.md) before you want to contribute.+Read the [Contributing Doc](doc/CONTRIBUTING.md) before you want to contribute.## Social Media* Slack (to be determined)diff --git a/app_flowy/packages/flowy_sdk/lib/dispatch/error.dart b/app_flowy/packages/flowy_sdk/lib/dispatch/error.dartnew file mode 100644index 0000000000..ae47d60418--- /dev/null+++ b/app_flowy/packages/flowy_sdk/lib/dispatch/error.dart@@ -0,0 +1,30 @@+import 'package:flowy_logger/flowy_logger.dart';+import 'package:flowy_sdk/dispatch/flowy_error.dart';+import 'package:flowy_sdk/protobuf/ffi_request.pb.dart';+import 'package:flowy_sdk/protobuf/ffi_response.pb.dart';++class StackTraceError {+ Object error;+ StackTrace trace;+ StackTraceError(+ this.error,+ this.trace,+ );++ FlowyError toFlowyError() {+ Log.error('${error.runtimeType}\n');+ Log.error('Stack trace \n $trace');+ return FlowyError.fromError('${error.runtimeType}. Stack trace: $trace');+ }++ String toString() {+ return '${error.runtimeType}. Stack trace: $trace';+ }+}++FFIResponse error_response(FFIRequest request, StackTraceError error) {+ var response = FFIResponse();+ response.code = FFIStatusCode.Err;+ response.error = error.toString();+ return response;+}diff --git a/doc/about app flowy.md b/doc/ABOUT_APPFLOWY.mdsimilarity index 100%rename from doc/about app flowy.mdrename to doc/ABOUT_APPFLOWY.mddiff --git a/doc/APPFLOWY_SYSTEM_DESIGN.md b/doc/APPFLOWY_SYSTEM_DESIGN.mdnew file mode 100644index 0000000000..e99cb9690c--- /dev/null+++ b/doc/APPFLOWY_SYSTEM_DESIGN.md@@ -0,0 +1,71 @@+# π₯³ AppFlowy - Event Driven System++* Goals of the System+* Some Design Considerations+* High Level Design+* Component Design++## π― Goals of the System+The AppFlowy project is an attempt to build a high performance application. Here are the top-level requirements for out system.++1. **High Performance.**+2. **Cross-platform.**+3. **Reliability**+4. **Safety**+++## π€ Some Design Considerations++## π High Level Design++## π Component Design++### π Event Dispatch++```+ Frontend FLowySDK+ β βββββββββββ+ β β7ββΆβHandler Aβ+ β β βββββββββββ+ β βββββββββββ β βββββββββββ+ββββββββ ββββββ ββββββββββββββββ β βββββΆβModule A ββββΌβββΆβHandler Bβ+βWidgetββ1ββΆβBlocββ2ββΆβ Repository A ββ3ββ β β βββββββββββ β βββββββββββ+ββββββββ ββββββ ββββββββββββββββ β β β β βββββββββββ+ ββββββββββββββββ β βββββββββ βββ΄βββ βββββββββββββ β βββββββββββ ββββΆβHandler Cβ+ β Repository B βββββΌββββΆβ Event ββ4ββΆβFFI ββ5βββΆβDispatcher ββ6ββΌββββΆβModule B β βββββββββββ+ ββββββββββββββββ β βββββββββ βββ¬βββ βββββββββββββ β βββββββββββ+ ββββββββββββββββ β β β+ β Repository C βββββ β β βββββββββββ+ ββββββββββββββββ β βββββΆβModule C β+ β βββββββββββ+ β+ β+```+Here are the event flow:+1. User click on the `Widget`(The user interface) that invokes the `Bloc` actions+2. `Bloc` calls the repositories to perform additional operations to handle the actions.+3. `Repository` offers the functionalities by combining the event, defined in the `FlowySDK`.+4. `Events` will be passed in the `FlowySDK` through the [FFI](https://en.wikipedia.org/wiki/Foreign_function_interface) interface.+5. `Dispatcher` parses the event and generates the specific action scheduled in the `FlowySDK` runtime.+6. `Dispatcher` find the event handler declared by the modules.+7. `Handler` consumes the event and generates the response. The response will be returned to the widget through the `FFI`.++The event flow will be discussed in two parts: the frontend implemented in flutter and the FlowySDK implemented in Rust.++#### Frontend+The Frontend follows the DDD design pattern, you can recap from [**here**](DOMAIN_DRIVEN_DESIGN.md).+```+ ββββββββ ββββββ ββββββββββββββββ+ βWidgetβββ1βββββΆβBlocβββ2βββββΆβ Repository A ββ3βββ+ ββββββββ ββββββ ββββββββββββββββ β+ ββββββββββββββββ β βββββββββ+ β Repository B ββββββΌβββββΆβ Event β+ ββββββββββββββββ β βββββββββ+ ββββββββββββββββ β+ β Repository C ββββββ+ ββββββββββββββββ+```++#### FlowySDK++diff --git a/CONTRIBUTING.md b/doc/CONTRIBUTING.mdsimilarity index 99%rename from CONTRIBUTING.mdrename to doc/CONTRIBUTING.mdindex a97294257e..630c62a729 100644--- a/CONTRIBUTING.md+++ b/doc/CONTRIBUTING.md@@ -18,7 +18,6 @@ Consult the Table of Contents below, and jump to the desired section.- [Code of Conduct](#code-of-conduct)-## Sign the CLA AgreementTODOdiff --git a/doc/domain driven design.md b/doc/DOMAIN_DRIVEN_DESIGN.mdsimilarity index 100%rename from doc/domain driven design.mdrename to doc/DOMAIN_DRIVEN_DESIGN.mddiff --git a/doc/architecture.md b/doc/architecture.mddeleted file mode 100644index ddac0254f5..0000000000--- a/doc/architecture.md+++ /dev/null@@ -1,47 +0,0 @@-# π₯³ AppFlowy System Design--* Goals of the System-* Some Design Considerations-* High Level Design-* Component Design--## π― Goals of the System----## π€ Some Design Considerations--## π High Level Design--## π Component Design--### π Component 1---### π Component 2---### π Flutter Event Flow---### π Rust Event Flow--```- βββββββββββ- βββΆβService Aβ- β βββββββββββ- βββββββββββ βββββββββββββ βββββββββββββββ β βββββββββββ- βββΆβModule A βββΆβ Services βββΆβDeps ResolvedβββΌββΆβService Bβ- β βββββββββββ βββββββββββββ βββββββββββββββ β βββββββββββ- β β βββββββββββ-βββββββββ ββββββββββ β βββββββββββ βββΆβService Cβ-β Event ββββΆβRuntime ββββΌββΆβModule B β βββββββββββ-βββββββββ ββββββββββ β βββββββββββ- β- β βββββββββββ- βββΆβModule C β- βββββββββββ-```--* sync will cause typing lag-diff --git a/doc/contribute.md b/doc/contribute.mddeleted file mode 100644index e0f57bdaf8..0000000000--- a/doc/contribute.md+++ /dev/null@@ -1,12 +0,0 @@-[WIP]-* Contributing- * First steps- * Opening issues- * Participating in discussions- * Finding something to work on- * Open your PR- * Review Process- * Getting more involved- * Organization membership- * Contributor- * Maintainer\ No newline at end of filediff --git a/doc/why flutter and rust.md b/doc/why flutter and rust.mddeleted file mode 100644index 0e3d959cf3..0000000000--- a/doc/why flutter and rust.md+++ /dev/null@@ -1 +0,0 @@-[WIP]\ No newline at end of filediff --git a/scripts/install_rust.sh b/scripts/install_rust.shnew file mode 100755index 0000000000..0a778ac670--- /dev/null+++ b/scripts/install_rust.sh@@ -0,0 +1,7 @@+#!/bin/sh++echo 'install rust'+sudo xcode-select -s /Applications/Xcode.app/Contents/Developer+curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y+echo 'export PATH="$$HOME/.cargo/bin:$$PATH"' >> ~/.bash_profile+source ~/.bash_profile\ No newline at end of filediff --git a/scripts/install_tool.sh b/scripts/install_tool.shnew file mode 100755index 0000000000..cde07b2403--- /dev/null+++ b/scripts/install_tool.sh@@ -0,0 +1,15 @@+#!/bin/sh++#targets+rustup target add x86_64-apple-darwin++#tools+echo 'install tools'+rustup component add rustfmt+cargo install cargo-expand+cargo install cargo-watch+cargo install cargo-cache++#protobuf code gen env+brew install [email protected]+cargo install --version 2.20.0 protobuf-codegen\ No newline at end of file