A modern, full-stack video sharing platform built with Next.js 15, featuring user authentication, video uploads, and a beautiful responsive interface. Reel Pro allows users to discover, upload, and share videos in a TikTok-like experience.
- Video Upload & Sharing: Upload videos with custom titles and descriptions
- Video Feed: Browse and watch videos from the community
- User Authentication: Secure login and registration system with Google OAuth
- Responsive Design: Beautiful UI that works on all devices
- Profile Management: Update profile pictures and user information
- NextAuth.js Integration: Secure authentication with JWT tokens
- Google OAuth: One-click sign-in with Google accounts
- Password Hashing: Bcrypt encryption for user passwords
- Protected Routes: Secure access to user-specific features
- Session Management: Persistent user sessions with automatic redirects
- Modern UI/UX: Clean, intuitive interface with Tailwind CSS
- Loading States: Smooth loading animations and progress indicators
- Form Validation: Real-time validation with helpful error messages
- Responsive Layout: Optimized for desktop, tablet, and mobile
- Drag & Drop Upload: Easy file upload with progress tracking
- ImageKit Integration: Cloud video and image storage with CDN
- MongoDB Database: Scalable data storage with Mongoose ODM
- TypeScript: Full type safety throughout the application
- API Routes: RESTful API endpoints for data management
- Middleware Protection: Route-based authentication with Next.js middleware
Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS, DaisyUI, Lucide React, React Hook Form
Backend: Next.js API Routes, MongoDB, Mongoose, NextAuth.js, Bcryptjs
External Services: ImageKit (video/image storage), Google OAuth, Vercel (deployment)
- Node.js (v18 or higher)
- npm or yarn
- MongoDB database (local or cloud)
- ImageKit account
- Google Cloud Console project (for OAuth)
-
Clone the Repository
git clone https://github.com/yourusername/reel-pro.git cd reel-pro -
Install Dependencies
npm install # or yarn install -
Environment Variables
Create a
.env.localfile in the root directory:# Database MONGODB_URI=your_mongodb_connection_string # NextAuth NEXTAUTH_SECRET=your_nextauth_secret_key NEXTAUTH_URL=http://localhost:3000 # Google OAuth GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret # ImageKit (for uploads) NEXT_PUBLIC_PUBLIC_KEY=your_imagekit_public_key IMAGEKIT_PRIVATE_KEY=your_imagekit_private_key NEXT_PUBLIC_URL_ENDPOINT=your_imagekit_url_endpoint
-
Google OAuth Setup
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add
http://localhost:3000/api/auth/callback/googleto authorized redirect URIs
-
Run the Development Server
npm run dev # or yarn devOpen http://localhost:3000 in your browser.
reel-pro/
├── src/
│ ├── middleware.ts # Next.js middleware for route protection
│ ├── app/ # Next.js App Router
│ │ ├── api/ # API routes
│ │ │ ├── auth/ # Authentication endpoints
│ │ │ │ ├── [...nextauth]/ # NextAuth.js configuration
│ │ │ │ ├── imagekit-auth/ # ImageKit authentication
│ │ │ │ ├── profile-picture/ # Profile picture updates
│ │ │ │ └── register/ # User registration
│ │ │ └── videos/ # Video management endpoints
│ │ ├── components/ # Reusable React components
│ │ │ ├── file-upload.tsx # File upload component
│ │ │ ├── header.tsx # Navigation header
│ │ │ ├── notification.tsx # Toast notifications
│ │ │ ├── profile-picture-upload.tsx # Profile picture upload
│ │ │ ├── providers.tsx # Context providers
│ │ │ ├── video-component.tsx # Video player component
│ │ │ ├── video-feed.tsx # Video feed display
│ │ │ └── video-upload-form.tsx # Video upload form
│ │ ├── login/ # Login page
│ │ ├── register/ # Registration page
│ │ ├── upload/ # Video upload page
│ │ ├── profile/ # User profile page
│ │ └── page.tsx # Home page
│ ├── lib/ # Utility libraries
│ │ ├── api-client.ts # API client functions
│ │ ├── authOptions.ts # NextAuth configuration
│ │ └── db.ts # Database connection
│ └── models/ # MongoDB models
│ ├── User.ts # User model
│ └── Video.ts # Video model
├── public/ # Static assets
└── package.json # Dependencies and scripts
- Google OAuth: One-click sign-in with Google accounts
- Email/Password: Traditional registration and login
- Session Management: Automatic session persistence and route protection
- Profile Updates: Update profile pictures and user information
- Drag & Drop: Intuitive file upload interface
- Progress Tracking: Real-time upload progress indicators
- File Validation: Type and size validation for videos and images
- Cloud Storage: Secure storage with ImageKit CDN
- Middleware: Next.js middleware protects routes based on authentication
- Public Routes: Home page, login, and register accessible to everyone
- Protected Routes: Profile and upload pages require authentication
- Automatic Redirects: Seamless navigation based on auth status
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push
Make sure to update your environment variables for production:
NEXTAUTH_URLshould be your production domainGOOGLE_CLIENT_SECRETshould not have trailing characters- Add production redirect URIs in Google Cloud Console
- ✅ Fixed Google OAuth: Resolved duplicate username issues
- ✅ Improved Middleware: Better route protection and redirect logic
- ✅ TypeScript Fixes: Resolved type compatibility issues
- ✅ Production Ready: Cleaned up debug code and error handling
- ✅ Profile Picture Upload: Fixed type compatibility with ImageKit