- Add one-click backend setup script documentation - Document Windows build scripts with --api-url parameter - Add runtime configuration options for config.json - Include GitHub Actions CI/CD workflow instructions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
7.1 KiB
Meeting Assistant Deployment Guide
Prerequisites
- Python 3.10+
- Node.js 18+
- MySQL 8.0+
- Access to Dify LLM service
Quick Start
Use the startup script to run all services locally:
# Check environment
./start.sh check
# Start all services
./start.sh start
# Stop all services
./start.sh stop
# View status
./start.sh status
Backend Deployment
Quick Start (One-Click Setup)
使用一鍵設置腳本自動安裝依賴並啟動服務:
Linux/macOS/WSL:
./scripts/setup-backend.sh start
Windows:
.\scripts\setup-backend.bat start
腳本命令:
| 命令 | 說明 |
|---|---|
setup |
僅設置環境(安裝依賴) |
start |
設置並啟動後端服務(預設) |
stop |
停止後端服務 |
--port PORT |
指定服務端口(預設: 8000) |
--no-sidecar |
不安裝 Sidecar 依賴 |
Manual Setup
1. Setup Environment
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# or: venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
2. Configure Environment Variables
# Copy example and edit
cp .env.example .env
Required Environment Variables:
| Variable | Description |
|---|---|
BACKEND_HOST |
Server bind address (default: 0.0.0.0) |
BACKEND_PORT |
Server port (default: 8000) |
DB_HOST, DB_PORT, DB_USER, DB_PASS, DB_NAME |
MySQL connection |
AUTH_API_URL |
Company authentication API |
DIFY_API_URL, DIFY_API_KEY, DIFY_STT_API_KEY |
Dify API settings |
ADMIN_EMAIL |
Admin user email |
JWT_SECRET |
JWT signing secret (generate secure random string) |
Optional Environment Variables:
| Variable | Description | Default |
|---|---|---|
DB_POOL_SIZE |
Database connection pool size | 5 |
JWT_EXPIRE_HOURS |
JWT token expiration | 24 |
UPLOAD_TIMEOUT |
File upload timeout (ms) | 600000 |
DIFY_STT_TIMEOUT |
STT processing timeout (ms) | 300000 |
LLM_TIMEOUT |
LLM request timeout (ms) | 120000 |
MAX_FILE_SIZE |
Max upload size (bytes) | 524288000 |
See backend/.env.example for complete documentation.
3. Run Server
# Development
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# Production
uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
4. Verify Deployment
curl http://localhost:8000/api/health
# Should return: {"status":"healthy","service":"meeting-assistant"}
5. Production Deployment (1Panel)
For detailed server deployment instructions including Nginx, systemd, and SSL configuration, see:
Or use the deployment script:
sudo ./scripts/deploy-backend.sh install --port 8000
Electron Client Deployment
1. Prerequisites
- Windows: Node.js 18+, Python 3.10+ (for building Sidecar)
- Disk Space: 5GB+ recommended (Whisper model + build artifacts)
2. Quick Build (Windows)
使用一鍵打包腳本在 Windows 上建置免安裝執行檔:
# 完整建置(使用預設 localhost)
.\scripts\build-client.bat build --clean
# 指定後端 API URL
.\scripts\build-client.bat build --api-url "http://192.168.1.100:8000/api" --clean
# 使用公司伺服器
.\scripts\build-client.bat build --api-url "https://api.company.com/api"
# 僅打包 Electron(已打包過 Sidecar)
.\scripts\build-client.bat build --skip-sidecar --api-url "http://your-server:8000/api"
或使用 PowerShell:
.\scripts\build-all.ps1 -ApiUrl "http://192.168.1.100:8000/api" -Clean
打包腳本參數:
| 參數 | 說明 |
|---|---|
--api-url URL |
後端 API URL(會寫入 config.json) |
--skip-sidecar |
跳過 Sidecar 打包(已打包過時使用) |
--clean |
建置前清理所有暫存檔案 |
3. Runtime Configuration
打包後的 exe 會讀取 config.json 中的設定:
{
"apiBaseUrl": "http://localhost:8000/api",
"uploadTimeout": 600000,
"appTitle": "Meeting Assistant",
"whisper": {
"model": "medium",
"device": "cpu",
"compute": "int8"
}
}
方式一:打包時指定(推薦)
.\scripts\build-client.bat build --api-url "http://your-server:8000/api"
方式二:打包前手動編輯 client/config.json
方式三:打包後修改(適合測試)
- 執行檔旁邊的
resources/config.json可在打包後修改
4. Manual Setup (Development)
cd client
# Install dependencies
npm install
# Start in development mode
npm start
5. Build Output
建置完成後,輸出檔案位於:
client/dist/- Electron 打包輸出build/- 最終整合輸出(含 exe)
輸出檔案:
Meeting Assistant-1.0.0-portable.exe- 免安裝執行檔
6. GitHub Actions (CI/CD)
也可以使用 GitHub Actions 自動建置:
- 前往 GitHub Repository → Actions
- 選擇 "Build Windows Client"
- 點擊 "Run workflow"
- 輸入
api_url參數(例如http://192.168.1.100:8000/api) - 等待建置完成後下載 artifact
Transcription Sidecar
1. Setup
cd sidecar
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
pip install pyinstaller
2. Download Whisper Model
The model will be downloaded automatically on first run. For faster startup, pre-download:
from faster_whisper import WhisperModel
model = WhisperModel("medium", device="cpu", compute_type="int8")
3. Build Executable
python build.py
The executable will be in sidecar/dist/transcriber.
4. Package with Electron
Copy sidecar/dist/ to client/sidecar/ before building Electron app.
Database Setup
The backend will automatically create tables on first startup. To manually verify:
USE your_database;
SHOW TABLES LIKE 'meeting_%';
Expected tables:
meeting_usersmeeting_recordsmeeting_conclusionsmeeting_action_items
Testing
Backend Tests
cd backend
pytest tests/ -v
Performance Verification
On target hardware (i5/8GB):
- Start the Electron app
- Record 1 minute of audio
- Verify transcription completes within acceptable time
- Test AI summarization with the transcript
Troubleshooting
Database Connection Issues
- Verify MySQL is accessible from server
- Check firewall rules for database port
- Verify credentials in .env
Dify API Issues
- Verify API key is valid
- Check Dify service status
- Review timeout settings for long transcripts (adjust
DIFY_STT_TIMEOUT,LLM_TIMEOUT)
Transcription Issues
- Verify microphone permissions
- Check sidecar executable runs standalone
- Review audio format (16kHz, 16-bit, mono)
- Try different
WHISPER_MODELsizes (tiny, base, small, medium)
Security Notes
- Never commit
.envfiles to version control - Keep JWT_SECRET secure and unique per deployment
- Ensure HTTPS in production (see 1panel-deployment.md)
- Regular security updates for dependencies