This commit is contained in:
beabigegg
2025-11-13 08:18:15 +08:00
parent 788e2409df
commit df5411e44c
38 changed files with 1163 additions and 445 deletions

264
README.md
View File

@@ -1,106 +1,212 @@
# AI Meeting Assistant
# AI Meeting Assistant V2.1
An intelligent meeting assistant designed to streamline your workflow by transcribing, summarizing, and managing action items from your meetings. This full-stack application leverages a Python Flask backend for robust API services and a React frontend for a dynamic user experience.
一個智能會議助手系統旨在通過轉錄、摘要和管理您會議中的行動項目來簡化您的工作流程。此全棧應用程式使用Python Flask後端提供強大的API服務React前端提供動態用戶體驗。
## Key Features
## 🔑 主要功能
- **User Authentication**: Secure login and registration system with role-based access control (Admin, User).
- **Meeting Management**: Create, view, and manage meetings. Upload transcripts or generate them from audio.
- **AI-Powered Summary**: Automatically generate concise summaries from lengthy meeting transcripts.
- **Action Item Tracking**: Automatically preview and batch-create action items from summaries. Manually add, edit, and delete action items with assigned owners and due dates.
- **Permission Control**: Granular permissions for editing and deleting meetings and action items based on user roles (Admin, Meeting Owner, Action Item Owner).
- **File Processing Tools**: Independent tools for audio extraction, transcription, and text translation.
- **LDAP/AD 認證**: 整合企業Active Directory進行安全登入支援本地備用認證
- **用戶管理**: 基於角色的訪問控制(管理員、用戶),管理員可刪除用戶帳號
- **會議管理**: 創建、查看和管理會議,上傳轉錄或從音頻生成轉錄
- **AI智能摘要**: 從冗長的會議轉錄自動生成簡潔摘要
- **行動項目追蹤**: 自動預覽並批量創建摘要中的行動項目,手動添加、編輯和刪除行動項目並分配負責人和截止日期
- **權限控制**: 基於用戶角色(管理員、會議所有者、行動項目所有者)的精細權限管理
- **檔案處理工具**: 獨立的音頻提取、轉錄和文本翻譯工具
## Tech Stack
## 🏗️ 技術棧
**Backend:**
- **Framework**: Flask
- **Database**: SQLAlchemy with Flask-Migrate for schema migrations.
- **Authentication**: Flask-JWT-Extended for token-based security.
- **Async Tasks**: Celery with Redis/RabbitMQ for handling long-running AI tasks.
- **API**: RESTful API design.
**後端:**
- **框架**: Flask + Gunicorn
- **資料庫**: MySQL (生產環境) + SQLAlchemy ORM
- **認證**: Flask-JWT-Extended + LDAP整合
- **異步任務**: Celery + Redis
- **API**: RESTful API設計
**Frontend:**
- **Framework**: React.js
- **UI Library**: Material-UI (MUI)
- **Tooling**: Vite
- **API Communication**: Axios
**前端:**
- **框架**: React.js
- **UI**: Material-UI (MUI)
- **構建工具**: Vite
- **API通訊**: Axios
## Prerequisites
**部署:**
- **容器化**: Docker + Docker Compose
- **服務編排**: Redis, Backend, Celery Worker, Celery Flower, Frontend
- **生產就緒**: 包含健康檢查和資源限制
- Python 3.10+
- Node.js 20.x+
- A message broker for Celery (e.g., Redis or RabbitMQ)
## 📋 系統需求
## Installation & Setup
- Docker Desktop (Windows/macOS) 或 Docker Engine (Linux)
- Docker Compose V2
- 至少4GB可用記憶體
- 企業Active Directory (LDAP) 服務器訪問權限
### 1. Backend Setup
## 🚀 快速部署
### 方法一:一鍵部署(推薦)
Clone the repository:
```bash
# 克隆專案
git clone <your-repository-url>
cd AI_meeting_assistant_-_V2.1
cd AI_meeting_assistant-V2.1
# 啟動所有服務(強制重建以確保使用最新代碼)
docker-compose up -d --build
# 檢查服務狀態
docker-compose ps
# 停止服務
docker-compose down
# 查看日誌
docker-compose logs -f
```
Create a virtual environment and install dependencies:
### 方法二:開發環境設置
如需自定義配置或開發調試,請參考下方的詳細設置說明。
## 🔧 詳細配置
### 環境變數配置
主要配置已在`docker-compose.yml`中設定,如需修改:
```yaml
# 資料庫配置
DATABASE_URL: mysql+pymysql://username:password@host:port/database
# LDAP配置
LDAP_SERVER: your-domain.com
LDAP_PORT: 389
LDAP_BIND_USER_DN: CN=LdapBind,CN=Users,DC=DOMAIN,DC=COM
LDAP_BIND_USER_PASSWORD: your-bind-password
LDAP_SEARCH_BASE: OU=Users,DC=domain,DC=com
LDAP_USER_LOGIN_ATTR: userPrincipalName
# JWT配置
JWT_SECRET_KEY: your-super-secret-key
# AI服務配置Dify API
DIFY_API_BASE_URL: https://your-dify-server.com/v1
DIFY_STT_API_KEY: app-xxxxxxxxxx
DIFY_TRANSLATOR_API_KEY: app-xxxxxxxxxx
DIFY_SUMMARIZER_API_KEY: app-xxxxxxxxxx
DIFY_ACTION_EXTRACTOR_API_KEY: app-xxxxxxxxxx
```
### 服務端口
- **前端**: http://localhost:12015
- **後端API**: http://localhost:5000
- **Celery Flower監控**: http://localhost:5555
- **Redis**: localhost:6379
## 👥 用戶角色與權限
### 管理員權限
- 查看所有用戶列表
- 刪除用戶帳號(除自己外)
- 管理所有會議和行動項目
- 修改任何會議狀態
### 一般用戶權限
- 管理自己創建的會議
- 編輯分配給自己的行動項目
- 查看有權限的會議內容
### 預設管理員
- 系統預設將 `ymirliu@panjit.com.tw` 設為管理員角色
- 其他AD帳號預設為一般用戶角色
## 🔧 維護與監控
### 查看服務日誌
```bash
# For Windows
python -m venv venv
venv\Scripts\activate
# 查看所有服務日誌
docker-compose logs -f
# For macOS/Linux
python3 -m venv venv
source venv/bin/activate
# 查看特定服務日誌
docker-compose logs -f backend
docker-compose logs -f celery-worker
```
### 健康檢查
系統包含自動健康檢查:
- Backend: HTTP健康檢查
- Frontend: HTTP健康檢查
- Celery: 程序狀態監控
### 備份與恢復
```bash
# 資料庫備份需要mysql客戶端
mysqldump -h mysql.theaken.com -P 33306 -u A060 -p db_A060 > backup.sql
# 檔案備份
docker-compose exec backend tar -czf /app/uploads/backup.tar.gz /app/uploads
```
## 🛠️ 開發指南
### 本地開發設置
1. **後端開發**:
```bash
# 安裝依賴
pip install -r requirements.txt
```
Create a `.env` file by copying `.env.example` (if provided) or creating a new one. Configure the following:
```
FLASK_APP=app.py
SECRET_KEY=your_super_secret_key
SQLALCHEMY_DATABASE_URI=sqlite:///meetings.db # Or your preferred database connection string
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0
```
# 啟動Flask開發服務器
flask run --port 5000
Initialize and apply database migrations:
```bash
flask db init # Only if you don't have a 'migrations' folder
flask db migrate -m "Initial migration"
flask db upgrade
```
### 2. Frontend Setup
Navigate to the frontend directory and install dependencies:
```bash
cd frontend
npm install
```
## Running the Application
The application requires three separate processes to be running: the Flask server, the Celery worker, and the Vite frontend server.
**1. Start the Flask Backend Server:**
```bash
# From the project root directory
flask run
```
The API server will be running on `http://127.0.0.1:5000`.
**2. Start the Celery Worker:**
Open a new terminal, activate the virtual environment, and run:
```bash
# From the project root directory
# 啟動Celery Worker
celery -A celery_worker.celery worker --loglevel=info
```
**3. Start the React Frontend Server:**
Open a third terminal and run:
2. **前端開發**:
```bash
# From the 'frontend' directory
cd frontend
npm install
npm run dev
```
The frontend application will be available at `http://localhost:5173`. Open this URL in your browser.
### 資料庫遷移
```bash
# 建立新遷移
docker-compose exec backend flask db migrate -m "Description"
# 應用遷移
docker-compose exec backend flask db upgrade
```
## 🐛 疑難排解
### 常見問題
**1. LDAP認證失敗**
- 檢查LDAP服務器連接性
- 驗證綁定用戶憑證
- 確認搜索基準DN正確
**2. Celery任務無響應**
- 檢查Redis服務狀態
- 重啟Celery Worker: `docker-compose restart celery-worker`
- 查看Worker日誌: `docker-compose logs celery-worker`
**3. 前端無法連接後端**
- 確認後端服務運行在5000端口
- 檢查防火牆設置
- 驗證API base URL配置
### 獲取支援
- 查看服務日誌進行初步診斷
- 檢查系統資源使用情況
- 聯繫IT管理員協助LDAP配置問題
## 📄 授權
此專案為企業內部使用,請遵守公司軟體使用政策。
---
**版本**: V2.1
**最後更新**: 2025-09-18
**維護團隊**: PANJIT IT Team