I'm playing around making a video platform (for fun), I currently have 3 big pieces: a front end written in ReactJS, a backend written in NodeJS and a filesystem to store user media in digital ocean spaces (s3 bucket). I want to keep this project lightweight and as it is practice for me I don't want to use a library that does everything for me. It's just an architecture question.
I already implemented a way for a user to upload an image on the backend (it uploads binaries from FE to the BE and in there it checks that everything is ok and then uploads to the filesystem). I also have an endpoint to stream the video from the filesystem, which works fine.
Now I am trying to do it for videos, but I have a dilemma, if I do the same as I do for images I will have to upload it first to the BE and then to the filesystem and AFAIK that's really inefficient.
Would it be a better idea to put the video upload directly on the Front end and then store the uploaded URL of the video into the DB? And if that is the case how can I make the S3 connection secure? Not exposing S3 bucket information.