AppFlowy is an open-source alternative to Notion. You are in charge of your data and customizations. Built with Flutter and Rust.
Find a file
Khor Shu Heng c61110aa5a
Merge pull request #1544 from AppFlowy-IO/endpoint-to-check-whether-row-document-collab-exists
feat: endpoint to check whether row document collab exists
2025-08-08 14:59:01 +08:00
.github chore: run tests for both old and new sync protocols (#1448) 2025-06-27 13:43:07 +08:00
.sqlx feat: endpoint to check whether row document collab exists 2025-08-08 14:02:18 +08:00
admin_frontend
assets fix: refine page mention template 2025-07-30 11:32:06 +08:00
doc
docker
email_template fix: refine page mention template 2025-07-30 11:32:06 +08:00
external_proxy_config/nginx fix: image urls point to beta.appflowy.cloud after self-hosted import 2025-07-08 16:36:58 +02:00
libs feat: endpoint to check whether row document collab exists 2025-08-08 14:02:18 +08:00
migrations Merge pull request #1532 from AppFlowy-IO/page-update-email-notification 2025-07-24 13:43:39 +08:00
nginx
script
services chore: websocket protocol echo text messages (#1542) 2025-08-04 20:08:39 +08:00
src feat: endpoint to check whether row document collab exists 2025-08-08 14:02:18 +08:00
tests feat: endpoint to check whether row document collab exists 2025-08-08 14:02:18 +08:00
xtask
.dockerignore
.gitignore
Cargo.lock chore: use ResponseActFuture (#1490) 2025-06-27 17:24:15 +08:00
Cargo.toml chore: use ResponseActFuture (#1490) 2025-06-27 17:24:15 +08:00
deny.toml Batch get collab from redis (#1469) 2025-06-23 00:33:45 +08:00
deploy.env
dev.env
docker-compose-ci.yml
docker-compose-dev.yml
docker-compose-extras.yml
docker-compose.yml
Dockerfile
env.deploy.secret.example
env.dev.secret.example
LICENSE
Makefile
README.md fix: Corrected anchor links in README.md (#1394) 2025-07-23 12:48:59 +08:00
rust-toolchain.toml
rustfmt.toml

License: AGPL

WebsiteTwitter

The AppFlowy Cloud written with Rust 🦀

AppFlowy Cloud

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.

Table of Contents

🚀Deployment

💻Development

Pre-requisites

You'll need to install:

Environment Configuration

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:

  1. Copy the development secrets template:

    cp env.dev.secret.example .env.dev.secret
    
  2. Edit .env.dev.secret and fill in only the values you need (like API keys, passwords, etc.)

  3. 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.

Manual Setup

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 build
  • SQLX_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.

Manual Setup (Step-by-Step)

If you cannot run the run_local_server.sh script, follow these manual steps:

1. Prerequisites Check

Ensure you have installed:

  • Rust and Cargo toolchain
  • Docker and Docker Compose
  • PostgreSQL client (psql)
  • sqlx-cli: cargo install sqlx-cli

2. Configuration Setup

# Copy the configuration template
cp dev.env .env

# Edit the .env file as required (such as SMTP configurations)

3. Start Docker Services

# 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

4. Wait for Services to Start

# 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

5. Database Setup (Optional)

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

6. SQLx Preparation (Optional)

If you need to prepare SQLx metadata:

# Prepare SQLx metadata (takes a few minutes)
cargo sqlx prepare --workspace

7. Build AppFlowy Cloud

# Build and run AppFlowy Cloud
cargo run --package xtask

⚙️Contributing

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!