Admin Guide
This guide covers how to use LearnFlow as an administrator.
Getting Started as Admin
Accessing Admin Dashboard
- Login with admin credentials at http://localhost:3000/login
- You'll be redirected to the Admin Dashboard at http://localhost:3000/admin
- The dashboard shows platform statistics and quick actions
Admin Dashboard Overview
The admin dashboard displays:
- Total Users: Number of registered users
- Total Courses: Number of courses created
- Total Enrollments: Number of course enrollments
- Active Users: Users with active enrollments
- Published Courses: Courses visible to learners
Course Management
Creating a Course
- Navigate to Admin > Courses (http://localhost:3000/admin/courses)
- Click "Add Course" button
- Fill in the course details:
- Title: Course name
- Description: Course description
- Category: Select from Programming, Design, Marketing, Business, Data Science
- Level: Select from Beginner, Intermediate, Advanced
- Duration: Estimated duration (e.g., "4 hours")
- Thumbnail URL: Course thumbnail image URL
- Banner URL: Course banner image URL
- Click "Create Course"
Editing a Course
- Navigate to Admin > Courses
- Find the course in the list
- Click the edit icon (pencil)
- Update the course details
- Click "Save Changes"
Deleting a Course
- Navigate to Admin > Courses
- Find the course in the list
- Click the delete icon (trash)
- Confirm deletion
Warning: Deleting a course will also delete all associated lessons and enrollments.
Publishing a Course
- Navigate to Admin > Courses
- Find the course in the list
- Click the publish toggle to make it visible to learners
- Published courses appear in the learner's course catalog
Lesson Management
Adding Lessons to a Course
- Navigate to Admin > Courses
- Click on a course title to open lesson management
- Click "Add Lesson" button
- Fill in lesson details:
- Title: Lesson name
- Type: Select "Video" or "Text"
- Duration: Estimated duration (e.g., "15 minutes")
- Content: Video URL or text content
- Notes: Additional notes for learners
- Click "Create Lesson"
Editing a Lesson
- Navigate to Admin > Courses
- Click on a course title
- Find the lesson in the list
- Click the edit icon
- Update lesson details
- Click "Save Changes"
Deleting a Lesson
- Navigate to Admin > Courses
- Click on a course title
- Find the lesson in the list
- Click the delete icon
- Confirm deletion
Lesson Order
Lessons are displayed in the order they were created. To reorder lessons:
- Delete and recreate lessons in the desired order
- Or update the lesson order in MongoDB directly
User Management
Viewing Users
- Navigate to Admin > Users (http://localhost:3000/admin/users)
- View all registered users
- Filter by role (learner/admin)
- Search by email or name
User Details
Click on a user to view:
- Profile Information: Name, email, role
- Enrollment Statistics: Courses enrolled, completed
- Activity: Last login, account creation date
- Status: Active/Blocked
Changing User Role
- Navigate to Admin > Users
- Find the user in the list
- Click the role dropdown
- Select new role (learner/admin)
- Confirm the change
Note: You cannot change your own role.
Blocking/Unblocking Users
- Navigate to Admin > Users
- Find the user in the list
- Click the block/unblock button
- Confirm the action
Blocked users:
- Cannot log in
- Cannot access any features
- Cannot send messages
Analytics & Reporting
Platform Analytics
- Navigate to Admin > Analytics (http://localhost:3000/admin/analytics)
- View key metrics:
- Total Users: Registered user count
- Total Courses: Course count
- Total Enrollments: Enrollment count
- Active Users: Users with enrollments
- Published Courses: Visible courses
Category Distribution
View course distribution by category:
- Programming
- Design
- Marketing
- Business
- Data Science
Enrollment Trends
Track enrollment trends over time:
- Daily enrollments
- Daily completions
- Trend visualization
User Growth
Monitor user growth:
- Monthly new users
- Total user growth
- Growth visualization
Platform Insights
View platform insights:
- Average lesson views per course
- Overall completion rate
- Total lessons viewed
- Total enrollments
Reports
Course Report
- Navigate to Admin > Analytics
- Click "Course Report"
- Apply filters:
- Category: Filter by course category
- Level: Filter by difficulty level
- Date Range: Filter by creation date
- Limit: Number of results (5, 10, 20, 30, 50)
- View report with:
- Total enrollments
- Completed enrollments
- Completion rate
Student Report
- Navigate to Admin > Analytics
- Click "Student Report"
- Apply filters:
- Course: Filter by specific course
- Status: enrolled, completed, in_progress
- Date Range: Filter by enrollment date
- Limit: Number of results
- View report with:
- Student information
- Course details
- Progress percentage
- Enrollment status
User Report
- Navigate to Admin > Analytics
- Click "User Report"
- Apply filters:
- Role: Filter by user role
- Date Range: Filter by registration date
- Limit: Number of results
- View report with:
- User information
- Courses enrolled
- Courses completed
Activity Report
- Navigate to Admin > Analytics
- Click "Activity Report"
- Select date range
- View recent activity:
- New users
- New enrollments
- Course completions
- New courses
Communication
Viewing Messages
- Navigate to Admin > Messages (http://localhost:3000/admin/messages)
- View all private messages from learners
- Messages are organized by conversation
Replying to Messages
- Navigate to Admin > Messages
- Find the message thread
- Click "Reply" button
- Type your response
- Click "Send"
Direct Messaging
- Navigate to Admin > Messages
- Click "New Message"
- Select a learner from the list
- Type your message
- Click "Send"
Audit Logs
Viewing Audit Logs
- Navigate to Admin > Users (audit logs are accessible from user management)
- View all platform activities:
- User registrations
- User logins
- Course creations
- Course updates
- Lesson completions
- Enrollments
Filtering Audit Logs
Filter logs by:
- User: Specific user ID
- Action: Action type (user_login, course_created, etc.)
- Search: User email or name
- Limit: Number of results
Audit Log Details
Each log entry shows:
- User: Who performed the action
- Action: What action was performed
- Resource: What resource was affected
- IP Address: User's IP address
- User Agent: User's browser/client
- Timestamp: When the action occurred
Best Practices
Course Creation
- Write clear descriptions: Help learners understand what they'll learn
- Use appropriate categories: Make courses easy to find
- Set realistic durations: Help learners plan their time
- Add comprehensive lessons: Break content into digestible chunks
- Include notes: Provide additional context for learners
User Management
- Monitor active users: Keep track of platform usage
- Review blocked users: Regularly check if blocks should be lifted
- Manage roles carefully: Only promote trusted users to admin
- Respond to messages: Address learner inquiries promptly
Analytics
- Review regularly: Check analytics weekly
- Track trends: Monitor enrollment and completion trends
- Identify popular courses: Understand what learners want
- Improve completion rates: Identify courses with low completion rates
Security
- Review audit logs: Check for suspicious activity
- Monitor failed logins: Watch for brute force attempts
- Keep secrets secure: Never share admin credentials
- Regular backups: Ensure data is backed up regularly
Troubleshooting
Cannot Access Admin Dashboard
Problem: Redirected to learner dashboard after login
Solution:
- Verify your user role is "admin"
- Check database:
SELECT role FROM users WHERE email = 'your@email.com'; - Update role if needed:
UPDATE users SET role = 'ADMIN' WHERE email = 'your@email.com';
Course Not Visible to Learners
Problem: Learners cannot see the course
Solution:
- Check if course is published
- Navigate to Admin > Courses
- Toggle the publish switch for the course
Cannot Delete Course
Problem: Error when deleting course
Solution:
- Check if course has enrollments
- Unenroll all users first
- Then delete the course
Messages Not Sending
Problem: Cannot send messages to learners
Solution:
- Check if learner account is active
- Check if learner is blocked
- Verify learner exists in the system
Next Steps
- Learner Guide - Learn how learners use the platform
- Features - Explore all available features
- API Reference - API documentation for developers