A modern MERN stack video platform featuring real-time video uploads, streaming, user interactions, and scalable state management with Redux. Built to showcase full-stack skills and best practices.
- π User Registration with channel creation (username, email, password, channel name, logo, banner)
- π Secure Login/Logout using JWT tokens
- πΌοΈ Profile Management with custom logos & banners
- π¨ Channel Customization with unique branding
- π€ Video Upload with live progress tracking via Socket.io
- βοΈ Cloud Storage via Cloudinary CDN
- π±οΈ Drag & Drop Upload Interface
- β€οΈ Like/Dislike system with user tracking
- π¬ Comments with real-time updates
- π§βπ€βπ§ Subscribe/Unsubscribe with live subscriber counts
- π View Counting (30-second rule for authentic views)
- π Full-text Search on video titles and descriptions
- π‘ Search Suggestions on enter
- β‘ Instant Results with relevance scoring
- π View Analytics with unique viewer tracking
- π Engagement Metrics: likes, dislikes, comments count
- π§βπΌ Subscriber Analytics with real-time updates
- π Channel Performance Tracking
- β±οΈ Live Upload Progress via Socket.io events
- π¬ Instant Comment Updates
- π§βπ€βπ§ Live Subscriber Counts
- π± Mobile-First Approach using Tailwind CSS
- ποΈ Touch-Friendly Interface
- π₯οΈ Optimized for All Screen Sizes
βββ Frontend/
β βββ src/
β β βββ Components/
β β β βββ ChannelHome.jsx # Channel homepage
β β β βββ ChannelInfo.jsx # Channel information
β β β βββ ChannelVideos.jsx # Channel videos list
β β β βββ Comments.jsx # Video comments
β β β βββ CommentsSection.jsx # Comments container
β β β βββ Controls.jsx # Video controls
β β β βββ InteractionBar.jsx # Like/dislike/subscribe
β β β βββ Loader.jsx # Loading states
β β β βββ MainVideos.jsx # Homepage videos
β β β βββ SearchBar.jsx # Search functionality
β β β βββ SearchResults.jsx # Search results display
β β β βββ SideBar.jsx # Navigation sidebar
β β β βββ SideVideos.jsx # Related videos
β β β βββ Socket.jsx # Socket.io connection
β β β βββ VideoDescription.jsx # Video details
β β β βββ VideoInfo.jsx # Video metadata
β β β βββ Videoplay.jsx # Video player
β β β βββ VideoPlayerElement.jsx # Enhanced player
β β β βββ VideoWrapper.jsx # Video container
β β βββ Pages/
β β β βββ ChannelProfile.jsx # Channel page
β β β βββ Home.jsx # Homepage
β β β βββ IsLoggedIn.jsx # Auth wrapper
β β β βββ Login.jsx # Login page
β β β βββ Signup.jsx # Registration page
β β β βββ UploadVideo.jsx # Video upload page
β β β βββ VideoPlayer.jsx # Video watch page
β β βββ Context/
β β β βββ VideosContext.jsx # Video state management
β β βββ Redux/
β β β βββ store.js # Redux store
β β β βββ features/
β β β βββ commentSlice.js # Comments state
β β β βββ videoSlice.js # Videos state
β β βββ utils/
β β βββ Ago.js # Time formatting
β βββ public/
β βββ assets/ # Static assets
β
βββ Backend/
β βββ Controllers/
β β βββ user.controller.js # User management
β β βββ video.controller.js # Video operations
β β βββ comment.controller.js # Comments
β β βββ search.controller.js # Search functionality
β β βββ initSocket.controller.js # Socket.io setup
β βββ Models/
β β βββ user.model.js # User schema
β β βββ video.model.js # Video schema
β β βββ comment.model.js # Comment schema
β β βββ videoView.js # View tracking
β βββ Routes/
β β βββ user.routes.js # User endpoints
β β βββ video.routes.js # Video endpoints
β β βββ comment.routes.js # Comment endpoints
β β βββ search.routes.js # Search endpoints
β βββ Services/
β β βββ user.service.js # User business logic
β β βββ video.service.js # Video operations
β β βββ comment.service.js # Comment operations
β β βββ search.service.js # Search algorithms
β β βββ videoUpload.service.js # Upload handling
β βββ Middlewares/
β β βββ auth.middleware.js # Authentication
β βββ Config/
β β βββ cloudinary.config.js # Cloudinary setup
β β βββ multer.config.js # File upload config
- Node.js v16+
- MongoDB Atlas account
- Cloudinary account
- Git
- Clone Repo
git clone https://github.com/HASHERprogrammer/yt.git
cd yt
2. **Backend Setup**
cd Backend
npm install
cp .env.example .env
3. **Environment Variables**
Create a `.env` file in the Backend directory:
```env
PORT=5000
MONGODB_URI=your_mongodb_atlas_connection_string
JWT_SECRET=your_jwt_secret_key
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
FRONTEND_URL=http://localhost:5173- Start Backend Server
npm start
# or for development
npm run dev- Frontend Setup
cd ../Frontend
npm install- Frontend Environment Variables
Create a
.envfile in the Frontend directory:
VITE_BACKEND_URI=http://localhost:3000- Start Frontend Development Server
npm run dev- Access the Application
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
POST /user/signup- User registrationPOST /user/login- User loginPOST /user/logout- User logoutGET /user/getuser- Get current userGET /user/validate-token- Validate JWT token
POST /video/upload- Upload new videoGET /video/getvideos- Get all videos (pagination)GET /video/getvideo?v=videoId- Get specific videoPOST /video/increase-view/:videoId- Increment view countPOST /video/like/:videoId- Like/unlike videoPOST /video/dislike/:videoId- Dislike/undislike video
POST /comment/:videoId- Add commentGET /comment/getcomments- Get all comments
GET /search?q=query- Search videosGET /search/suggestions?q=query- Get search suggestions
GET /user/getUserVideos/:userId- Get user's videosPOST /user/subscription/:channelId- Subscribe/unsubscribeGET /user/isSubscribed/:channel- Check subscription status
- Update all URLs to production domains
- Set secure cookie flags
- Configure CORS for production frontend
- Set up SSL certificates
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- HASHERprogrammer - Initial work - HASHERprogrammer
- βοΈ React community
- π MongoDB team
- βοΈ Cloudinary
- π Socket.io team
For support, email hasher423@gmail.com
Built with β€οΈ by HASHERprogrammer