The Video Streaming App is a web application designed to provide users with a platform for watching and sharing videos, similar to popular platforms like YouTube. In addition to video streaming functionality, the app also features a small tweet option, allowing users to post short updates and engage with the community through brief messages.
- Video Streaming: Users can browse, search, and watch a wide variety of videos uploaded by other users or content creators.
- Upload Videos: Content creators can upload their videos to share with the community.
- Community Interaction: Users can engage with the community by posting short tweets, commenting on videos, and liking or sharing content.
- User Authentication: Secure user authentication and authorization mechanisms ensure that only authorized users can upload videos or post tweets.
- Responsive Design: The app is designed to be responsive, providing a seamless viewing experience across different devices and screen sizes.
- Frontend: HTML, CSS, JavaScript (with React.js for dynamic UI)
- Backend: Node.js, Express.js
- Database: MongoDB (with Mongoose for object modeling)
- Authentication: JSON Web Tokens (JWT) for user authentication
- Cloud Storage: Cloudinary for storing and serving video files
- Other Dependencies: dotenv for environment configuration, Prettier for code formatting
- Clone the repository:
git clone <repository-url>
- Navigate to the project directory:
cd backendproject
- Install dependencies:
npm install
- Configure environment variables: Create a
.env
file in the root directory and add necessary environment variables (e.g., PORT, MONGODB_URI, JWT_SECRET, CLOUDINARY_API_KEY) - Start the development server:
npm run dev
POST /api/auth/register
Registers a new user with the system.
Request Body
username
(string, required): The username of the user.email
(string, required): The email address of the user.password
(string, required): The password of the user.
Response
- 201 Created: User registration successful.
- 400 Bad Request: Invalid request body.
POST /api/auth/login
Logs in an existing user.
Request Body
email
(string, required): The email address of the user.password
(string, required): The password of the user.
Response
- 200 OK: Login successful. Returns a JWT token.
- 401 Unauthorized: Invalid credentials.
GET /api/videos
Retrieves a list of all videos available in the system.
Response
- 200 OK: Returns an array of video objects.
POST /api/videos
Uploads a new video to the system.
Request Body
title
(string, required): The title of the video.description
(string): The description of the video.url
(string, required): The URL of the video file.
Response
- 201 Created: Video upload successful.
- 400 Bad Request: Invalid request body.
Contributions are welcome! If you'd like to contribute to the project, please follow these steps:
- Fork the repository
- Create a new branch:
git checkout -b feature-branch
- Make your changes and commit them:
git commit -am 'Add new feature'
- Push to the branch:
git push origin feature-branch
- Submit a pull request
This project is licensed under the MIT License.