feat: Extract hardcoded configs to environment variables

- Add environment variable configuration for backend and frontend
- Backend: DB_POOL_SIZE, JWT_EXPIRE_HOURS, timeout configs, directory paths
- Frontend: VITE_API_BASE_URL, VITE_UPLOAD_TIMEOUT, Whisper configs
- Create deployment script (scripts/deploy-backend.sh)
- Create 1Panel deployment guide (docs/1panel-deployment.md)
- Update DEPLOYMENT.md with env var documentation
- Create README.md with project overview
- Remove obsolete PRD.md, SDD.md, TDD.md (replaced by OpenSpec)
- Keep CORS allow_origins=["*"] for Electron EXE distribution

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
egg
2025-12-14 14:31:55 +08:00
parent 43c413c5ce
commit 01aee1fd0d
19 changed files with 1460 additions and 311 deletions

View File

@@ -6,14 +6,14 @@ import io
import os
from ..database import get_db_cursor
from ..config import settings
from ..models import TokenPayload
from .auth import get_current_user, is_admin
router = APIRouter()
# Directory paths
TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "template")
RECORD_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "record")
# Base directory for resolving relative paths
BASE_DIR = os.path.join(os.path.dirname(__file__), "..", "..")
def fill_template_workbook(
@@ -186,8 +186,12 @@ async def export_meeting(
)
actions = cursor.fetchall()
# Get directory paths from config
template_dir = settings.get_template_dir(BASE_DIR)
record_dir = settings.get_record_dir(BASE_DIR)
# Check for template file
template_path = os.path.join(TEMPLATE_DIR, "meeting_template.xlsx")
template_path = os.path.join(template_dir, "meeting_template.xlsx")
if os.path.exists(template_path):
# Load and fill template
wb = load_workbook(template_path)
@@ -204,10 +208,10 @@ async def export_meeting(
filename = f"meeting_{meeting.get('uuid', meeting_id)}.xlsx"
# Ensure record directory exists
os.makedirs(RECORD_DIR, exist_ok=True)
os.makedirs(record_dir, exist_ok=True)
# Save to record directory
record_path = os.path.join(RECORD_DIR, filename)
record_path = os.path.join(record_dir, filename)
wb.save(record_path)
# Save to bytes buffer for download