This project is a comprehensive video streaming platform built with a variety of technologies including React, Vite, Express, Mongoose, JWT for authentication, and MongoDB aggregation pipeline for efficient data processing. It enables users to sign up, log in, upload videos, add comments, create playlists, view history, and like videos.
- User Authentication: JWT-based login and signup functionality.
- Video Upload: Users can upload videos to the platform.
- Comments: Users can add comments to videos.
- Playlists: Users can create playlists and add videos to them.
- History: Users can view their watch history.
- Likes: Users can like videos.
-
Frontend:
- React: JavaScript library for building user interfaces.
- Vite: Fast, opinionated web dev build tool.
- React Router: Declarative routing for React.
- Axios: Promise-based HTTP client.
- JWT Decode: JWT token decoding library.
-
Backend:
- Express: Web application framework for Node.js.
- Mongoose: MongoDB object modeling tool.
- JWT: JSON Web Tokens for user authentication.
- MongoDB Aggregation Pipeline: For efficient data processing.
- Clone the repository:
git clone https://github.com/yourusername/full-stack-video-streaming.git
- Navigate to the project directory:
cd Browse
- Install dependencies for both frontend and backend:
cd client
npm install
cd ../api
npm install
- Set up environment variables:
- Create a
.env
file in theapi
directory. - Define the following variables:
- Create a
MONGODB_URI=mongodb+srv://username:[email protected]
JWT_SECRET=your_jwt_secret_key
PORT=8000
CORS_ORIGIN=http://localhost:5173
ACCESS_TOKEN_SECRET=your_access_token_secret
ACCESS_TOKEN_EXPIRY=1d
REFRESH_TOKEN_SECRET=your_refresh_token_secret
REFRESH_TOKEN_EXPIRY=10d
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
- Create a
.env
file in theclient
directory.- Define the following variables:
BASE_URL=http://localhost:8000/api/v1
-
Start the development servers:
cd client npm run dev cd ../api npm run dev
-
Access the application at
http://localhost:5173
.
Contributions are welcome! Feel free to submit pull requests.