The Courses app is a full-featured learning management system (LMS). Instructors can create courses with chapters, lessons, quizzes, and assignments. Students enroll, track their progress, and receive certificates on completion. The app supports multiple course types, pricing models, and detailed analytics.
Course creation with chapters, lessons (video, text, mixed), quizzes, and assignments
Student enrollment with progress tracking and completion status
Multiple course types — course, webinar, and text lesson
Pricing support — free or paid courses with revenue tracking
Rich dashboard with stats, quick navigation, and recent courses list
Route Purpose /business/apps/coursesInstructor dashboard with stats and recent courses /business/apps/courses/newCreate a new course /business/apps/courses/listFull course listing /business/apps/courses/[id]Course detail and management /business/apps/courses/[id]/editEdit course metadata /business/apps/courses/[id]/studentsStudent enrollment management /business/apps/courses/[id]/assignmentsAssignment listing /business/apps/courses/[id]/assignments/newCreate assignment /business/apps/courses/[id]/assignments/[assignmentId]Assignment detail /business/apps/courses/[id]/quizzesQuiz listing /business/apps/courses/[id]/quizzes/newCreate quiz /business/apps/courses/[id]/quizzes/[quizId]Quiz detail /business/apps/courses/[id]/quizzes/[quizId]/resultsQuiz results
The app uses types from $lib/apps/courses/types/index.js backed by the ext_courses database schema. This is one of the most complex data models in the platform.
Type Key fields Courseid, instructor_id, title, slug, type (course/webinar/text_lesson), level (all/beginner/intermediate/advanced), status, price, is_free, enrollment_count, rating_avgChaptercourse_id, title, sort_orderChapterItemchapter_id, item_type (lesson/quiz/assignment/file), item_id, sort_order, is_free_previewLessoncourse_id, title, content, video_url, video_provider (youtube/vimeo/upload/external), type (video/text/mixed)Enrollmentcourse_id, user_id, status (active/completed/expired/refunded), progress_percent, completed_items, total_itemsProgressenrollment_id, user_id, item_type, item_id, completed
Type Purpose LessonAttachmentFiles attached to lessons (title, file_path, file_size, file_type) CourseFileStandalone course files with accessibility levels (enrolled/free/paid) TimeTrackingDaily time-spent records per enrollment PersonalNoteStudent notes tied to a course or specific lesson PrerequisiteCourse prerequisite relationships CourseFaqSortable FAQ entries for courses
CourseWithInstructor — course with instructor profile
ChapterWithItems — chapter with its ordered items
CourseWithChapters — course with full chapter hierarchy
LessonWithAttachments — lesson with file attachments
EnrollmentWithCourse / EnrollmentWithProgress — enrollment with related data
Function Description getInstructorStats(userId)Returns CourseStats: total courses, published, total students, revenue listInstructorCourses(userId, {})Returns all courses; dashboard shows the 5 most recent
The dashboard is organized into four sections:
Stats grid — four Card components showing Total Courses, Published, Total Students, and Revenue
Quick navigation — six cards in a 3-column grid linking to My Courses, Create Course, Students, Analytics, Settings, and Browse Courses
Recent courses list — up to 5 courses with thumbnail, title, type, student count, date, price (or “Free”), and status badge
Empty state — prompt to create the first course
draft — secondary variant
published — default variant
inactive — destructive variant
Tip
The course content structure uses a chapter > items hierarchy where ChapterItem is a polymorphic join that can reference lessons, quizzes, assignments, or files via the item_type and item_id fields. This allows flexible content ordering within chapters.
Bundles app — courses can be grouped into bundles for discounted pricing
Certificates app — certificate templates can be linked to a course_id for automatic issuance on completion
Quizzes and Assignments — these are separate sub-apps ($lib/apps/quizzes, $lib/apps/assignments) with their own services, accessed as nested routes under each course
Video providers — lessons support YouTube, Vimeo, direct uploads, and external video URLs
Progress tracking — granular per-item completion tracking with percentage rollup at the enrollment level