Overview
The Admin Dashboard provides comprehensive control over the Studley AI platform, including user management, content moderation, notifications, and system monitoring.Accessing the Admin Dashboard
Admin access is restricted to authorized accounts only. Regular users cannot access admin features.
Admin Account Setup
Admin accounts are created directly in the database. To create an admin user:Admin Authentication
Admin users authenticate through the same login system as regular users, but gain access to additional admin-only routes and features. Default Admin Credentials (from migration012_create_admin_user.sql):
- Email:
[email protected] - Password: Set in Supabase Auth dashboard
Dashboard Sections
The admin dashboard is organized into several key sections:Notifications Tab
Create and manage platform-wide announcements that appear to all users.- Create new notifications with title and message
- Set optional expiration dates
- Toggle notifications on/off
- Monitor active notifications
Content Moderation
Monitor and manage inappropriate content attempts.- View flagged quiz topics
- Track user violations
- Review moderation history
User Management
Access user accounts and activity data.- View all registered users
- Monitor user activity
- Manage user credits
- Track generation history
Error Code Reference
Access a comprehensive list of all system error codes.- Browse errors by category (Generation, Content, Network, Database)
- Test error displays
- Help diagnose user-reported issues
Access Control
Row Level Security (RLS)
Admin operations are protected by RLS policies that check admin status:RLS policies ensure that only authenticated admin users can modify platform configuration and access sensitive data.
Admin-Only Tables
The following tables are restricted to admin access:admin_config- Site configuration settingsadmin_notifications- Platform announcementsbug_reports- User-submitted bug reportsuser_feedback- User feedback submissions
Configuration Management
Admins can modify site-wide configuration stored in theadmin_config table:
- Site settings (announcements, banners, FAQ)
- Feature flags
- Rate limiting rules
- Maintenance mode status
Monitoring Features
Rate Limiting
Track generation rate limits via thegeneration_rate_limits table:
- Monitor request frequency by identifier
- Identify potential abuse
- Adjust rate limiting rules
Credit Usage
Monitor platform-wide credit usage:- Total credits consumed
- Per-user credit history
- Credit transaction logs
Generation Analytics
Track all AI generations across the platform:- Quiz generations
- Flashcard generations
- Study guide generations
- Writing prompt generations
- AI workspace sessions
Security Best Practices
Environment Variables
Ensure these environment variables are properly secured:Admin Components
The following React components power the admin dashboard:admin-notifications.tsx- Notification management UIadmin-inappropriate-monitor.tsx- Content moderation interfaceadmin-error-codes.tsx- Error code reference vieweradmin-quiz-monitor.tsx- Quiz activity monitoringadmin-team-manager.tsx- Team member management
Next Steps
Admin Notifications
Learn how to create and manage platform-wide announcements
User Management
Manage user accounts and monitor activity
Content Moderation
Review and moderate inappropriate content
Database Schema
Explore the complete database structure