Local Cloud is a microservice-based system designed to allow users within the same Local Area Network (LAN) to download videos via shared URLs and watch them through a locally hosted web application.
The system efficiently handles video downloads, stores the data, and renders them on a user-friendly front-end.
Local host is easy to configure, you can configure ports, sockets and folder in
config.json
.
- Do not forget to specify the directory where you want the downloaded videos to be stored.
- Dependencies
MySQL
running on the port specified inconfig.json
.- Make sure to create a database with the same name you put in
config.json
. - Do not create the TABLE, as it is automatically created by the Downloader Server.
- Make sure to create a database with the same name you put in
yt-dlp
for the Downloader Server: You can install it withpip install yt-dlp
.ffmpeg
for the Downloader Server: You can install it with your package manager.nodejs
for the Front-End: You can install it with your package manager.
- Once you have those dependencies on your system, run
go run .
inside each of these directories in order: downloader-server/ -> message-queue/ -> web-server/backend/ and finally, inside the web-server/frotend/ folder install the dependencies with npm install and then run your server.
- Content Display: Shows a list of videos stored in the database with the following metadata:
- File name
- File path (MP4)
- Automatically generated thumbnail
- URL Submission: Users can submit video URLs through an input field on the interface.
- Download Management: Handles video download requests, saves the video files, and generates related metadata.
- Database Updates: After completing a download:
- Saves the video file to the dedicated folder.
- Generates and stores a thumbnail.
- Updates the database with file path and metadata.
- TCP/IP Communication: Maintains efficient communication with the Web Server and the Message Queue.
- Inter-Service Communication: Acts as an intermediary for asynchronous communication between the Web Server and the Downloader Server.
- Request Management: Ensures that multiple download requests are processed efficiently and sequentially.
- Metadata Storage: Stores relevant information about downloaded videos, including:
- File path (MP4)
- File name
- Thumbnail path
- Synchronization: Ensures the front-end remains up-to-date with the downloaded videos.
- Local Storage: All downloaded video files are saved in a designated directory accessible by the Downloader Server.
Below is an overview of the Local Cloud system architecture:
- Users access the Web Server through a browser and submit a video URL.
- The Backend of the Web Server sends the URL to the Message Queue over a TCP/IP connection.
- The Downloader Server listens for messages from the queue and processes the video request.
- Once downloaded, the Downloader Server generates a thumbnail, stores the video file in the Videos Folder, and updates the Database.
- The Web Server queries the database to fetch video metadata and displays the available videos on the front-end.
- Backend:
- Go (Golang) for the Web Server, Message Queue and Downloader Server.
- TCP/IP for inter-service communication.
- Frontend:
- React (Vite) and Tailwind for building the user interface.
- Database:
- MySQL (configurable).
- File Storage:
- Local file system for a simple folder.