This guide will get you up and running with the HazeBot web interface in 5 minutes.
- Python 3.9+ installed
- HazeBot already set up
- Terminal/command line access
pip install flask flask-cors pyjwtOr use the requirements file:
pip install -r api_requirements.txtAdd these lines to your .env file:
API_PORT=5000
API_SECRET_KEY=my-super-secret-key-12345
API_ADMIN_USER=admin
API_ADMIN_PASS=mySecurePassword123
API_DEBUG=falseImportant: Change the password and secret key!
cd api
python app.pyYou should see:
Starting HazeBot Configuration API on port 5000
* Running on http://0.0.0.0:5000
- Install Flutter: https://docs.flutter.dev/get-started/install
- Run the app:
cd hazebot_admin
flutter pub get
flutter run -d chromeCreate test.html:
<!DOCTYPE html>
<html>
<head>
<title>HazeBot Config Test</title>
</head>
<body>
<h1>HazeBot Configuration</h1>
<button onclick="testAPI()">Test API Connection</button>
<pre id="output"></pre>
<script>
async function testAPI() {
// Login
const loginRes = await fetch('http://localhost:5000/api/auth/login', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
username: 'admin',
password: 'mySecurePassword123'
})
});
const {token} = await loginRes.json();
// Get config
const configRes = await fetch('http://localhost:5000/api/config', {
headers: {'Authorization': `Bearer ${token}`}
});
const config = await configRes.json();
document.getElementById('output').textContent =
JSON.stringify(config, null, 2);
}
</script>
</body>
</html>Open test.html in your browser and click "Test API Connection".
- Open the web interface
- Enter username:
admin - Enter password:
mySecurePassword123(or what you set) - Click Login
You can now:
- View all bot configuration in the dashboard
- Edit general settings (bot name, prefix, cooldowns)
- Update channel IDs
- Modify role configurations
- Configure meme sources
- Adjust Rocket League settings
- Customize welcome messages
- Make sure the API is running (
python api/app.py) - Check the port (default: 5000)
- Check your .env file
- Make sure API_ADMIN_USER and API_ADMIN_PASS match
- Flask-CORS should handle this automatically
- If issues persist, check Flask-CORS is installed
- You can use the HTML test page above
- Or access the API directly with curl/Postman
curl -X POST http://localhost:5000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"mySecurePassword123"}'curl http://localhost:5000/api/config \
-H "Authorization: Bearer YOUR_TOKEN_HERE"curl -X PUT http://localhost:5000/api/config/general \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"bot_name":"My New Bot Name"}'-
Secure your installation:
- Change default password
- Use strong API_SECRET_KEY
- Set API_DEBUG=false (default)
-
For production:
- See Admin Panel Setup for deployment instructions
- Use HTTPS (not HTTP)
- Configure firewall
- Use gunicorn instead of Flask dev server
-
For Android:
- Follow Admin Panel Setup to build APK
- Update API URL in Flutter app
- Sign the APK for distribution
- Bot Setup: BOT_SETUP.md
- Admin Panel: ADMIN_PANEL_SETUP.md
- API reference: ../api/README.md
Enjoy managing your HazeBot through the web interface! 🌿