Welcome to the YouTube Backend Clone project! This project replicates the core functionality of YouTube's backend, offering features for uploading and watching videos, tweeting on various topics, and more. It's built using Node.js, Express.js, MongoDB, and other tools to provide a robust backend infrastructure.
- Video Management: Upload and watch videos, categorize them, and interact with video content.
- Tweeting Platform: Post tweets on different topics, engage with other users' tweets, and build a social network.
- Scalable Architecture: Built with scalability in mind to handle a large number of users and videos efficiently.
- Node.js: JavaScript runtime for building server-side applications.
- Express.js: Fast, minimalist web framework for Node.js.
- MongoDB: Scalable NoSQL database for storing application data.
- Multer: Middleware for handling file uploads, used for video uploads.
- JWT (JSON Web Tokens): Secure authentication mechanism for API endpoints.
- CORS (Cross-Origin Resource Sharing): Middleware for enabling cross-origin requests.
- Mongoose: Elegant MongoDB object modeling for Node.js applications.
To run the project locally, follow these steps:
- Clone the repository:
https://github.com/rohitcodism/YT-Backend.git
- Navigate to the project directory:
cd YT-Backend
- Install dependencies:
npm install
- Set up environment variables:
cp .env.example .env
Update the .env
file with your MongoDB connection string and any other necessary configurations.
- Start the server:
npm run dev
- Access the application:
Open http://localhost:8000
in your web browser to access the application.
- Uploading Videos: Use the video upload feature to share your content with the world.
- Watching Videos: Browse and watch videos uploaded by other users, search for specific content, and interact with videos through likes and comments.
- Tweeting: Share your thoughts, ideas, and updates by posting tweets on various topics. Engage with other users' tweets through likes, comments, and retweets.
The project provides a comprehensive set of API endpoints for various functionalities:
/api/v1/users
: User management endpoints for registration, authentication, and profile management./api/v1/videos
: Video-related endpoints for uploading, viewing, and interacting with videos./api/v1/tweets
: Tweet-related endpoints for posting tweets, viewing tweets, and engaging with tweets./api/v1/likes
: Endpoints for liking videos, tweets, and other content./api/v1/comments
: Endpoints for commenting on videos, tweets, and discussions./api/v1/subscriptions
: Endpoints for subscribing to channels and managing subscriptions./api/v1/dashboard
: Endpoints for fetching dashboard data, including channel videos and subscriber counts.
For detailed documentation on each endpoint and its usage, please refer to the API documentation or the codebase.
Contributions to the project are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature-name
. - Implement your changes and commit them:
git commit -am 'Add new feature'
. - Push to the branch:
git push origin feature-name
. - Submit a pull request detailing your changes.
This project is licensed under the MIT License.