adishegde / media_hub

Decentralized file sharing over LAN
https://adishegde.github.io/media_hub/
MIT License
25 stars 2 forks source link
file-sharing mediahub

Lan based file sharing application.

Home Window Search Results Audio Streaming Downloads

Introduction

A distributed file sharing application that works out of the box. Simply download the app and start sharing files over LAN. Features that set Media Hub apart:

Installation

Download the latest release for your operating system from the release. Once installed the app will notify all future updates.

To build from source:

Working

Media Hub basically has 2 parts: client and server.

The client is responsible for making search requests and downloading data. Search requests are UDP messages currently made through multicast but the core library supports both broadcast and multicast. Files and their meta data are requested via HTTP.

The server handles all incoming requests. It has a UDP service that handles the incoming search requests and a HTTP server that serves files and meta data.

The core library supports a lot of flexibility with respect to configuration however minimal support has been added to GUI as of v0.1.0.

Contributing

The entire code base is split into 3 parts: core, GUI and CLI.

Core

This is where media hub actually lives. It consists of 2 parts:

There is also a file indexer that keeps track of shared files and maintains related meta data. The related files can be found in src/core/daemon/fileIndex. The classes exported from fileIndex are dependent on each other i.e. FileIndex MetaData and SearchHandler are coupled and not completely independent.

Finally the entire daemon logic is abstracted away by the Server class exported from src/core/daemon/server.js. This makes it easy to use the daemon everywhere else.

GUI

This contains the code for electron. src/app/main.js is the entry point for electron's main process. src/app/render/index.js is the entry point for electron's renderer process and the React App.

The structure of the render directory is similar to a React-Redux web app.

src/app/utils/client.js exports the client logic by extending upon the Client provided by core. src/app/utils/fileDownloader.js implements a file downloader which is used by client to actually download files.