09---dashboard-guide.mdโข10.5 kB
---
title: 09 - Dashboard Guide
type: knowledge-note
created: 2025-11-05T18:02:49.627Z
tags: ["dashboard", "analytics", "AI", "optional", "gemini"]
---
# 09 - Dashboard Guide
# Dashboard Guide (Optional Feature)
Complete guide to Build Crew Bot's optional AI-powered dashboard features.
---
## Overview
The dashboard provides AI-powered analytics and insights for your Build Crew community.
**Important:**
- Dashboard is **100% OPTIONAL**
- Bot works perfectly without it
- Requires Google Gemini API key
- Features are embedded in bot cogs
---
## Requirements
### 1. Gemini API Key
**Get your free API key:**
1. Go to https://aistudio.google.com/apikey
2. Click **"Create API Key"**
3. Choose existing Google Cloud project or create new one
4. Copy the API key
**Add to config.py:**
```python
GEMINI_API_KEY = "AIzaSyAbc123..."
```
### 2. Configuration
```python
# In config.py
# Required for dashboard
GEMINI_API_KEY = "your_gemini_api_key_here"
# Optional: Dashboard access control
DASHBOARD_GUILD_ID = 1234567890123456789 # Your server ID
DASHBOARD_ROLE_ID = 9876543210987654321 # Role that can access dashboard
DASHBOARD_SECRET_KEY = "random-secret-string-here" # For Flask sessions
```
### 3. No Separate Launch Required
Dashboard features run as part of main bot:
```bash
python main.py
```
**That's it!** All AI features are now enabled.
---
## Dashboard Features
### 1. Word Cloud Generation
**Command:** `/wordcloud`
**Description:** Generates visual word cloud from channel messages
**Usage:**
```
/wordcloud channel:#general limit:1000
```
**Parameters:**
- `channel` - Channel to analyze
- `limit` - Number of recent messages (default: 500, max: 2000)
**Output:**
- PNG image of word cloud
- Top keywords highlighted
- Sentiment analysis
**Example:**
```
/wordcloud channel:#build-crew-chat limit:1000
[Generates word cloud showing:]
- Most common words: "build", "project", "help", "code"
- Color-coded by frequency
- Excludes common stop words
```
---
### 2. Conversation Analysis
**Feature:** Automatic analysis of channel activity
**What it does:**
- Analyzes message patterns
- Identifies discussion topics
- Tracks engagement levels
- Detects sentiment trends
**Access:**
```
!conversation_analysis [channel]
```
**Output:**
```
๐ Conversation Analysis - #general
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Activity: High
๐ฌ Messages: 1,247 (last 7 days)
๐ฅ Active Users: 89
๐ Top Topics:
1. Project collaboration (23%)
2. Technical questions (18%)
3. Resource sharing (15%)
๐ Sentiment: Mostly Positive (87%)
๐ฅ Peak Hours: 2pm-5pm EST
```
---
### 3. Power User Detection
**Feature:** Identifies most engaged community members
**What it tracks:**
- Message frequency
- Quality of contributions
- Helping others
- Thread participation
- Voice activity
**Access:**
```
!power_users [days]
```
**Output:**
```
โญ Power Users - Last 30 Days
โโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฅ @JohnDoe
โโ Messages: 342
โโ Threads Started: 12
โโ Helped Others: 47 times
โโ Voice Hours: 23h
๐ฅ @JaneDoe
โโ Messages: 287
โโ Threads Started: 8
โโ Helped Others: 31 times
โโ Voice Hours: 15h
๐ฅ @Developer
โโ Messages: 234
โโ Threads Started: 15
โโ Helped Others: 29 times
โโ Voice Hours: 11h
```
---
### 4. Marketing Intelligence
**Feature:** Analyzes engagement for marketing insights
**What it provides:**
- User acquisition trends
- Engagement metrics
- Retention analysis
- Growth predictions
- Content performance
**Access:**
```
!marketing_insights [period]
```
**Output:**
```
๐ Marketing Intelligence
โโโโโโโโโโโโโโโโโโโโโโ
๐ Growth (Last 30 Days)
โโ New Members: +127
โโ Retention: 84%
โโ Active Users: 423/645 (66%)
โโ Projected Growth: +150 next month
๐ฌ Engagement
โโ Messages/Day: 387
โโ Threads/Week: 23
โโ Voice Hours/Week: 145h
โโ Most Active Channel: #build-crew-chat
๐ฏ Top Acquisition Sources
1. Invite Codes: 73 (57%)
2. Email Verification: 54 (43%)
๐
Best Posting Times
โโ Weekdays: 2pm-5pm EST
โโ Weekends: 10am-2pm EST
```
---
### 5. Daily Digest
**Feature:** Automated daily summary sent to configured channel
**What it includes:**
- Daily message count
- New members
- Top contributors
- Most active channels
- Trending topics
**Configuration:**
```python
# In config.py
DAILY_DIGEST_CHANNEL_ID = 1234567890123456789
DAILY_DIGEST_TIME = "09:00" # 24-hour format
```
**Example Output:**
```
๐ฐ Daily Digest - November 5, 2024
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฅ New Members: 8
๐ฌ Messages: 437
๐๏ธ Voice Hours: 23h
๐ฅ Top Contributors
1. @JohnDoe (47 messages)
2. @JaneDoe (31 messages)
3. @Developer (28 messages)
๐ Most Active Channels
1. #build-crew-chat (187 messages)
2. #cohort-1 (94 messages)
3. #help (71 messages)
๐ก Trending Topics
- Next.js deployment
- Database optimization
- Project collaboration
```
---
### 6. Stage Monitor
**Feature:** Tracks and analyzes Stage channel activity
**What it monitors:**
- Stage sessions duration
- Speaker participation
- Audience engagement
- Topic discussions
**Access:**
```
!stage_stats [days]
```
**Output:**
```
๐๏ธ Stage Activity - Last 7 Days
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Sessions: 12
โฑ๏ธ Total Time: 34h 15m
๐ฅ Unique Speakers: 23
๐ข Avg Audience: 47
๐ Top Sessions
1. "Building Scalable APIs" - 3h 45m
2. "React Best Practices" - 2h 30m
3. "Career in Tech Q&A" - 2h 15m
```
---
## Setup Instructions
### Minimal Setup (Just Word Cloud)
```python
# In config.py - Only this is required
GEMINI_API_KEY = "your_api_key_here"
```
Restart bot:
```bash
python main.py
```
Test:
```
/wordcloud channel:#general
```
---
### Full Dashboard Setup
```python
# In config.py
# Required
GEMINI_API_KEY = "your_gemini_api_key_here"
# Optional: Access Control
DASHBOARD_GUILD_ID = 1234567890123456789
DASHBOARD_ROLE_ID = 9876543210987654321 # Staff role ID
DASHBOARD_SECRET_KEY = "change-this-random-string"
# Optional: Daily Digest
DAILY_DIGEST_CHANNEL_ID = 1234567890123456789
DAILY_DIGEST_TIME = "09:00" # 24-hour format
# Optional: Analytics Settings
ANALYTICS_ENABLED = True
ANALYTICS_LOOKBACK_DAYS = 30
```
---
## Dashboard Commands Summary
| Command | Description | Requires Gemini |
|---------|-------------|----------------|
| `/wordcloud` | Generate word cloud | โ
Yes |
| `!conversation_analysis` | Analyze discussions | โ
Yes |
| `!power_users` | Top contributors | โ
Yes |
| `!marketing_insights` | Growth analytics | โ
Yes |
| `!stage_stats` | Stage activity | โ No |
---
## API Rate Limits
### Gemini API Free Tier
- **60 requests per minute**
- **1,500 requests per day**
**If you exceed limits:**
- Error message shown
- Try again in a few minutes
- Consider upgrading to paid tier
**Optimize usage:**
- Don't generate word clouds too frequently
- Set reasonable message limits
- Cache results when possible
---
## Privacy & Data
### What Data is Processed
**For Word Cloud:**
- Channel message content (text only)
- Processed temporarily
- Not stored permanently
**For Analytics:**
- Message counts
- User activity metrics
- Aggregate statistics
- No message content stored
### What's NOT Collected
- โ User DMs
- โ Private messages
- โ Message content (except temporary for word cloud)
- โ Personal information
### Gemini API Privacy
- Data sent to Google Gemini API
- Subject to Google's privacy policy
- Read: https://ai.google.dev/gemini-api/terms
---
## Troubleshooting
### "Gemini API key not set"
**Solution:**
```python
# Add to config.py
GEMINI_API_KEY = "your_key_here"
```
### "API rate limit exceeded"
**Solution:**
- Wait a few minutes
- Reduce frequency of requests
- Check daily quota usage
### Word cloud not generating
**Possible causes:**
1. **No messages in channel**
- Solution: Choose channel with messages
2. **Invalid API key**
- Solution: Verify key in config.py
3. **API quota exceeded**
- Solution: Wait or upgrade plan
### Dashboard commands not appearing
**Solution:**
1. Verify `GEMINI_API_KEY` is set
2. Restart bot: `python main.py`
3. Wait for command sync
4. Check bot.log for errors
---
## Disabling Dashboard
**To disable all AI features:**
```python
# In config.py
GEMINI_API_KEY = "" # Leave empty
```
**Or remove specific features:**
```python
# Disable daily digest
DAILY_DIGEST_ENABLED = False
# Disable analytics
ANALYTICS_ENABLED = False
```
**Bot will work normally** without dashboard features.
---
## Cost Considerations
### Free Tier (Gemini)
- **Cost: $0/month**
- **Limits:** 60 req/min, 1,500 req/day
- **Best for:** Small to medium servers
### Paid Tier (Gemini)
- **Cost: Pay per use**
- **Limits:** Much higher
- **Best for:** Large active servers
**Typical usage costs:**
- Word cloud: ~$0.001 per generation
- Analytics: ~$0.01 per day
- **Estimated: $5-15/month** for active server
---
## Advanced Configuration
### Custom Analytics Period
```python
# In config.py
ANALYTICS_LOOKBACK_DAYS = 30 # Default: 30 days
MAX_MESSAGES_ANALYZE = 2000 # Default: 500
```
### Word Cloud Customization
```python
# In config.py
WORDCLOUD_MAX_WORDS = 100 # Default: 50
WORDCLOUD_BACKGROUND = "black" # Default: "white"
WORDCLOUD_COLORMAP = "viridis" # Default: "plasma"
```
### Daily Digest Customization
```python
# In config.py
DAILY_DIGEST_ENABLED = True
DAILY_DIGEST_CHANNEL_ID = 1234567890123456789
DAILY_DIGEST_TIME = "09:00" # 24-hour format
DAILY_DIGEST_TIMEZONE = "America/New_York"
DAILY_DIGEST_INCLUDE_STATS = True
DAILY_DIGEST_INCLUDE_TOP_USERS = True
```
---
## Best Practices
### Frequency
- **Word clouds:** Once per week max
- **Analytics:** Daily or weekly
- **Power users:** Monthly
- **Marketing insights:** Weekly
### Performance
- Limit message analysis to 500-1000
- Run heavy analytics during off-peak hours
- Cache results when possible
### User Privacy
- Announce analytics features to users
- Allow users to opt-out if desired
- Don't share individual user data publicly
---
## Next Steps
- [[08 - Bot Commands Reference]] - All bot commands
- [[10 - API Server Guide]] - API integration
- [[07 - Troubleshooting]] - Common issues
---
*Created: 05/11/2025, 18:02:49*