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.
-
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.
-
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.
-
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.
-
Chat With Other Peers :
- Provide ability to send chat message over TCP socket.
-
Stream Shared Videos From Other Peers :
- Real time video streaming from other active peer on network.
- No need to download videos on local PC.
- Node Js
- React
- Dgram
- Net
- Inquirer
- Commander
- Crypto
- Socket.io
- Docker
- Mongodb
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.
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.
- Improve Web ui.
- Client app for mobile devices.
- Better error handling.
- Smooth user experience.
- Dockerizing.
- Ui for customizing settings.