AI prompts
base on 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. <p align="center">
<picture>
<source srcset="assets/logos/appflowy_logo_white.svg" media="(prefers-color-scheme: dark)"/>
<img src="assets/logos/appflowy_logo_black.svg" width="500" height="200" />
</picture>
</p>
<h4 align="center">
<a href="https://discord.gg/9Q2xaN37tV"><img src="https://img.shields.io/badge/AppFlowy.IO-discord-orange"></a>
<a href="https://opensource.org/licenses/AGPL-3.0"><img src="https://img.shields.io/badge/license-AGPL-purple.svg" alt="License: AGPL"></a>
</h4>
<p align="center">
<a href="https://www.appflowy.com"><b>Website</b></a> ā¢
<a href="https://twitter.com/appflowy"><b>Twitter</b></a>
</p>
<p align="center">ā” The AppFlowy Cloud written with Rust š¦</p>
# 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](#-deployment)
- [š» Development](#-development)
- [š Debugging](#-debugging)
- [āļø Contributing](#-contributing)
## š Deployment
- See [deployment guide](./doc/DEPLOYMENT.md)
## š» Development
### Pre-requisites
You'll need to install:
- [Rust](https://www.rust-lang.org/tools/install)
- [Docker](https://docs.docker.com/get-docker/)
### Environment Configuration
To get started, you need to set up your environment variables. We've made this easy with an interactive script:
```bash
./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.
#### Quick Setup with Secrets (Recommended)
**You don't need to understand all the environment variables.** For most development setups, simply:
1. Copy the development secrets template:
```bash
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:
```bash
./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:
```bash
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):
```bash
# 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](https://www.rust-lang.org/tools/install) and Cargo toolchain
- [Docker](https://docs.docker.com/get-docker/) and Docker Compose
- PostgreSQL client (psql)
- sqlx-cli: `cargo install sqlx-cli`
#### 2. Configuration Setup
```bash
# Copy the configuration template
cp dev.env .env
# Edit the .env file as required (such as SMTP configurations)
```
#### 3. Start Docker Services
```bash
# 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
```bash
# 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:
```bash
# 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:
```bash
# Prepare SQLx metadata (takes a few minutes)
cargo sqlx prepare --workspace
```
#### 7. Build AppFlowy Cloud
```bash
# 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](./doc/CONTRIBUTING.md) for detailed instructions!
", Assign "at most 3 tags" to the expected json: {"id":"11623","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"