A production-ready, enterprise-grade admin dashboard for managing comprehensive e-learning platforms. Built with modern web technologies, this dashboard provides administrators with powerful tools to manage courses, students, instructors, analytics, and payments.
The E-Learning Admin Dashboard is a feature-rich application designed for educational platform operators who need robust administration capabilities. It combines a professional user interface with intuitive workflows, making complex operations simple and efficient.
- Enterprise Architecture: Modular components, scalable design patterns, and production-ready code structure
- Full Authentication System: Secure login with session management and admin approval workflow
- Complete CRUD Operations: Manage courses, students, and instructors with real-time state updates
- Advanced Analytics: Comprehensive reporting with charts, metrics, and data export capabilities
- Responsive Design: Mobile-first approach with full desktop optimization
- Accessibility First: WCAG-compliant with full keyboard navigation and screen reader support
- Dark Mode Support: Seamless light and dark theme switching
- Secure admin login with email and password
- Session-based authentication with persistent storage
- Admin approval workflow for new instructors
- Role-based access control (admin-only interface)
- Logout functionality with session cleanup
- Real-time KPI cards with trend indicators
- Total Students
- Active Courses
- Monthly Revenue
- Course Completion Rate
- Student growth trends visualization
- Course enrollment analysis
- Category distribution analysis
- Recent activity feed
- Comprehensive course listing with advanced search and filtering
- Course status tracking (Draft, Published, Archived)
- Bulk operations support
- Add/Edit/Delete course workflows
- Instructor assignment
- Category management
- Enrollment tracking
- Complete student roster with detailed profiles
- Enrollment history tracking
- Progress indicators and completion rates
- Student status management (Active, Suspended)
- Bulk student operations
- Student drawer with detailed information
- Performance analytics per student
- Instructor approval workflow
- Performance metrics and statistics
- Revenue contribution tracking
- Assigned courses management
- Instructor performance charts
- Bulk approval/rejection actions
- Revenue trend analysis
- Completion rate metrics
- Student dropoff analysis
- Date range filtering
- Export functionality (CSV, PDF)
- Performance benchmarking
- Enrollment analytics
- Revenue summary cards
- Transaction history with detailed view
- Subscription plan management
- Payment status indicators
- Refund tracking
- Revenue by course/instructor
- Hierarchical lesson structure (Course β Module β Lesson)
- Visual drag-and-drop interface (UI support)
- Lesson status indicators
- Lesson reordering capabilities
- Content organization tools
- Platform-wide settings
- Theme customization (Light/Dark mode toggle)
- Notification preferences
- Security settings
- Role and permission management
- System configuration
- Profile information management
- Account settings
- Change password functionality
- Activity log tracking
- Account security options
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- UI Components: shadcn/ui
- Icons: Lucide React
- Charts: Recharts
- Forms: React Hook Form + Zod
- Animations: Framer Motion
- State Management: React Hooks + Custom Hooks
- Theme Management: next-themes
- TypeScript for type safety
- ESLint for code quality
- PostCSS for CSS processing
- Autoprefixer for browser compatibility
- Mock Data System: Complete mock data structure for development and testing
- Local Storage Persistence: Client-side storage for session and data persistence
- Custom Hooks: Purpose-built hooks for auth, courses, students, and instructors
- Server Actions Ready: Architecture supports easy migration to server actions and APIs
- Node.js 18+ (LTS recommended)
- npm or yarn package manager
- Modern web browser with JavaScript enabled
-
Clone the repository
git clone <repository-url> cd elearning-admin-dashboard
-
Install dependencies
npm install # or yarn install -
Run the development server
npm run dev # or yarn dev -
Open in browser Navigate to
http://localhost:3000
npm run build
npm run startnpm run lintelearning-admin-dashboard/
βββ app/
β βββ (auth)/ # Authentication routes
β β βββ layout.tsx # Auth layout wrapper
β β βββ login/
β β β βββ page.tsx # Login page with form
β β βββ register/
β β β βββ page.tsx # Admin registration page
β β βββ forgot-password/
β β βββ page.tsx # Password recovery
β βββ dashboard/
β β βββ layout.tsx # Dashboard layout with sidebar/topbar
β β βββ page.tsx # Dashboard overview
β βββ courses/
β β βββ layout.tsx # Courses section layout
β β βββ page.tsx # Course management page
β βββ students/
β β βββ layout.tsx # Students section layout
β β βββ page.tsx # Student management page
β βββ instructors/
β β βββ layout.tsx # Instructors section layout
β β βββ page.tsx # Instructor management page
β βββ analytics/
β β βββ layout.tsx # Analytics section layout
β β βββ page.tsx # Analytics & reports page
β βββ payments/
β β βββ layout.tsx # Payments section layout
β β βββ page.tsx # Payments & subscriptions page
β βββ content/
β β βββ layout.tsx # Content section layout
β β βββ page.tsx # Lesson management page
β βββ settings/
β β βββ page.tsx # Platform settings
β βββ profile/
β β βββ page.tsx # Admin profile page
β βββ layout.tsx # Root layout with providers
β βββ globals.css # Global styles and design tokens
β βββ page.tsx # Home/redirect page
β
βββ components/
β βββ layout/
β β βββ admin-layout.tsx # Main dashboard layout wrapper
β β βββ sidebar.tsx # Collapsible navigation sidebar
β β βββ topbar.tsx # Top navigation bar
β βββ dashboard/
β β βββ student-growth-chart.tsx # Line chart component
β β βββ course-enrollments-chart.tsx # Bar chart component
β β βββ course-categories-chart.tsx # Pie chart component
β β βββ recent-activity-table.tsx # Activity feed
β βββ courses/
β β βββ course-table.tsx # Courses data table
β β βββ course-modal.tsx # Add/Edit course dialog
β βββ students/
β β βββ student-table.tsx # Students data table
β β βββ student-drawer.tsx # Student detail view
β βββ instructors/
β β βββ instructor-table.tsx # Instructors data table
β βββ analytics/
β β βββ revenue-chart.tsx # Revenue trend chart
β β βββ completion-rate-chart.tsx # Completion metrics
β β βββ dropoff-analysis-chart.tsx # Dropoff visualization
β βββ payments/
β β βββ subscription-plans.tsx # Subscription card grid
β β βββ transactions-table.tsx # Payment history
β βββ common/
β β βββ breadcrumb.tsx # Breadcrumb navigation
β β βββ page-header.tsx # Page title with actions
β β βββ stats-card.tsx # KPI card component
β β βββ empty-state.tsx # Empty data state
β β βββ loading-skeleton.tsx # Skeleton loader
β βββ ui/ # shadcn/ui components
β
βββ hooks/
β βββ use-auth.ts # Authentication hook
β βββ use-courses.ts # Course management hook
β βββ use-students.ts # Student management hook
β βββ use-instructors.ts # Instructor management hook
β
βββ lib/
β βββ types.ts # TypeScript type definitions
β βββ mock-data.ts # Mock data generators
β βββ auth.ts # Authentication utilities
β βββ storage.ts # Local storage helpers
β βββ utils.ts # Utility functions
β
βββ public/ # Static assets
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ next.config.mjs # Next.js configuration
βββ tailwind.config.ts # Tailwind CSS configuration
βββ postcss.config.mjs # PostCSS configuration
βββ README.md # This file
-
Initial Login
- Navigate to
/login - Enter credentials (demo:
admin@example.com/password123) - Session is stored in localStorage
- Automatically redirected to dashboard
- Navigate to
-
Session Management
- Session persists across page refreshes
- Logout clears session and redirects to login
- Access to protected routes requires active session
-
View Courses
- Navigate to Courses section
- Search by title or instructor
- Filter by status (Draft, Published, Archived)
- Sort by enrollments, date, etc.
-
Add New Course
- Click Add New Course button
- Fill in course details
- Select instructor and category
- Set status and click Save
-
Edit Course
- Click Edit action on course row
- Update information
- Save changes
-
Delete Course
- Click Delete action
- Confirm deletion
-
View Students
- Navigate to Students section
- Search by name, email, or ID
- Filter by enrollment status
- View progress indicators
-
Student Details
- Click on student row to open drawer
- View enrollment history
- Check course progress
- View contact information
-
Bulk Operations
- Select multiple students
- Perform bulk actions (suspend, activate, etc.)
-
View Analytics
- Navigate to Analytics section
- Select date range for analysis
- View revenue trends, completion rates
- Analyze student dropoff patterns
-
Export Reports
- Click Export as CSV or Export as PDF
- Choose date range and metrics
- Download report file
// useAuth hook provides:
{
user: {
id: string;
email: string;
name: string;
role: 'admin';
};
isAuthenticated: boolean;
isLoading: boolean;
login: (email: string, password: string) => Promise<void>;
logout: () => void;
register: (data: RegisterData) => Promise<void>;
}// useCourses hook provides:
{
courses: Course[];
isLoading: boolean;
error: string | null;
addCourse: (course: CourseData) => void;
updateCourse: (id: string, data: Partial<CourseData>) => void;
deleteCourse: (id: string) => void;
searchCourses: (query: string) => Course[];
}// useStudents hook provides:
{
students: Student[];
isLoading: boolean;
error: string | null;
addStudent: (student: StudentData) => void;
updateStudent: (id: string, data: Partial<StudentData>) => void;
enrollStudent: (studentId: string, courseId: string) => void;
searchStudents: (query: string) => Student[];
}Displays KPI information with trend indicators.
<StatsCard
title="Total Students"
value={1234}
trend={{ value: 12, direction: 'up' }}
icon={Users}
/>Page title with action buttons.
<PageHeader
title="Course Management"
description="Manage all courses in your platform"
actions={[
{ label: 'Add Course', onClick: handleAdd, variant: 'default' }
]}
/>Shows when no data is available.
<EmptyState
icon={Inbox}
title="No courses yet"
description="Get started by creating your first course"
action={{ label: 'Create Course', onClick: handleCreate }}
/>Searchable, filterable course listing.
<CourseTable
courses={courses}
onEdit={handleEdit}
onDelete={handleDelete}
onView={handleView}
/>Student roster with filtering and bulk actions.
<StudentTable
students={students}
onSelectStudent={handleSelect}
onBulkAction={handleBulkAction}
/>Edit app/globals.css to customize design tokens:
@theme inline {
--color-primary: #3B82F6; /* Primary brand color */
--color-accent: #F97316; /* Accent color */
--color-background: #FFFFFF; /* Background color */
--color-foreground: #1F2937; /* Text color */
--radius: 0.5rem; /* Border radius */
}- Create new files in
app/[section]/ - Use the AdminLayout wrapper
- Integrate with custom hooks
- Follow existing component patterns
- Update
lib/auth.tswith your provider - Modify
hooks/use-auth.tsfor API calls - Update environment variables
- Test authentication flow
Forms use React Hook Form with Zod schema validation:
const courseSchema = z.object({
title: z.string().min(3, 'Title must be at least 3 characters'),
description: z.string().min(10, 'Description required'),
category: z.enum(['Programming', 'Design', 'Business']),
price: z.number().min(0, 'Price must be positive'),
instructor: z.string().min(1, 'Instructor required'),
});
type CourseFormData = z.infer<typeof courseSchema>;The dashboard is built with accessibility as a core principle:
- ARIA Labels: All interactive elements have proper ARIA labels
- Keyboard Navigation: Full keyboard support for all features
- Screen Reader Support: Semantic HTML and ARIA roles throughout
- Color Contrast: WCAG AA compliant color combinations
- Focus Indicators: Clear focus states for keyboard users
- Semantic HTML: Proper use of headings, nav, main elements
Tab- Navigate between elementsShift + Tab- Navigate backwardsEnter- Activate buttons and linksEsc- Close modals and drawersSpace- Toggle checkboxes
- Code Splitting: Route-based code splitting with Next.js
- Image Optimization: Optimized images and SVG icons
- Data Fetching: React hooks with memoization
- CSS: Tailwind CSS production build optimization
- Bundling: Tree-shaking and minification in production
- Chrome (latest 2 versions)
- Firefox (latest 2 versions)
- Safari (latest 2 versions)
- Edge (latest 2 versions)
- Mobile browsers (iOS Safari, Chrome Mobile)
-
Replace mock data calls
// Before (mock) const courses = mockCourses; // After (API) const { data: courses } = await fetch('/api/courses').then(r => r.json());
-
Update hooks to use fetch/SWR
import useSWR from 'swr'; export function useCourses() { const { data, error, isLoading } = useSWR('/api/courses', fetcher); return { courses: data, isLoading, error }; }
-
Create API routes
// app/api/courses/route.ts export async function GET() { const courses = await db.courses.findAll(); return Response.json(courses); }
- Keep components single-responsibility
- Use custom hooks for business logic
- Maintain type safety with TypeScript
- Follow naming conventions consistently
- Lazy load heavy components
- Memoize expensive computations
- Optimize re-renders with React.memo
- Use proper key props in lists
- Validate all form inputs
- Sanitize user-generated content
- Use HTTPS in production
- Implement CSRF protection
- Secure session management
- Unit test utility functions
- Integration test page flows
- E2E test critical user paths
- Test accessibility with screen readers
Issue: Login not working
- Clear localStorage and refresh
- Check browser console for errors
- Verify credentials match mock data
Issue: Data not persisting
- Ensure localStorage is enabled
- Check browser storage limits
- Verify hook integration
Issue: Charts not displaying
- Check data is being passed correctly
- Verify Recharts is properly installed
- Check console for rendering errors
Contributions are welcome! Please follow these guidelines:
- Create a feature branch from
main - Commit changes with clear messages
- Push to your fork
- Submit a pull request with description
- Use TypeScript for type safety
- Follow existing patterns and conventions
- Add comments for complex logic
- Test before submitting PR
This project is licensed under the MIT License - see LICENSE file for details.
- Documentation: See this README
- Issues: Report bugs on GitHub
- Discussions: Join community discussions
- Email: support@elearningplatform.com
- Complete admin dashboard with 10+ pages
- Full authentication system
- Course, student, instructor management
- Advanced analytics and reporting
- Payment and subscription tracking
- Dark mode support
- Mobile-responsive design
- Accessibility features
Solomon Kassa
Full-stack developer with expertise in modern web technologies, SaaS applications, and enterprise software design. Passionate about creating scalable, user-centric solutions.
- GitHub: @solomonkassa
- Email: me@solomonkassa.dev
- Portfolio: kassa.dev
- Built with Next.js
- UI Components from shadcn/ui
- Charts powered by Recharts
- Icons by Lucide React
- Styling with Tailwind CSS
Built with β€οΈ by Solomon Kassa