This is the backend for a subscription-based video streaming platform. It includes features for user authentication, video streaming, commenting on videos, and integrating tweets.
- User Authentication: Sign up, log in, and manage user sessions.
- Subscription Management: Handle user subscriptions and payment processing.
- Video Streaming: Upload, store, and stream videos to subscribers.
- Comments: Allow users to comment on videos and manage their comments.
- Twitter Integration: Display relevant tweets and allow users to tweet from the platform.
- Node.js: JavaScript runtime environment
- Express.js: Web framework for Node.js
- MongoDB: NoSQL database for storing user data, subscriptions, videos, and comments
- JWT: JSON Web Tokens for secure user authentication
- Axios: For making HTTP requests, including to the Twitter API
- Node.js and npm installed
- MongoDB instance running
- Twitter Developer Account for API access
-
Clone the repository:
git clone https://github.com/your-username/your-repo.git cd your-repo
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add the following environment variables:PORT=4000 MONGO_URI=your-mongodb-uri JWT_SECRET=your-jwt-secret TWITTER_API_KEY=your-twitter-api-key TWITTER_API_SECRET=your-twitter-api-secret
-
Start the server:
npm start
-
The server will run on
http://localhost:4000
.
POST /api/signup
: Sign up a new userPOST /api/login
: Log in an existing userPOST /api/logout
: Log out the current user
GET /api/subscription
: Get user subscription detailsPOST /api/subscription
: Create or update a subscription
GET /api/videos
: Get a list of all videosPOST /api/videos
: Upload a new videoGET /api/videos/:id
: Stream a specific video
GET /api/videos/:id/comments
: Get comments for a specific videoPOST /api/videos/:id/comments
: Add a new comment to a video
GET /api/tweets
: Get relevant tweetsPOST /api/tweets
: Post a new tweet
- Fork the repository
- Create a new branch (
git checkout -b feature-branch
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature-branch
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Author: Priyansh
- Email: [email protected]
- GitHub: https://github.com/priyansh87