Add Flask/Python backend server

- Create app.py with Flask server on port 5002
- Add requirements.txt with Python dependencies
- Add run_flask.bat for Windows users
- Add run_flask.sh for Linux/Mac users
- Complete Flask setup documentation
- Database integration with PyMySQL
- Full LLM API support (Gemini, DeepSeek, OpenAI, Claude)
- CORS configuration
- Error handling middleware

Features:
 Runs on http://127.0.0.1:5002
 All LLM APIs supported
 Database connection
 API proxy for CORS fix
 Auto setup scripts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
donald
2025-12-04 00:15:29 +08:00
parent c7b229dc93
commit 763cc7cfdd
5 changed files with 1030 additions and 0 deletions

27
requirements.txt Normal file
View File

@@ -0,0 +1,27 @@
# Flask 核心
Flask==3.0.0
Werkzeug==3.0.1
# CORS 支援
Flask-Cors==4.0.0
# 資料庫
PyMySQL==1.1.0
cryptography==41.0.7
# HTTP 請求
requests==2.31.0
# 環境變數
python-dotenv==1.0.0
# JSON 處理
jsonschema==4.20.0
# 日期時間
python-dateutil==2.8.2
# 開發工具(可選)
# pytest==7.4.3
# black==23.12.1
# flake8==6.1.0