Skip to content

christopher-tanaka-code/video-platform

Repository files navigation

EduPlatform

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.

Tech Stack

  • 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

Features

For Students

  • Browse and search courses
  • Enroll in courses (free/paid)
  • Watch video lessons
  • Track progress
  • Personal dashboard

For Instructors

  • Create courses
  • Organize lessons into sections
  • Upload videos
  • Track enrollments
  • Manage course visibility

Quick Start

Prerequisites

  • Node.js 18+
  • MongoDB (local or Atlas)
  • Python 3.8+ (optional, for video service)

Installation

# Install dependencies
npm install

# Set up environment
cp .env.example .env.local
# Edit .env.local with your MongoDB URI

# Run development server
npm run dev

Open http://localhost:3000

Environment Variables

MONGODB_URI=mongodb://localhost:27017/video-platform
NEXTAUTH_SECRET=your-secret-here
NEXTAUTH_URL=http://localhost:3000

Generate secret:

openssl rand -base64 32

Project Structure

├── 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

Database Models

  • User: name, email, password, role (student/instructor)
  • Course: title, description, instructor, sections, pricing
  • Lesson: title, videoUrl, duration, order
  • Progress: completed lessons, percentage, last accessed

API Routes

Auth

  • POST /api/auth/register - Sign up
  • POST /api/auth/[...nextauth] - Sign in

Courses

  • GET /api/courses - List all published courses
  • POST /api/courses - Create course (instructor)
  • GET /api/courses/[id] - Get course
  • PUT /api/courses/[id] - Update course
  • DELETE /api/courses/[id] - Delete course
  • POST /api/courses/[id]/enroll - Enroll in course

Lessons

  • POST /api/lessons - Create lesson
  • GET /api/lessons/[id] - Get lesson
  • PUT /api/lessons/[id] - Update lesson
  • DELETE /api/lessons/[id] - Delete lesson

Progress

  • GET /api/progress - Get user progress
  • POST /api/progress - Update progress

Video Service (Optional)

Process videos with Python:

cd video-service
pip install -r requirements.txt
python main.py

Requires FFmpeg for video processing.

Development

# Run dev server
npm run dev

# Build for production
npm run build

# Start production server
npm start

# Lint code
npm run lint

Deployment

Vercel (Recommended)

  1. Push to GitHub
  2. Import project in Vercel
  3. Add environment variables
  4. Deploy

MongoDB Atlas

  1. Create cluster at mongodb.com
  2. Get connection string
  3. Update MONGODB_URI in Vercel

Features to Add

  • Payment integration (Stripe)
  • Course reviews/ratings
  • Discussion forums
  • Quizzes and assignments
  • Certificates PDF
  • Email notifications
  • Mobile app

Contributing

Pull requests welcome. For major changes, open an issue first.

License

MIT


Built with Next.js and MongoDB

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published