WeTube is a robust backend server for video and post sharing. It utilizes MongoDB for data management, Cloudinary for media management, and Express.js for handling HTTP requests. It offers a wide range of features including authentication, video uploading, tweeting, likes, comments, playlists, subscriptions, and more.
The server is currently running at http://wetube.ap-south-1.elasticbeanstalk.com/api/v1
The base URL for all requests is http://wetube.ap-south-1.elasticbeanstalk.com/api/v1
For example, if you want to get a list of all videos, you might send a GET request to http://wetube.ap-south-1.elasticbeanstalk.com/api/v1/videos
Please refer to the API documentation for more details on the available endpoints and how to use them.
We have a Postman collection that you can use to explore the API. Follow these steps to import it into Postman:
- Download the
WeTube.postman_collection.json
file from the repository. - Open Postman.
- Click on the "Import" button.
- Select the
WeTube.postman_collection.json
file. - After importing, you will see a "WeTube" collection in your Postman sidebar. Click on it to see the available requests.
Note:
In this document, {{server}}
is used as a placeholder for the server URL.
You should replace it with your actual server URL, which is http://wetube.ap-south-1.elasticbeanstalk.com/api/v1
{{server}}
is defined as a global variable in the collection.
You can also view the API documentation online. Here's the link to the WeTube Postman Documentation
- 🔐 User Authentication
- 📹 Video Uploading
- 🐦 Tweeting
- 👍 Likes and Comments
- 🎵 Playlists
- 📬 Subscriptions
- 📊 Dashboard
- 🏥 Health Check
- MongoDB: A source-available cross-platform document-oriented database program.
- Cloudinary: A cloud-based image and video management service.
- Express.js: A web application framework for Node.js, designed for building web applications and APIs.
- Bcrypt: A library to help you hash passwords.
- Cookie-parser: Parse Cookie header and populate
req.cookies
with an object keyed by the cookie names. - Cors: A node.js package for providing a Connect/Express middleware that can be used to enable CORS with various options.
- Dotenv: A zero-dependency module that loads environment variables from a
.env
file intoprocess.env
- Jsonwebtoken: An implementation of JSON Web Tokens.
- Mongoose: An Object Data Modeling (ODM) library for MongoDB and Node.js.
- Mongoose-aggregate-paginate-v2: A mongoose plugin to paginate aggregation results.
- Multer: A node.js middleware for handling
multipart/form-data
, which is primarily used for uploading files.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Before you begin, ensure you have met the following requirements:
- 🖥️ You have a recent version of Node.js installed. If not, you can download it from here
- 🧰 You have a package manager like npm (comes with Node.js) or yarn installed.
- 🛠️ You have Git installed. If not, you can download it from here
-
🔽 Clone the repository:
git clone https://github.com/AnikAdhikari7/WeTube.git
-
📂 Navigate into the directory:
cd WeTube
-
🌐 Install the dependencies:
npm install
-
🌿 Create a
.env
file and populate it with the necessary API keys and secrets:cp .env.example .env
Open
.env
and replace the placeholders with your actual data. -
🚀 Run the application in development mode:
npm run dev
After installing the dependencies, you can run the application using the following scripts defined in the package.json
file:
- To run the application in development mode, use:
npm run dev
- To start the application normally, use:
npm start
You can also run this application as a Docker container:
-
Pull the Docker image from Docker Hub:
docker pull anikadhikari/wetube:latest
-
Run the Docker container:
docker run --rm -d -p 8080:8080 --env-file ./.env --name <wetube-docker-container> anikadhikari/wetube:latest
Replace
<wetube-docker-container>
with your desired container name.
Replace8080
with your desired port number.
- To to know more about the docker image, visit the Docker Hub
This project is licensed under the MIT License - see the LICENSE.md file for details
-
Thanks to all contributors who have helped with pull requests and issues.
-
Thanks to all the developers who have created the libraries and tools used in this project.
-
Gratitude for the following resources that guided the development process:
- Tutorial by Chai aur Javascript Backend -> GitHub Repo for explaining how to set up a Node.js/Express.js server that too production grade level.
- @hiteshchoudhary for their helpful code snippets and solutions to issues.