This repo contains backend for VideoVerse .
Functionalities Supporeted are :
-
All API calls are authenticated
-
Allows user to upload videos with configurable limits of size and duration
-
Allow trimming a video
-
Allow merging video clips
-
Allow link sharing with time based expiry (customizable)
Tech Stack :
-
Node and express for backend
-
sqlite for database
-
fluent-ffmpeg for video processing
-
jest for unit testing
-
Requirements :
IDE
NODE
NPM
STEP 1 :
- Fork and Clone the repo in your disered location
- open it in the IDE of your choice
- run npm install
- now run node server.js to start server at localhost:3000
STEP 2:
-
Generate a token to be able to use api , it is valid for 200 h (set by default to make it serve like static token , you may change it as per your need)
-
run this to generate token :
curl -X POST http://localhost:3000/auth/login -H "Content-Type: application/json" -d '{"username":"admin", "password":"password"}'
STEP 3:
-
Now for all the api calls add header to them :
Authorization : Your generated token
Upload Video :
Post request at http://localhost:3000/upload
Body : form -data , (key : video , value: select video)
Merge Video :
Post request at http://localhost:3000/merge
Additional Header : Content-Type : application/json
Body : { "videoIds": [1, 2] }
Trim Video :
Post request at http://localhost:3000/trim
Additional Header : Content-Type : application/json
Body :{ "videoId" : 1, "startTime":3, "endTime":10 }
Share Video Link Generation:
Post request at http://localhost:3000/share/generate
Additional Header : Content-Type : application/json
Body :{ "videoId": 1, "expiryHours": 24 }
NOW YOU CAN ACCESS VIDEO BY LINK PROVIDE :
YOU CAN RUN ALL TESTS USING :
npm test






