Prerequisites
Before deploying to production:- Python 3.12.x or 3.13.x installed
- Archive database set up (MySQL or SQLite)
- SSL certificates configured (if using moderation)
- Server with sufficient resources
Production checklist
Generate secret key
Create a secure secret key for CSRF and API tokens:This automatically updates
config.toml with a secure random key.Generate asset hashes
Create integrity checksums for JavaScript files:This creates
asset_hashes.json for script tag integrity verification.Systemd service setup
Deploy Ayase Quart as a systemd service for automatic startup and process management.Set up application directory
Move your Ayase Quart installation to the production directory:Install in virtualenv:
Create systemd service file
Create
/etc/systemd/system/ayasequart.service:- Adjust
workersin hypercorn config based on CPU cores - Add
After=mysql.serviceif using MySQL - Uncomment
ProtectSystem=strictfor additional security (requires proper path permissions)
Reverse proxy setup
Use a reverse proxy for SSL termination, caching, and load balancing.nginx configuration
Caddy configuration
Caddy provides automatic HTTPS with Let’s Encrypt:Performance tuning
Hypercorn workers
Adjust workers based on CPU cores:Database connection pooling
Optimize database connections inconfig.toml:
Static file serving
For better performance, serve static files through nginx (shown in nginx config above). For media files, enable nginx sendfile inconfig.toml:
Monitoring and logs
View logs
Check application logs:Monitor resource usage
Updating Ayase Quart
Safely update to the latest version:Check configuration
Review Add any new required fields to your
config.tpl.toml for new options:config.toml.Backup strategies
Configuration backup
Database backup
MySQL:Moderation database backup
Security considerations
Firewall configuration
Rate limiting
Ensure rate limiting is enabled inconfig.toml:
Troubleshooting
Service won’t start
Permission errors
Database connection issues
Verify database connectivity:Next steps
Search setup
Add full-text search for better performance
Moderation guide
Configure content moderation and reporting