-```bash
-npm run dev
-# or
-yarn dev
-# or
-pnpm dev
-# or
-bun dev
-```
-Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
-You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
-
-This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
-
-## Learn More
-
-To learn more about Next.js, take a look at the following resources:
-
-- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
-- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
-
-You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
-
-## Deploy on Vercel
-
-The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
-
-Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
+## Key Features:
+- 📚 **Browse & Filter Courses**
+- 💳 **Purchase Courses with Stripe**
+- 📈 **Track Progress for Each Course**
+- 🖥️ **Student Dashboard**
+- 🎓 **Teacher Mode**
+- 🔄 **Easily reorder chapter positions with drag and drop**
+- ➕ **Create New Courses and Chapters**
+- 📤 **Upload Thumbnails, Attachments, and Videos with UploadThing**
+- 🎥 **Secure HLS Video Player using Mux**
+- ✍️ **Rich Text Editor for Chapter Descriptions**
diff --git a/actions/getCourses.ts b/actions/getCourses.ts
new file mode 100644
index 00000000..03a289ba
--- /dev/null
+++ b/actions/getCourses.ts
@@ -0,0 +1,73 @@
+import { db } from "@/lib/db";
+import { Category, Course } from "@prisma/client";
+import { getProgress } from "./getProgress";
+
+type CourseWithProgressWithCategory = Course & {
+ category: Category | null;
+ chapters: { id: string }[];
+ progress: number | null;
+};
+
+type GetCourses = {
+ userId: string;
+ title?: string;
+ categoryId?: string;
+};
+
+export const getCourses = async ({
+ userId,
+ title,
+ categoryId,
+}: GetCourses): Promise+ {initialData.isFree ? <>This chapter is free for preview> : <>This chapter is not free>} +
+ )} + {isEditing && ( + + + )} +{initialData.title}
} + {isEditing && ( + + + )} ++ {attachment.name} +
+ {deletingId === attachment.id && ( ++ {selectedOption?.label || 'No Category'} +
+ )} + + {isEditing && ( + + + )} ++ Drag and drop to reorder the chapters +
+ )} ++ {initialData.description || 'No description'} +
+ )} + {isEditing && ( + + + )} ++ {initialData.price ? formatPrice(initialData.price) : 'No Price'} +
+ )} + {isEditing && ( + + + )} ++ {initialData.title} +
+ ) + + } + {isEditing && ( + + + )} +TODO: Chapters
++ What would you like to name your course? Don't worry, you can change it later. +
+ +
- src/app/page.tsx
-
- .
- {category}
+{formatPrice(price)}
+ )} ++ {body} +
+ ) +}) +FormMessage.displayName = "FormMessage" + +export { + useFormField, + Form, + FormItem, + FormLabel, + FormControl, + FormDescription, + FormMessage, + FormField, +} diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx new file mode 100644 index 00000000..68551b92 --- /dev/null +++ b/src/components/ui/input.tsx @@ -0,0 +1,22 @@ +import * as React from "react" + +import { cn } from "@/lib/utils" + +const Input = React.forwardRef