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

@@ -73,6 +73,7 @@ Web interface available at: `http://<raspberry-pi-ip>:8080`
- **USB Backup**: Automatic backup to multiple USB drives with CRC32 verification
- **Data Integrity**: Every file write is verified with CRC checksums
- **HiFiBerry Support**: Optimized for HiFiBerry DAC+ADC Pro audio quality
- **Production-Ready**: Uses Waitress WSGI server for stable, production-grade web serving
- **Real-time Status**: Monitor phone status (on-hook/off-hook/recording)
- **Auto-refresh**: Status updates every 5 seconds
@@ -95,6 +96,7 @@ Web interface available at: `http://<raspberry-pi-ip>:8080`
- numpy>=1.21.0
- pyaudio>=0.2.13
- RPi.GPIO>=0.7.1
- waitress>=2.1.0 (production WSGI server)
## Installation
@@ -127,7 +129,7 @@ sudo apt-get install -y python3-pyaudio portaudio19-dev
# Install Python dependencies with UV
make sync
# Or manually:
# uv pip install flask numpy pyaudio RPi.GPIO
# uv pip install flask numpy pyaudio RPi.GPIO waitress
```
#### Option B: Using pip
@@ -135,7 +137,7 @@ make sync
```bash
sudo apt-get update
sudo apt-get install -y python3-pip python3-pyaudio portaudio19-dev
pip3 install flask numpy RPi.GPIO
pip3 install flask numpy RPi.GPIO waitress
```
### 4. Configure HiFiBerry