This is a complex project that implements the backend of a complete video hosting website like youtube with all the features like login, signup, upload video, like, dislike, comment, reply, subscribe, unsubscribe, and many more. It is built using TypeScript, Express, mongodb, mongoose, jwt, multer, cloudinary, and more. This project uses all the standard practices like token based authentication, middleware, error handling, and more.
-
Clone the repository:
git clone https://github.com/ankkitsharma/uTube-backend.git cd uTube-backend
-
Install dependencies:
npm install
-
Set up environment variables:
- Create a
.env
file in the root directory. - Use the env.example file to set up the environment variables.
- Create a
-
Run the development server:
npm start
GET /
- HealthcheckGET /:videoId
- Get video commentsPOST /:videoId
- Add a commentDELETE /c/:commentId
- Delete a commentPATCH /c/:commentId
- Update a commentPOST /register
- Register a userPOST /login
- Login a userPOST /refresh-token
- Refresh access tokenPOST /logout
- Logout a userPOST /change-password
- Change passwordGET /current-user
- Get current userPATCH /update-account
- Update account detailsPATCH /avatar
- Update user avatarPATCH /cover-image
- Update user cover imageGET /c/:username
- Get user channel profileGET /history
- Get watch historyGET /
- Get all videosPOST /
- Publish a videoGET /:videoId
- Get a videoPATCH /:videoId
- Update a videoDELETE /:videoId
- Delete a videoPATCH /toggle/publish/:videoId
- Toggle publish status