⚡ The AppFlowy Cloud written with Rust 🦀
AppFlowy Cloud is part of the AppFlowy ecosystem, offering secure user authentication, file storage, and real-time WebSocket communication for an efficient and collaborative user experience.
- See deployment guide
You'll need to install:
To get started, you need to set up your environment variables. We've made this easy with an interactive script:
./script/generate_env.sh
The script will ask you to choose between development (dev.env
) or production (deploy.env
) settings, then generate a
.env
file for you. If you have sensitive values like API keys, you can put them in environment-specific secret files
and the script will safely merge them in.
You don't need to understand all the environment variables. For most development setups, simply:
-
Copy the development secrets template:
cp env.dev.secret.example .env.dev.secret
-
Edit
.env.dev.secret
and fill in only the values you need (like API keys, passwords, etc.) -
Run the generator:
./script/generate_env.sh
The script will automatically use your secrets file and generate a complete .env
with sensible defaults for everything
else.
If you prefer doing it manually, just copy one of the template files:
cp dev.env .env # for development
Then edit the .env
file with your specific settings. Choose ONE of the following commands to start the AppFlowy
Cloud server
locally(make sure you are in the root directory of the project):
# For new setup - RECOMMENDED FOR FIRST TIME
./script/run_local_server.sh --reset
# Basic run (interactive prompts for container management)
./script/run_local_server.sh
# With SQLx metadata preparation (useful for clean builds)
./script/run_local_server.sh --sqlx
# Combined: reset database and prepare SQLx metadata
./script/run_local_server.sh --reset --sqlx
Interactive Features:
- Prompts before stopping existing containers (data is preserved)
- Automatically checks for sqlx-cli and offers to install if missing
- Color-coded output for better visibility
- Clear warnings about data-affecting operations
Command Line Flags:
--sqlx
: Prepare SQLx metadata (takes a few minutes, required for clean builds)--reset
: Reset database schema and data (no prompt)
Environment Variables:
SKIP_SQLX_PREPARE=true
: Skip SQLx preparation (faster restarts)SKIP_APPFLOWY_CLOUD=true
: Skip AppFlowy Cloud buildSQLX_OFFLINE=false
: Connect to DB during build (default: true)
This process will execute all dependencies and start the AppFlowy-Cloud server with an interactive setup experience.
If you cannot run the run_local_server.sh
script, follow these manual steps:
Ensure you have installed:
- Rust and Cargo toolchain
- Docker and Docker Compose
- PostgreSQL client (psql)
- sqlx-cli:
cargo install sqlx-cli
# Copy the configuration template
cp dev.env .env
# Edit the .env file as required (such as SMTP configurations)
# Set environment variables
export GOTRUE_MAILER_AUTOCONFIRM=true
export GOTRUE_EXTERNAL_GOOGLE_ENABLED=true
# Start Docker Compose services
docker compose --file ./docker-compose-dev.yml up -d --build
# Wait for PostgreSQL to be ready (adjust connection details as needed)
# Keep trying until connection succeeds
PGPASSWORD="password" psql -h "localhost" -U "postgres" -p "5432" -d "postgres" -c '\q'
# Wait for AppFlowy Cloud health check
# Keep trying until health endpoint responds
curl localhost:9999/health
If you need to reset/setup the database:
# Generate protobuf files for collab-rt-entity crate
./script/code_gen.sh
# Create database and run migrations
cargo sqlx database create
cargo sqlx migrate run
If you need to prepare SQLx metadata:
# Prepare SQLx metadata (takes a few minutes)
cargo sqlx prepare --workspace
# Build and run AppFlowy Cloud
cargo run --package xtask
Any new contribution is more than welcome in this project! If you want to know more about the development workflow or want to contribute, please visit our contributing guidelines for detailed instructions!