Web Interface
RedHarmony provides a web interface for easy control and monitoring of your bot. This interface is built using Flask and provides a simple way to manage your bot's operations.
Web Server Features
The web interface provides several key features:
- Start/stop bot operations
- Monitor bot status
- View activity statistics
- Control bot behavior
Getting Started
Starting the Web Server
The web interface runs on Flask and can be started in two ways:
# Development mode (default port 8080)
python app.py
# Production mode (using gunicorn)
gunicorn app:app --bind localhost:8080
Available Endpoints
1. Main Endpoint
@app.route('/')
- Purpose: Starts the bot and provides status
- Method: GET
- Response: Text confirmation of bot running status
2. Status Monitoring
@app.route('/status')
- Purpose: Get current bot status
- Method: GET
- Response: JSON with activity metrics
- Current status (active/inactive)
- Posts created today
- Comments made today
- Rate limit status
Security Considerations
The web interface is configured to:
- Run on localhost by default
- Require authentication for sensitive operations
- Implement rate limiting for API endpoints
- Log all access attempts
Best Practices
-
Production Deployment
- Use HTTPS in production
- Implement proper authentication
- Set up monitoring
- Use environment-specific configurations
-
Monitoring
- Regular health checks
- Activity logging
- Performance metrics
- Error tracking
-
Maintenance
- Regular updates
- Backup procedures
- Error handling
- Resource management