Overview
SkillRise courses are structured hierarchically with courses containing chapters, and chapters containing lectures. The system automatically calculates course statistics and manages student enrollments.Course Structure
Data Model
The Course schema implements a flexible nested structure:server/models/Course.js
The nested structure (Course → Chapter → Lecture) is stored as embedded documents for efficient querying and atomic updates.
Course Hierarchy
Creating Courses
Add New Course
Educators can create courses with automatic statistic calculation:server/controllers/educatorController.js
Statistics Calculation
Automatically calculate total lectures and duration by traversing the course content hierarchy.
Retrieving Courses
Get All Published Courses
Public endpoint for browsing courses:server/controllers/courseController.js
Get Course Details with Access Control
Retrieve course details with conditional lecture URL access:server/controllers/courseController.js
Progress Tracking
Course Progress Model
server/models/CourseProgress.js
The unique compound index on
userId and courseId ensures each user has exactly one progress record per course.Educator Dashboard
Dashboard Statistics
Educators can view comprehensive course statistics:server/controllers/educatorController.js
Key Features
Hierarchical Structure
Three-level hierarchy (Course → Chapter → Lecture) allows flexible content organization.
Free Previews
Individual lectures can be marked as preview-free for marketing purposes.
Automatic Calculations
Total lectures and duration are calculated automatically from course content.
Progress Tracking
Per-user progress tracking with completed lecture arrays.
Access Control
Lecture URLs are hidden for non-enrolled users unless marked as preview-free.
Ratings System
Built-in course ratings with average and total counts.
Course States
Draft (isPublished: false)
Draft (isPublished: false)
Course is visible only to the educator. Used for content development before release.
Published (isPublished: true)
Published (isPublished: true)
Course is visible to all users and available for enrollment.
Enrolled
Enrolled
User has purchased the course and has full access to all lectures.