blenderskool / blaze

âš¡ File sharing progressive web app built using WebTorrent and WebSockets
https://blaze.now.sh/
MIT License
2.25k stars 276 forks source link
backend collaborate file-transfer frontend hacktoberfest node preact pwa-app sharing webrtc websockets webtorrent

Blaze - A P2P file sharing web app âš¡

Blaze - Fast peer to peer file sharing web app âš¡ | Product Hunt Embed Digital Ocean

Blaze is a file sharing progressive web app(PWA) that allows users to transfer files between multiple devices. It works similar to SHAREit or the Files app by Google but uses web technologies to eliminate the process of installing native apps for different devices and operating systems. It also supports instant file sharing with multiple devices at once which many file sharing apps lack.

Blaze primarily uses WebTorrent and WebSockets protocol (as a fallback) to transfer files between multiple devices. Files shared via WebTorrent are peer-to-peer(as they use WebRTC internally) which means there is direct transfer between the sender and receiver without any intermediate server. Do note that tracker servers in WebTorrent are used which carry metadata and facilitate the file transfer but do not get the complete file in any form.

Features

Try it out!

Read more about how Blaze works at a basic level in this Medium article.

Deploy your own instance of Blaze

Deploy to DO Deploy

Read more on Deploying on your own server

Sponsors

Blaze is sponsored by:

Build process

Environment variables

Following environment variables can be set in the build process: | variable | description | default | |----------------------|-----------------------------------------------------------------------|---------------------------------------------------| | **client** | Variables for **client** should be set as build args if using Docker. | | | `WS_HOST` | URL to the server that is running the Blaze WebSockets server. | 'ws://\:3030' | | `SERVER_HOST` | URL to the server that running the Blaze HTTP server. | 'http://\:3030' | | `WS_SIZE_LIMIT` | Max file size limit when transferring files over WebSockets in bytes. | 100000000 (100 MBs) | | `TORRENT_SIZE_LIMIT` | Max file size limit when transferring files over WebTorrent in bytes. | 700000000 (700 MBs) | | **server** | | | | `ORIGIN` | Array of string URLs to allow CORS. | * | | `PORT` | Port for the server to run. | 3030 | | `WS_SIZE_LIMIT` | Max file size limit when transferring files over WebSockets in bytes. | 100000000 (100 MBs) | | `DISABLE_SSE_EVENTS` | Disable server side events to reduce long-lived connections. | false | | `TRUST_PROXY` | Whether server is behind a trusted proxy and can read forwarded IPs. | _false_ when standalone, _true_ in docker-compose | ---------------------------------------------------------------------------------------------------------------------------------------------------- **NOTE:** Any URL in the environment variables should not end with `/`.

Running Blaze in production

Blaze can be easily deployed on your own server using Docker and docker-compose. The frontend and the backend is completely decoupled from each other.

Docker images

Following Docker images are available:

Using docker-compose

A docker-compose.yml file is present at the root of this project which runs both the server and client containers and sets up a proxy for WebSocket connections on the frontend in Nginx configuration. To run using docker-compose:

git clone https://github.com/blenderskool/blaze
cd blaze
docker-compose up -d

Directly via Node.js

Building the frontend

npm run build:fe

The frontend built code would be located in the client/build directory.

Starting the server and frontend app

npm start

Blaze app can now be accessed at port 8080 :tada:

Privacy and Analytics

Contributing

Documentation on contributing can be found in CONTRIBUTING.md

License

Blaze is MIT Licensed