This project is a backend service for a video-sharing platform built with Node.js, Express, and MongoDB.
It follows standard backend practices with secure authentication and efficient media handling.
- User authentication with JWT (JSON Web Tokens)
- Password hashing and security using bcrypt
- Access tokens & Refresh tokens for session management
- Cloudinary integration for file upload & deletion
- Video management (upload, update, publish/unpublish, delete)
- Comment system with likes
- Playlists and video organization
- Channel stats, subscriptions, and profiles
- Tweet-like micro-posts with likes
- Watch history and liked videos
- Standard backend structure with controllers & routes
- getAllVideos, getVideoById, publishAVideo, updateVideo, deleteVideo, togglePublishStatus
- addComments, deleteComment, getVideoComments, updateComment, toggleCommentLike
- toggleVideoLike, toggleTweetLike, toggleCommentLike, getLikedVideos
- createPlaylist, getPlaylistById, getUserPlaylists, addVideoToPlaylist, removeVideoFromPlaylist, updatePlaylist, deletePlaylist
- getChannelStats, getChannelVideos, getSubscribedChannels, getUserChannelSubscribers, toggleSubscription, getUserChannelProfile
- createTweet, deleteTweet, getUserTweet, updateTweet
- registerUser, loginUser, logoutUser, getCurrentUserDetails, updateAccountDetails, updateUserAvatar, updateUserCoverImage, changeUserPassword
- getWatchHistory
- accessRefreshToken
- uploadFromCloudinary, deleteFromCloudinary
- healthCheck
GET /→ getAllVideosPOST /publishVideo→ publishAVideoGET /:videoId→ getVideoByIdPATCH /:videoId→ updateVideoDELETE /:videoId→ deleteVideoPATCH /toggle/publish/:videoId→ togglePublishStatus
GET /:videoId→ getVideoCommentsPOST /add/:videoId→ addCommentsPATCH /update/:commentId→ updateCommentDELETE /delete/:commentId→ deleteCommentPOST /comment/:commentId→ toggleCommentLike
GET /liked-videos→ getLikedVideosPOST /video/:videoId→ toggleVideoLikePOST /c/:tweetId→ toggleTweetLike
POST /create-playlist→ createPlaylistGET /user/:userId→ getUserPlaylistsGET /c/:playlistId→ getPlaylistByIdPATCH /add/:playlistId/:videoId→ addVideoToPlaylistPATCH /remove/:playlistId/:videoId→ removeVideoFromPlaylistDELETE /delete/:playlistId→ deletePlaylistPATCH /update/:playlistId→ updatePlaylist
GET /stats→ getChannelStatsGET /videos→ getChannelVideosPOST /c/:channelId→ toggleSubscriptionGET /userChannelSubscribers/:channelId→ getUserChannelSubscribersGET /subscribedChannels/:subscriberId→ getSubscribedChannelsGET /c/:username→ getUserChannelProfile
POST /create-tweet→ createTweetGET /user-tweet→ getUserTweetPATCH /:tweetId→ updateTweetDELETE /:tweetId→ deleteTweet
POST /register→ registerUserPOST /login→ loginUserPOST /logout→ logoutUserPOST /refresh-token→ accessRefreshTokenPOST /change-password→ changeUserPasswordGET /current-user→ getCurrentUserDetailsPATCH /update-account-details→ updateAccountDetailsPATCH /avatar→ updateUserAvatarPATCH /cover-image→ updateUserCoverImage
GET /watch-history→ getWatchHistory
GET /health-check→ healthCheck
- Node.js & Express.js – backend framework
- MongoDB (Mongoose) – database
- JWT – secure authentication
- bcrypt – password hashing & encryption
- Cloudinary – media upload & storage
- Access/Refresh Tokens – token-based session handling
- Passwords stored using bcrypt hashing
- Authentication with JWT access & refresh tokens
- Secure media handling via Cloudinary
- Middleware-protected routes for authentication and authorization