AfroMax Admin Dashboard
A unified admin dashboard for managing the AfroMax platform with centralized access to all administrative tools.
Overview
The AfroMax Admin Dashboard provides a single point of access for all administrative functions including content curation, user management, and infrastructure monitoring.
Overview
The AfroMax Admin Dashboard provides a single point of access for all administrative functions including content curation, user management, and infrastructure monitoring.
Quick Start
- Access the Dashboard: Navigate to
/web/admin/index.html
- Sign In: Click "Sign In with Google" and authenticate with your admin account
- First Time Setup: If this is your first time, go to the Setup module to grant admin privileges
- Start Managing: Access any of the available modules from the unified dashboard
Available Modules
📌 Editor's Picks Dashboard
File: editors-picks.html
Curate featured content shown to new users.
Features:
- Browse event and profile category videos
- Separate event picks and profile picks
- Filter by views, likes, categories
- Real-time video search
- Batch selection and management
- Auto-categorization by video type
Use Cases:
- Select trending event videos for "Event Picks"
- Choose quality profile videos for new user recommendations
- Update featured content regularly
- Monitor video performance metrics
👥 Suggested Creators Dashboard
File: suggested-creators.html
Manage the list of creators suggested to new users.
Features:
- Browse all platform users with profiles
- Filter by minimum follower count
- Sort by followers, name, or join date
- Reorder suggestions (move up/down)
- Toggle active/inactive status
- Export creators list
Use Cases:
- Add popular creators to suggestions
- Reorder based on content quality
- Temporarily disable suggestions
- Monitor creator growth
☁️ Cloudflare Migration Dashboard
File: migration-dashboard.html
Monitor and manage video migration from Firebase Storage to Cloudflare Stream.
Features:
- View migration progress and statistics
- Initialize migration for videos
- Batch migrate videos (configurable batch size)
- Monitor asset generation (thumbnails, first frames, HLS streams)
- View real-time migration logs
- Diagnose migration issues
- Update processing status
Use Cases:
- Migrate videos to Cloudflare for better performance
- Monitor upload and processing status
- Troubleshoot failed migrations
- Track cost optimization
🔧 Admin Setup
File: setup.html
Grant admin access to new users (one-time setup).
Features:
- Sign in with Google
- Create admin access for current user
- Automatic permission setup
- Redirect to dashboard after setup
Use Cases:
- First-time admin account creation
- Grant admin privileges to team members
- Initialize admin permissions
Setup Instructions
1. First-Time Admin Setup
If you're setting up admin access for the first time:
- Open
/web/admin/setup.html in your browser
- Deploy Firestore rules:
firebase deploy --only firestore:rules
- Click "Sign in with Google" and authenticate
- Click "Create Admin Access" to grant yourself admin privileges
- Navigate to the main dashboard at
/web/admin/index.html
2. Adding Additional Admins
To grant admin access to other users:
- Have the new admin navigate to
/web/admin/setup.html
- They sign in with their Google account
- They click "Create Admin Access"
- They can now access the admin dashboard
3. Accessing the Dashboard
Once you have admin access:
- Navigate to
/web/admin/index.html
- Sign in with your Google account
- Dashboard will verify your admin status automatically
- Access any module from the main dashboard
4. Firestore Security Rules
Ensure your firestore.rules includes admin access control:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Admin collection - only admin users can read/write their own record
match /admins/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
// Editor's picks - only admin users can manage
match /editorsPicks/{docId} {
allow read: if true; // Public read access
allow write: if request.auth != null && isAdmin(request.auth.uid);
}
// Suggested creators - only admin users can manage
match /suggestedCreators/{docId} {
allow read: if true; // Public read access
allow write: if request.auth != null && isAdmin(request.auth.uid);
}
function isAdmin(userId) {
return exists(/databases/$(database)/documents/admins/$(userId));
}
}
}
Deploy rules:
firebase deploy --only firestore:rules
Dashboard Features
Unified Interface
- Single Sign-On: Authenticate once, access all modules
- Real-time Stats: View platform metrics at a glance
- Quick Actions: Common tasks accessible from home screen
- Module Cards: Organized access to all admin functions
- Responsive Design: Works on desktop, tablet, and mobile
Statistics Dashboard
The main dashboard displays:
- Total videos on the platform
- Total registered users
- Number of suggested creators
- Number of editor's picks
- Real-time refresh capability
Navigation
- Direct Links: Each module card links to its dedicated dashboard
- Quick Actions: Fast access to common tasks
- Back Navigation: Easy return to main dashboard
Security Best Practices
1. Never Commit Secrets
- The
.env file is already in .gitignore
- Never commit actual API keys or sensitive configuration to version control
2. Use HTTPS in Production
- Always serve admin dashboards over HTTPS in production
- Configure Firebase security rules appropriately
3. Regular Security Audits
- Regularly review admin user access
- Monitor admin dashboard usage
- Update Firebase SDK versions regularly
4. IP Restrictions (Optional)
For enhanced security, consider restricting admin dashboard access by IP:
// Example Express.js middleware
const adminIPs = ['192.168.1.100', '10.0.0.5']; // Your admin IPs
function restrictToAdminIPs(req, res, next) {
const clientIP = req.ip;
if (adminIPs.includes(clientIP)) {
next();
} else {
res.status(403).send('Access denied');
}
}
app.use('/admin/*', restrictToAdminIPs);
Troubleshooting
Configuration Error
If you see "Firebase configuration is missing or invalid":
- Check that your
.env file exists and has correct values
- Verify environment variables are being loaded properly
- Check browser developer console for specific error messages
Authentication Issues
If Google authentication fails:
- Verify Firebase API key is correct for your project
- Check that your domain is authorized in Firebase Console
- Ensure Firestore security rules allow admin access
Access Denied
If you can't access admin functions after login:
- Verify your user exists in the
admins collection in Firestore
- Check Firestore security rules are correctly configured
- Confirm you're signed in with the correct Google account
Files Overview
firebase-config-loader.js - Secure configuration loader
editors-picks.html - Main admin dashboard
setup.html - Admin user setup interface
.env.example - Environment variables template
firestore.rules - Database security rules