Add production WSGI server and CLAUDE.md documentation

- Replace Flask development server with Waitress production WSGI server
- Add waitress>=2.1.0 dependency to pyproject.toml and Makefile
- Configure 4-thread server for better performance and stability
- Create comprehensive CLAUDE.md guide for future development
- Document architecture, deployment, testing, and common patterns
- Update README.md with production-ready feature and dependencies

Eliminates Flask development server warning and provides production-grade
web serving suitable for Raspberry Pi deployment.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-27 12:18:19 +07:00
parent 6ff7664f31
commit 72e39f9515
5 changed files with 334 additions and 6 deletions

View File

@@ -14,6 +14,7 @@ import numpy as np
import threading
from flask import Flask, render_template, request, send_file, jsonify, redirect, url_for
from werkzeug.utils import secure_filename
from waitress import serve
import json
import sys
import zlib
@@ -1989,13 +1990,15 @@ def main():
# Get and display local IP
local_ip = get_local_ip()
print("\n" + "="*60)
print(f"🚀 Wedding Phone System Starting...")
print(f"Web Interface Available At:")
print(f" http://{local_ip}:{WEB_PORT}")
print(f" http://localhost:{WEB_PORT}")
print("="*60 + "\n")
# Start Flask web server
app.run(host='0.0.0.0', port=WEB_PORT, debug=False, threaded=True)
# Start production WSGI server (waitress)
print(f"Starting production server on 0.0.0.0:{WEB_PORT}")
serve(app, host='0.0.0.0', port=WEB_PORT, threads=4)
if __name__ == "__main__":
main()