A robust backend system for a video sharing platform, built with Node.js and Express.js.
-
User Management
- User registration and authentication
- User profile management
- Dashboard functionality
-
Video Management
- Video upload and streaming
- Video metadata management
- Cloudinary integration for media storage
-
Social Features
- Comments system
- Like/Unlike functionality
- Playlist creation and management
- User subscriptions
- Tweet functionality
-
Additional Features
- Health check endpoints
- About section
- Middleware for request handling and authentication
- File upload using Multer
src/
├── controllers/ # Business logic for all routes
├── db/ # Database configuration
├── middlewares/ # Custom middleware functions
├── models/ # Database models
├── routes/ # API route definitions
└── utils/ # Utility functions and helpers
- Node.js
- MongoDB
- Cloudinary account for media storage
- Clone the repository:
git clone https://github.com/vikasyadav01234/VIDTUBE.git- Install dependencies:
npm install- Set up environment variables:
Create a
.envfile in the root directory and add the following variables:
PORT=8000
MONGODB_URI=your_mongodb_connection_string
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
JWT_SECRET=your_jwt_secret- Start the server:
npm startPOST /api/users/register- Register a new userPOST /api/users/login- User loginGET /api/users/profile- Get user profilePATCH /api/users/update- Update user profile
POST /api/videos/upload- Upload a new videoGET /api/videos- Get all videosGET /api/videos/:videoId- Get video detailsPATCH /api/videos/:videoId- Update video detailsDELETE /api/videos/:videoId- Delete a video
- Comments, Likes, Playlists, Subscriptions, and Tweets endpoints available
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT for authentication
- Multer for file uploads
- Cloudinary for media storage
The application uses a custom error handling middleware with standardized API responses.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details