Skip to content

Uv0503/VideoTube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

VideoTube

A full-stack video sharing platform built with React, Node.js, Express, MongoDB, JWT authentication, Cloudinary uploads, likes, comments, playlists, subscriptions, and a modern responsive UI.

Local setup

Backend

cd Backend
npm install
copy .env.example .env
npm run dev

Set the MongoDB, JWT, Cloudinary, and CORS values in Backend/.env. The API defaults to http://localhost:8000.

Frontend

cd Frontend
npm install
copy .env.example .env
npm run dev

The Vite app defaults to http://localhost:5173. Set VITE_API_BASE_URL to the complete API prefix, normally http://localhost:8000/api/v1. The included Vite proxy also supports /api/v1 during local development.

Commands

Backend:

  • npm run dev: start with nodemon
  • npm start: start with Node
  • npm test: run the backend syntax check

Frontend:

  • npm run dev: start Vite
  • npm run build: create a production build
  • npm run preview: preview the build

API summary

  • Users: /api/v1/users/register, /login, /logout, /refresh-token, /current-user, /c/:username
  • Videos: GET /api/v1/videos, GET /videos/:videoId, GET /videos/channel/:username, POST /videos/publish-video
  • Video ownership: PATCH/DELETE /api/v1/videos/:videoId, PATCH /videos/:videoId/publish
  • Comments: GET/POST /api/v1/comments/:videoId, PATCH/DELETE /comments/:commentId
  • Likes: POST /api/v1/likes/videos/:videoId, GET /likes/videos
  • Subscriptions: POST /api/v1/subscriptions/:channelId
  • Playlists: /api/v1/playlists
  • Tweets: /api/v1/tweets

Successful responses use { success, statusCode, data, message }. Errors use { success: false, message, errors }.

Assumptions

  • Public users can browse published videos, channels, and comments.
  • Authentication supports both HTTP-only cookies and Authorization: Bearer <accessToken>.
  • Local cookies are non-secure with SameSite=Lax; production cookies are secure.
  • Video uploads accept MP4, WebM, or MOV and are limited to 100 MB by the current Multer configuration.
  • Existing databases created with the old Like schema may require the old indexes to be dropped before Mongoose creates the new partial unique indexes.

About

A full-stack video sharing platform built with React, Node.js, Express, MongoDB, JWT authentication, Cloudinary uploads, likes, comments, playlists, subscriptions, and a modern responsive UI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages