Design a Udemy-like app
Difficulty: MEDIUMCategory: HLDFrequency: 1Asked On 2024-02-05
Problem Statement
Designing a Udemy-like platform that allows instructors to create and publish courses, and learners to browse, enroll, and consume course content. The system should handle video streaming, quizzes, payments, and reviews at scale while ensuring a smooth user experience.
Functional Requirements (FR)
User Management
•Users can register/login as learners or instructors.
•Maintain user profiles, progress tracking, and activity history.
Course Management
•Instructors can create courses, upload video lectures, PDFs, and quizzes.
•Support course categorization by topic, level, and language.
•Allow editing, updating, or deleting courses.
Enrollment & Access
•Learners can browse courses via search or categories.
•Enroll in free or paid courses.
•Track learner progress and completion certificates.
Video & Content Delivery
•Stream videos with adaptive bitrate for different network conditions.
•Downloadable content support (optional).
•Support subtitles, captions, and course notes.
Assessment & Quizzes
•Instructors can create quizzes and assignments.
•Learners can submit answers and get immediate feedback.
Reviews & Ratings
•Learners can rate and review courses.
•Instructors can view feedback to improve content.
Payments
•Handle course payments via payment gateway integration.
•Support refunds, discounts, and promotions.
Notifications
•Notify learners about course updates, new courses, and deadlines.
•Notify instructors about enrollment metrics and reviews.
Non-Functional Requirements (NFR)
•Scalability: Support millions of learners and thousands of courses.
•Performance: Fast search and video streaming.
•Availability: High uptime, especially for course access.
•Security: Secure authentication, content access control, and payment handling.
•Extensibility: Easy to add features like live sessions, certification, or discussion forums.
Core Components / Modules
Frontend / UI
•Web and mobile apps for learners and instructors.
•Course browsing, search, video player, quizzes, and profile management.
API Gateway
•Route requests to appropriate backend services.
User Service
•Manage learner/instructor accounts and authentication.
•Track progress and activity logs.
Course Service
•Store course metadata (title, description, category, language).
•Manage lessons, videos, quizzes, and assignments.
Content Delivery / Media Service
•Video hosting and streaming (CDN-backed).
•Support adaptive bitrate streaming and caching.
Enrollment & Payment Service
•Handle enrollments, subscriptions, and course purchases.
•Integrate with payment gateways and manage refunds.
Notification Service
•Email, push notifications, and in-app alerts.
Search & Recommendation Service
•Search courses by keywords, categories, or instructor.
•Personalized recommendations using past activity and preferences.
Analytics & Reporting
•Track user engagement, course popularity, and completion rates.
Database Layer
•User DB (SQL/NoSQL)
•Course DB (metadata, lessons, quizzes)
•Media storage (S3 / object storage for videos and PDFs)
•Analytics DB for logs and metrics
High-Level Data Flow
1.Learner requests course list → API Gateway → Course Service → Search/Recommendation → Return results.
2.Learner enrolls in course → Enrollment Service → Payment Gateway → Update User Progress.
3.Learner streams video → Media Service → CDN → Learner device.
4.Instructor uploads video → Media Service → CDN → Updates Course DB.
5.Analytics Service collects metrics from course access, enrollments, and user activity.
Advanced Features (Optional / Bonus)
•Live sessions with real-time interaction.
•Gamification (badges, points, leaderboards).
•AI-based course recommendations and adaptive learning paths.
•Discussion forums and Q&A per course.
•Multi-language support and subtitles for videos.