This guide will help you set up your development environment for building and running AppFlowy from source.
Prerequisites
Flutter SDK
Version 3.13.19 or higher
Rust Toolchain
Version 1.70 or higher
Git
For cloning the repository
Build Tools
Platform-specific compilers and SDKs
Installing Flutter
Download Flutter SDK
Download the Flutter SDK from the official website:# Download Flutter
cd ~/development
git clone https://github.com/flutter/flutter.git -b stable
# Add to PATH
export PATH="$PATH:$HOME/development/flutter/bin"
# Download Flutter
cd ~/development
git clone https://github.com/flutter/flutter.git -b stable
# Add to PATH
export PATH="$PATH:$HOME/development/flutter/bin"
Download the Flutter SDK zip file and extract it to C:\src\flutter.Add C:\src\flutter\bin to your PATH environment variable.
Verify installation
flutter --version
flutter doctor
The output should show Flutter 3.13.19 or higher.Install required Flutter dependencies
flutter doctor --android-licenses # Accept Android licenses if building for mobile
flutter config --enable-macos-desktop # Enable desktop support
flutter config --enable-linux-desktop
flutter config --enable-windows-desktop
Installing Rust
Install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Download and run rustup-init.exe. Verify installation
rustc --version
cargo --version
You should see Rust 1.70 or higher.Install required Rust components
# Install the stable toolchain
rustup default stable
# Add platform targets
rustup target add aarch64-apple-darwin # macOS ARM
rustup target add x86_64-apple-darwin # macOS Intel
rustup target add x86_64-pc-windows-msvc # Windows
rustup target add x86_64-unknown-linux-gnu # Linux
Installing cargo-make
AppFlowy uses cargo-make for build automation:
Verify installation:
macOS Requirements
Install Xcode
Install Xcode from the App Store or download from developer.apple.com.# Install Xcode Command Line Tools
xcode-select --install
# Accept license
sudo xcodebuild -license accept
Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Linux Requirements
Install build essentials
sudo apt-get update
sudo apt-get install -y \
curl \
build-essential \
libssl-dev \
clang \
cmake \
ninja-build \
pkg-config \
libgtk-3-dev \
libsqlite3-dev \
protobuf-compiler
Windows Requirements
Install Visual Studio
Download and install Visual Studio 2022.During installation, select:
- Desktop development with C++
- Windows 10/11 SDK
Install vcpkg
# Clone vcpkg
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
cd C:\vcpkg
.\bootstrap-vcpkg.bat
# Install dependencies
.\vcpkg install protobuf:x64-windows
Set environment variables
Add to your system PATH:
C:\vcpkg
C:\src\flutter\bin
Clone the Repository
Clone AppFlowy
git clone https://github.com/AppFlowy-IO/AppFlowy.git
cd AppFlowy
Repository Structure
Understanding the repository layout:
AppFlowy/
├── frontend/
│ ├── appflowy_flutter/ # Flutter application
│ ├── rust-lib/ # Rust backend
│ ├── scripts/ # Build scripts
│ └── Makefile.toml # Build configuration
├── doc/ # Documentation
├── README.md
└── LICENSE
All build commands should be run from the frontend/ directory.
Verify Setup
Check Flutter
Ensure all required components are installed. Check Rust
rustc --version
cargo --version
cargo make --version
Install Flutter dependencies
cd appflowy_flutter
flutter pub get
IDE Setup
Visual Studio Code
Install recommended extensions:{
"recommendations": [
"dart-code.dart-code",
"dart-code.flutter",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"vadimcn.vscode-lldb"
]
}
Open the workspace:Android Studio / IntelliJ IDEA
Install plugins:Open the project:
- File → Open
- Select the
AppFlowy/frontend/appflowy_flutter directory
Protobuf
AppFlowy uses Protocol Buffers for serialization:
# Verify protobuf installation
protoc --version
If not installed:
# Ubuntu/Debian
sudo apt-get install protobuf-compiler
# Fedora
sudo dnf install protobuf-compiler
# Using vcpkg
vcpkg install protobuf:x64-windows
Next Steps
Now that your environment is set up, you can build AppFlowy:
Building Desktop
Build AppFlowy for macOS, Windows, or Linux
Building Mobile
Build AppFlowy for iOS or Android
Architecture
Learn about AppFlowy’s architecture
Contributing
Start contributing to AppFlowy
Troubleshooting
If you encounter issues during setup, check the following:
Common Issues
Flutter doctor shows issues:# Update Flutter
flutter upgrade
# Clean and reinstall
flutter clean
flutter pub get
Rust compilation fails:# Update Rust
rustup update
# Clean build
cargo clean
Protobuf errors:Make sure protoc is in your PATH:which protoc # macOS/Linux
where protoc # Windows