Added comprehensive migration documentation and configuration files for restructuring the application to split frontend/backend: New Documentation: - MIGRATION_GUIDE.md: Complete step-by-step migration instructions - MIGRATION_SUMMARY.md: Quick reference guide for deployment - MIGRATION_CHECKLIST.md: Printable checklist for migration day - DEPLOYMENT_RESTRUCTURE.md: Architecture overview and benefits New Configuration Files: - run_api_server.py: Production WSGI server wrapper using Waitress - ai_qc.service: Systemd service configuration for backend - apache_config.conf: Apache virtual host configuration template Updated Files: - requirements.txt: Added waitress>=2.1.2 for production WSGI server - README.md: Added deployment documentation section Migration Overview: - Split current monolithic structure into separate frontend/backend - Move backend to /opt/ai_qc/ (following server standards) - Keep frontend in /var/www/html/ai_qc/ (single index.html) - Use Apache reverse proxy to connect frontend to backend API - Implement systemd service for reliable backend process management Benefits: - Improved security (backend code not in web root) - Better separation of concerns - Follows industry best practices - Matches existing server app patterns (/opt/veo3, /opt/voice2text) - Easier independent updates of frontend/backend 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
70 lines
1.9 KiB
Text
70 lines
1.9 KiB
Text
# Apache Configuration for Visual AI QC
|
|
# Save to: /etc/apache2/sites-available/ai_qc.conf
|
|
# Enable with: sudo a2ensite ai_qc.conf
|
|
|
|
<VirtualHost *:80>
|
|
ServerName your-domain.com
|
|
ServerAlias www.your-domain.com
|
|
|
|
# Document root for frontend
|
|
DocumentRoot /var/www/html/ai_qc
|
|
|
|
<Directory /var/www/html/ai_qc>
|
|
Options -Indexes +FollowSymLinks
|
|
AllowOverride None
|
|
Require all granted
|
|
|
|
# Serve index.html as default
|
|
DirectoryIndex index.html
|
|
</Directory>
|
|
|
|
# Proxy API requests to Flask backend
|
|
# Handle both /api and /ai_qc/api patterns (frontend auto-detects)
|
|
ProxyPreserveHost On
|
|
|
|
# If serving from subdirectory /ai_qc/
|
|
ProxyPass /ai_qc/api http://localhost:7183/api
|
|
ProxyPassReverse /ai_qc/api http://localhost:7183/api
|
|
|
|
# If serving from root /
|
|
ProxyPass /api http://localhost:7183/api
|
|
ProxyPassReverse /api http://localhost:7183/api
|
|
|
|
# Increase timeout for long-running analysis
|
|
ProxyTimeout 300
|
|
|
|
# Serve uploaded files from backend location
|
|
Alias /uploads /opt/ai_qc/uploads
|
|
<Directory /opt/ai_qc/uploads>
|
|
Options -Indexes
|
|
Require all granted
|
|
</Directory>
|
|
|
|
# Serve output files from backend location
|
|
Alias /output /opt/ai_qc/output
|
|
<Directory /opt/ai_qc/output>
|
|
Options -Indexes
|
|
Require all granted
|
|
</Directory>
|
|
|
|
# Development folders (optional, comment out in production)
|
|
Alias /uploads-dev /opt/ai_qc/uploads-dev
|
|
<Directory /opt/ai_qc/uploads-dev>
|
|
Options -Indexes
|
|
Require all granted
|
|
</Directory>
|
|
|
|
Alias /output-dev /opt/ai_qc/output-dev
|
|
<Directory /opt/ai_qc/output-dev>
|
|
Options -Indexes
|
|
Require all granted
|
|
</Directory>
|
|
|
|
# Logging
|
|
ErrorLog ${APACHE_LOG_DIR}/ai_qc_error.log
|
|
CustomLog ${APACHE_LOG_DIR}/ai_qc_access.log combined
|
|
|
|
</VirtualHost>
|
|
|
|
# Enable required Apache modules with:
|
|
# sudo a2enmod proxy proxy_http alias
|