ai_qc/backend/apache_config.conf
nickviljoen 3fec052c12 Create frontend and backend folder structure for deployment
Organized the application into separate frontend and backend directories for cleaner deployment and better separation of concerns.

Frontend Directory (frontend/):
- index.html: Single-page web interface (renamed from web_ui.html)
- README.md: Frontend deployment guide
- Total size: ~113 KB (self-contained)
- Smart base path detection (works at / or /ai_qc/)
- No configuration changes required

Backend Directory (backend/):
- All Python files (api_server.py, llm_config.py, etc.)
- visual_qc_apps/: 33 QC check modules
- profiles/: 6 QC profile configurations
- brand_guidelines/: Reference asset storage
- config/: Environment configurations
- scripts/: Deployment automation
- uploads/, output/: Data directories
- requirements.txt, ai_qc.service, apache_config.conf
- Complete documentation

New Documentation:
- FOLDER_STRUCTURE.md: Comprehensive guide to new structure
- frontend/README.md: Frontend deployment instructions
- backend/BACKEND_README.md: Backend deployment guide

Deployment Mapping:
- frontend/ → /var/www/html/ai_qc/ (web root)
- backend/ → /opt/ai_qc/ (application directory)

Benefits:
- Clear separation of concerns
- Backend code not in web-accessible directory
- Independent frontend/backend updates
- Matches server's existing patterns (/opt/veo3, /opt/voice2text)
- Industry-standard architecture
- Easy to deploy and maintain

Original files preserved in root directory for reference.
Ready for production deployment following MIGRATION_GUIDE.md.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-06 11:55:53 +02:00

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