feat: implement core course platform UI and logic

- Add project configuration and git ignore rules
- Implement App router with protected routes
- Develop course player, grid, and card components
- Add state management for course progress and navigation
- Initialize database services for course and comment data
This commit is contained in:
MMrp89
2026-08-27 12:34:12 -03:00
parent a1de78971d
commit 684f929f28
34 changed files with 5450 additions and 11 deletions

66
types.ts Normal file
View File

@@ -0,0 +1,66 @@
export type SectionVariant = 'landscape' | 'portrait';
export type AttachmentType = 'pdf' | 'spreadsheet' | 'zip' | 'doc' | 'image' | 'link' | 'video';
export interface Attachment {
id: string;
name: string;
type: AttachmentType;
url: string;
size?: string; // e.g. "4.2 MB"
description?: string;
lessonId?: string; // Associated lesson or global course asset
downloadCount?: number;
}
export interface Lesson {
id: string;
title: string;
duration: string;
videoUrl: string;
isFree: boolean; // true = Public, false = Pro (Login required)
description?: string;
attachments?: Attachment[]; // Lesson-specific downloadable materials
}
export interface Course {
id: string;
title: string;
category: string;
thumbnail: string;
lessons: Lesson[];
progress?: number; // 0 to 100
views?: number;
duration: string; // Total duration or lesson count
description: string;
instructor?: string;
instructorRole?: string;
tips?: string[]; // Key takeaways / instructor tips
attachments?: Attachment[]; // Downloadable materials across entire course
}
export interface Section {
title: string;
variant: SectionVariant;
courses: Course[];
}
export type UserRole = 'professor' | 'student';
export interface User {
email: string;
name: string;
role: UserRole;
avatar?: string;
}
export interface Comment {
id: string;
courseId: string;
lessonId?: string;
user: string;
text: string;
date: string;
reply?: string; // Professor's reply
replyDate?: string;
}