Welcome to the backend code repository for a YouTube-like platform built with Node.js and Express.js. This application utilizes MongoDB for data storage and Cloudinary for image uploading. It offers various functionalities such as user authentication, video uploading, liking, subscribing, commenting, and more.
- User Authentication: Secure user authentication system using JWT tokens.
- Video Uploads: Ability for users to upload videos to the platform.
- Like and Subscribe: Users can like and subscribe to channels.
- Commenting System: Enable users to comment on videos.
- Cloudinary Integration: Seamless integration with Cloudinary for efficient image uploading and management.
- RESTful API: Well-structured RESTful endpoints for smooth communication with the frontend.
- Node.js: Server-side JavaScript runtime environment.
- Express.js: Minimal and flexible Node.js web application framework.
- MongoDB: Scalable NoSQL database for storing application data.
- Cloudinary: Cloud-based image and video management solution.
-
Clone the Repository:
git clone https://github.com/your_username/your_repository.git
-
Install Dependencies:
npm install
-
MongoDB Setup:
- Sign up for an account at MongoDB Atlas.
- Create a new cluster and follow the instructions to set up a new database.
- Obtain your MongoDB connection string and add it to the
MONGO_URL
variable in your.env
file.
-
Cloudinary Setup:
- Sign up for Cloudinary: Register at Cloudinary.
- Retrieve Credentials: Get your Cloud Name, API Key, and API Secret from your Cloudinary dashboard.
- Install Cloudinary SDK:
npm install cloudinary
- Set Environment Variables:
CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret
-
JWT Configuration:
- Generate secure JWT secret keys and expiry times for access and refresh tokens.
ACCESS_TOKEN_SECRET=your_access_token_secret ACCESS_TOKEN_EXPIRY=your_access_token_expiry REFRESH_TOKEN_SECRET=your_refresh_token_secret REFRESH_TOKEN_EXPIRY=your_refresh_token_expiry
- Generate secure JWT secret keys and expiry times for access and refresh tokens.
-
Configure Environment Variables.
-
Run the Server:
npm run dev