# Tasks: Extract Environment Variables ## 1. Backend Configuration - [x] 1.1 Update `backend/app/config.py` with new environment variables - Add: BACKEND_HOST, BACKEND_PORT - Add: DB_POOL_SIZE, JWT_EXPIRE_HOURS - Add: UPLOAD_TIMEOUT, DIFY_STT_TIMEOUT, LLM_TIMEOUT, AUTH_TIMEOUT - Add: TEMPLATE_DIR, RECORD_DIR, MAX_FILE_SIZE, SUPPORTED_AUDIO_FORMATS - [x] 1.2 Update `backend/app/database.py` to use DB_POOL_SIZE from config - [x] 1.3 Update `backend/app/routers/ai.py` to use Dify timeout configs (DIFY_STT_TIMEOUT, LLM_TIMEOUT) - [x] 1.4 Update `backend/app/routers/auth.py` to use AUTH_TIMEOUT and JWT_EXPIRE_HOURS from config - [x] 1.5 Update `backend/app/routers/export.py` to use TEMPLATE_DIR and RECORD_DIR from config - [x] 1.6 Update `backend/.env` with all new variables - [x] 1.7 Update `backend/.env.example` with all variables (without sensitive values) ## 2. Frontend/Electron Configuration - [x] 2.1 Create `client/.env` with VITE_API_BASE_URL and Whisper settings - [x] 2.2 Create `client/.env.example` as template - [x] 2.3 Update `client/src/services/api.js` to use import.meta.env.VITE_API_BASE_URL - [x] 2.4 Update `client/src/main.js` to pass Whisper env vars to Sidecar process ## 3. Startup Scripts - [x] 3.1 Update `start.sh` to load environment variables properly - [x] 3.2 Create `scripts/deploy-backend.sh` for standalone backend deployment ## 4. Deployment Documentation - [x] 4.1 Create `docs/1panel-deployment.md` with step-by-step guide - Include: Prerequisites and system requirements - Include: Python environment setup - Include: Environment variable configuration (IT only needs HOST + PORT) - Include: Nginx reverse proxy configuration example - Include: Systemd service file example - Include: SSL/HTTPS setup guide (optional) - Include: Troubleshooting common issues ## 5. Validation - [ ] 5.1 Test backend starts with new config - [ ] 5.2 Test frontend builds with environment variables - [ ] 5.3 Test API connectivity between frontend and backend - [ ] 5.4 Verify all hardcoded values are externalized