Default Homepage | Search |
---|---|
I created this webapp as a way to learn the MERN stack. The app uses YT-DLP to download and serve MP4 (currently) files to users. The website that are supported by are the same as YT-DLP.
App folder
contains the frontend and the backend is inside backend folder
. The old folder has the frontend written in Bootstrap with spaghetti code NOT TO BE USED.
Used React framework with tailwindcss to create responsive single page app that leverges backend API to serve video downloads. The components are atomic and seperate in the components directory.
router.route("/addDownload/").post; // POST url:url format:format img:img RES save to DB
router.route("/wipeDownload/").get; // GET RES Delete all history from DB
router.route("/getDownload/").get; // GET RES All downloads history in JSON
router.route("/getinfo/").post; // POST URL:https://xxxx.com/xxxx RES Json INFO
router.route("/download/").post; // POST url:https://xxxx.com/xxxx fromat:format RES Downloads the file
router.route("/downloadfile/").post; // POST URL:https://xxxx.com/xxxx RES blob of the file
Uses mongodb to store info related to downloads and use YT-DLP to download files and serve them.
- Clone the repo.
- Install required packages using
npm install
- Go to
src/components/Search.JS
and change the APILINE 11
to the one you deploy in the backend. - Now create a minified optimized version of the app using
npm run build
- The build folder now has the app ready for deployment.
- Create a .env file in the root directory of your backend folder.
ATLAS_URI=mongodb+srv://USER:[email protected]/?retryWrites=true&w=majority
port = 5000
the ATLAS_URI contains your mongodb connection string. The app will run on the port number you define on your .env file.
- Now your backend server is ready for hosting.
- The file for saving is the last 11 characters of the url provided. This can be same for many files, If used a generic share link to download file. Hence duplicate downloads.
- More formats.
- Better serving of files.
- Add a view for the history on the frontpage.
- Schedule deletion of downloads based on user preference.