A full-stack educational video platform built with Next.js, MongoDB, and TypeScript. Students can browse courses and track progress. Instructors can create and manage courses.
- Frontend: Next.js 14, React, TypeScript, Tailwind CSS
- Backend: Next.js API Routes
- Database: MongoDB + Mongoose
- Auth: NextAuth.js
- Video: React Player (supports YouTube, Vimeo, direct links)
- Processing: Python FastAPI service
- Browse and search courses
- Enroll in courses (free/paid)
- Watch video lessons
- Track progress
- Personal dashboard
- Create courses
- Organize lessons into sections
- Upload videos
- Track enrollments
- Manage course visibility
- Node.js 18+
- MongoDB (local or Atlas)
- Python 3.8+ (optional, for video service)
# Install dependencies
npm install
# Set up environment
cp .env.example .env.local
# Edit .env.local with your MongoDB URI
# Run development server
npm run devMONGODB_URI=mongodb://localhost:27017/video-platform
NEXTAUTH_SECRET=your-secret-here
NEXTAUTH_URL=http://localhost:3000Generate secret:
openssl rand -base64 32├── app/
│ ├── api/ # API routes
│ ├── auth/ # Auth pages
│ ├── courses/ # Course pages
│ ├── instructor/ # Instructor dashboard
│ └── student/ # Student dashboard
├── components/ # React components
├── lib/ # Utilities
├── models/ # MongoDB models
├── types/ # TypeScript types
└── video-service/ # Python video processor
- User: name, email, password, role (student/instructor)
- Course: title, description, instructor, sections, pricing
- Lesson: title, videoUrl, duration, order
- Progress: completed lessons, percentage, last accessed
POST /api/auth/register- Sign upPOST /api/auth/[...nextauth]- Sign in
GET /api/courses- List all published coursesPOST /api/courses- Create course (instructor)GET /api/courses/[id]- Get coursePUT /api/courses/[id]- Update courseDELETE /api/courses/[id]- Delete coursePOST /api/courses/[id]/enroll- Enroll in course
POST /api/lessons- Create lessonGET /api/lessons/[id]- Get lessonPUT /api/lessons/[id]- Update lessonDELETE /api/lessons/[id]- Delete lesson
GET /api/progress- Get user progressPOST /api/progress- Update progress
Process videos with Python:
cd video-service
pip install -r requirements.txt
python main.pyRequires FFmpeg for video processing.
# Run dev server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Lint code
npm run lint- Push to GitHub
- Import project in Vercel
- Add environment variables
- Deploy
- Create cluster at mongodb.com
- Get connection string
- Update
MONGODB_URIin Vercel
- Payment integration (Stripe)
- Course reviews/ratings
- Discussion forums
- Quizzes and assignments
- Certificates PDF
- Email notifications
- Mobile app
Pull requests welcome. For major changes, open an issue first.
MIT
Built with Next.js and MongoDB