Skip to content

Let's use AI to Earn!

docs: reorganize Quick Start - relay first, production config later

Sakura41d6554a5b79
diff --git a/DOCKER_DEPLOYMENT_CN.md b/DOCKER_DEPLOYMENT_CN.md
index dacf6256..786cfe4b 100644
--- a/DOCKER_DEPLOYMENT_CN.md
+++ b/DOCKER_DEPLOYMENT_CN.md
@@ -58,7 +58,66 @@ git clone https://github.com/yikart/AiToEarn.git
cd AiToEarn
```
-### 2. 配置环境变量
+### 2. 启动服务
+
+```bash
+docker compose up -d
+```
+
+首次启动会拉取镜像,可能需要几分钟。
+
+### 3. 检查状态
+
+```bash
+docker compose ps
+```
+
+所有服务应显示 `healthy` 或 `running` 状态。
+
+### 4. 访问应用
+
+| 地址 | 说明 |
+|------|------|
+| http://localhost:8080 | Web 前端(通过 Nginx) |
+| http://localhost:8080/api/ | 后端 API(通过 Nginx) |
+| http://localhost:8080/_nhealth | Nginx 健康检查 |
+| http://localhost:9001 | RustFS 对象存储控制台 |
+
+### 5. 配置 Relay(推荐)
+
+Relay 允许自部署实例通过官方 AiToEarn 中继服务器连接社交媒体平台账号,无需自行配置各平台的 OAuth 凭据。
+
+**配置步骤:**
+
+1. 在 [https://aitoearn.ai](https://aitoearn.ai) 的 **设置 → API Key** 中创建一个 API Key。
+2. 在 `docker-compose.yml` 的 `aitoearn-server` 服务中配置:
+
+```yaml
+RELAY_SERVER_URL: https://aitoearn.ai/api
+RELAY_API_KEY: 你的API-Key
+RELAY_CALLBACK_URL: http://127.0.0.1:8080/api/plat/relay-callback
+```
+
+3. 重启服务:`docker compose restart aitoearn-server`
+
+### 6. 配置 AI 服务
+
+**推荐:使用 new-api / one-api 等中继服务**统一管理所有 AI 模型。
+
+- [new-api](https://github.com/Calcium-Ion/new-api) - 多模型 API 中继
+- [one-api](https://github.com/songquanpeng/one-api) - OpenAI API 管理分发
+
+在 `docker-compose.yml` 中配置:
+
+```yaml
+# 同时在 aitoearn-ai 和 aitoearn-server 两个服务中设置
+OPENAI_BASE_URL: https://your-new-api-host/v1
+OPENAI_API_KEY: sk-your-new-api-key
+```
+
+> 默认的 `sk-placeholder` 值允许应用正常启动,但 AI 功能将返回错误,直到配置真实的密钥。
+
+### 7. 配置环境变量(生产环境)
所有环境变量直接在 `docker-compose.yml` 文件中配置。**所有配置项都已提供默认值,无需修改即可直接启动应用。**
@@ -89,7 +148,7 @@ APP_DOMAIN: your-domain.com # 生产环境改为你的域名
>
> 可以使用 `openssl rand -hex 32` 生成随机字符串。
-### 3. 配置应用配置文件
+### 8. 配置应用配置文件
配置文件位于各应用的 `config/` 子目录中,以只读卷挂载到容器中:
@@ -102,31 +161,6 @@ APP_DOMAIN: your-domain.com # 生产环境改为你的域名
**如需修改 RustFS 凭证或切换到外部 S3/OSS**,需同时更新两个 config.js 文件中的 `assets` 配置部分,或通过 `ASSETS_CONFIG` 环境变量覆盖(见下文)。
-### 4. 启动服务
-
-```bash
-docker compose up -d
-```
-
-首次启动会拉取镜像,可能需要几分钟。
-
-### 5. 检查状态
-
-```bash
-docker compose ps
-```
-
-所有服务应显示 `healthy` 或 `running` 状态。
-
-### 6. 访问应用
-
-| 地址 | 说明 |
-|------|------|
-| http://localhost:8080 | Web 前端(通过 Nginx) |
-| http://localhost:8080/api/ | 后端 API(通过 Nginx) |
-| http://localhost:8080/_nhealth | Nginx 健康检查 |
-| http://localhost:9001 | RustFS 对象存储控制台 |
-
## 环境变量详细说明
以下变量均在 `docker-compose.yml` 各服务的 `environment` 部分配置。
@@ -522,27 +556,6 @@ AI 服务的完整配置文件,挂载到 `aitoearn-ai:/app/config.js`。
| `aiClient.baseUrl` | 访问 AI 服务的地址 | 环境变量 `AI_URL` |
| `aiClient.token` | 服务通信 token | 环境变量 `INTERNAL_TOKEN` |
-#### Relay 配置(可选)
-
-Relay 允许自部署实例通过官方 AiToEarn 中继服务器连接社交媒体平台账号,无需自行配置各平台的 OAuth 凭据。
-
-**配置步骤:**
-
-1. 在 [https://aitoearn.ai](https://aitoearn.ai) 的 **设置 → API Key** 中创建一个 API Key。
-2. 在 `docker-compose.yml` 的 `aitoearn-server` 服务中配置:
-
-| 变量 | 说明 | 默认值 |
-|------|------|--------|
-| `RELAY_SERVER_URL` | Relay 服务器地址 | `https://aitoearn.ai/api` |
-| `RELAY_API_KEY` | 你的 API Key(第 1 步创建) | 无 |
-| `RELAY_CALLBACK_URL` | 本地回调地址,用于接收中继结果 | `http://127.0.0.1:8080/api/plat/relay-callback` |
-
-```yaml
-RELAY_SERVER_URL: https://aitoearn.ai/api
-RELAY_API_KEY: 你的API-Key
-RELAY_CALLBACK_URL: http://127.0.0.1:8080/api/plat/relay-callback
-```
-
## 常用命令
```bash
diff --git a/DOCKER_DEPLOYMENT_EN.md b/DOCKER_DEPLOYMENT_EN.md
index ec20813e..2d24c1dd 100644
--- a/DOCKER_DEPLOYMENT_EN.md
+++ b/DOCKER_DEPLOYMENT_EN.md
@@ -58,7 +58,66 @@ git clone https://github.com/yikart/AiToEarn.git
cd AiToEarn
```
-### 2. Configure Environment Variables
+### 2. Start Services
+
+```bash
+docker compose up -d
+```
+
+First startup will pull images, which may take a few minutes.
+
+### 3. Check Status
+
+```bash
+docker compose ps
+```
+
+All services should show `healthy` or `running` status.
+
+### 4. Access the Application
+
+| URL | Description |
+|-----|-------------|
+| http://localhost:8080 | Web frontend (via Nginx) |
+| http://localhost:8080/api/ | Backend API (via Nginx) |
+| http://localhost:8080/_nhealth | Nginx health check |
+| http://localhost:9001 | RustFS object storage console |
+
+### 5. Configure Relay (Recommended)
+
+Relay allows self-hosted instances to connect social media platform accounts via the official AiToEarn relay server, without needing to configure OAuth credentials for each platform.
+
+**Setup:**
+
+1. Go to **Settings → API Key** at [https://aitoearn.ai](https://aitoearn.ai) and create an API Key.
+2. Configure in the `aitoearn-server` service of `docker-compose.yml`:
+
+```yaml
+RELAY_SERVER_URL: https://aitoearn.ai/api
+RELAY_API_KEY: your-api-key
+RELAY_CALLBACK_URL: http://127.0.0.1:8080/api/plat/relay-callback
+```
+
+3. Restart the service: `docker compose restart aitoearn-server`
+
+### 6. Configure AI Services
+
+**Recommended: use a relay service like new-api / one-api** to manage all AI models through a single endpoint.
+
+- [new-api](https://github.com/Calcium-Ion/new-api) - Multi-model API relay
+- [one-api](https://github.com/songquanpeng/one-api) - OpenAI API management and distribution
+
+Configure in `docker-compose.yml`:
+
+```yaml
+# In both aitoearn-ai and aitoearn-server services
+OPENAI_BASE_URL: https://your-new-api-host/v1
+OPENAI_API_KEY: sk-your-new-api-key
+```
+
+> Default `sk-placeholder` values allow the app to start normally. AI features will return errors until real keys are configured.
+
+### 7. Configure Environment Variables (Production)
All environment variables are configured directly in `docker-compose.yml`. **Default values are already provided for all settings, so you can start the application immediately without any changes.**
@@ -89,7 +148,7 @@ APP_DOMAIN: your-domain.com # change for production
>
> Generate random strings with: `openssl rand -hex 32`
-### 3. Configure Application Config Files
+### 8. Configure Application Config Files
Configuration files are located in each application's `config/` subdirectory, mounted as read-only volumes into containers:
@@ -102,31 +161,6 @@ These config files read environment variables from `process.env` (set by docker-
**To change RustFS credentials or switch to external S3/OSS**, update the `assets` configuration in both config.js files, or override via the `ASSETS_CONFIG` environment variable (see below).
-### 4. Start Services
-
-```bash
-docker compose up -d
-```
-
-First startup will pull images, which may take a few minutes.
-
-### 5. Check Status
-
-```bash
-docker compose ps
-```
-
-All services should show `healthy` or `running` status.
-
-### 6. Access the Application
-
-| URL | Description |
-|-----|-------------|
-| http://localhost:8080 | Web frontend (via Nginx) |
-| http://localhost:8080/api/ | Backend API (via Nginx) |
-| http://localhost:8080/_nhealth | Nginx health check |
-| http://localhost:9001 | RustFS object storage console |
-
## Environment Variables Reference
All variables below are configured in the `environment` section of each service in `docker-compose.yml`.
@@ -522,27 +556,6 @@ To switch email providers (e.g., SendGrid, Mailgun), modify the `mail.transport`
| `aiClient.baseUrl` | URL to reach AI service | Env var `AI_URL` |
| `aiClient.token` | Service communication token | Env var `INTERNAL_TOKEN` |
-#### Relay Configuration (Optional)
-
-Relay allows self-hosted instances to connect social media platform accounts via the official AiToEarn relay server, without needing to configure OAuth credentials for each platform.
-
-**Setup:**
-
-1. Go to **Settings → API Key** at [https://aitoearn.ai](https://aitoearn.ai) and create an API Key.
-2. Configure in the `aitoearn-server` service of `docker-compose.yml`:
-
-| Variable | Description | Default |
-|----------|-------------|---------|
-| `RELAY_SERVER_URL` | Relay server URL | `https://aitoearn.ai/api` |
-| `RELAY_API_KEY` | Your API Key (created in step 1) | None |
-| `RELAY_CALLBACK_URL` | Local callback URL for receiving relay results | `http://127.0.0.1:8080/api/plat/relay-callback` |
-
-```yaml
-RELAY_SERVER_URL: https://aitoearn.ai/api
-RELAY_API_KEY: your-api-key
-RELAY_CALLBACK_URL: http://127.0.0.1:8080/api/plat/relay-callback
-```
-
## Common Commands
```bash