arun-kushwaha04 / P2P

A decentrailized file tranfering application, for local area networks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

P2P : Share/Stream/Gossip Over LAN

Introduction

P2P helps you to share and stream resources over LAN, where each acts as a independent node. There is no dependency on a central server, each peer have their own local database which help them to act independant.

Video explanation

Watch the video

Features Implemented

  1. Triggring events when a peer leave/joins the network:

    • Uses nodejs dgram libaray to broadcast UDP packet when a peer joins/leaves the network.
    • Each peer maintains their own list of active user found in network.
  2. Sharing/Browsing resources over lan:

    • Share resources by just providing their path.
    • SHA-256 hash used to uniquely identify files/folders.
    • Look for resources shared by other active peer in the network.
  3. Download Resources:

    • Uses nodejs net library to transfer file chunk over TCP socket.
    • Pulls chunk from different peers to build file.
    • Allows folder download without compressing it.
    • Health of chunk chunk checked using checksum.
    • Automatically pauses the download when peers goes offline.
    • Ability to resume download from last chunk.
  4. Chat With Other Peers :

    • Provide ability to send chat message over TCP socket.
  5. Stream Shared Videos From Other Peers :

    • Real time video streaming from other active peer on network.
    • No need to download videos on local PC.

Frameworks/Libraries/Packages Used

- Node Js
- React
- Dgram
- Net
- Inquirer
- Commander
- Crypto
- Socket.io
- Docker
- Mongodb

Local Setup

Clone the repositorie, cd into it, and then follow the below mentioned steps for starting backend and web-client.

Starting node:

- Fork the repository.
- Clone the repository (git clone https://github.com/arun-kushwaha04/P2P.git).
- Open the folder in which you cloned the repository.
- Run mongodb as a docker container(important). You can use this command `docker run -d -p 12707:12707 mongo --name=mongod`
- Run *npm install*.
- Find your networks broadcast address using ifconfig(mac/linux) or ipconfig.    
- Now you can run 'npm start {provide_a_desired_username_here}'.    
- Enter broadcast address in the cli prompt and you are good to go.

Getting Broadcast Address Starting Command

Web-client:

- cd to `web-client` folder.
- Run *npm install*.
- Run *npm start* to run web-client.
- Open `http://localhost:3000/` to access web-client.

Screenshots

Starting your peer Search result over lan Downloads in progress Shared Resources Chat Screen

TO-DO

  • Improve Web ui.
  • Client app for mobile devices.
  • Better error handling.
  • Smooth user experience.
  • Dockerizing.
  • Ui for customizing settings.

About

A decentrailized file tranfering application, for local area networks


Languages

Language:TypeScript 41.7%Language:JavaScript 26.5%Language:C++ 13.4%Language:CMake 11.0%Language:Dart 2.3%Language:HTML 2.1%Language:CSS 1.1%Language:Swift 1.0%Language:C 0.8%Language:Kotlin 0.1%Language:Objective-C 0.0%