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.
Read more about how Blaze works at a basic level in this Medium article.
Read more on Deploying on your own server
Blaze is sponsored by:
The project is structured into following directories - backend, frontend, common and nginx.
All the backend(or server) related source code resides under the
server directory. It is built on Node.js with express for HTTP server and ws library for WebSockets. Thin wrappers have been created for easier interfacing with sockets.
The frontend source code is in the
client directory. The dependencies of the frontend has been kept to a minimum to keep bundle sizes low. Once the frontend is built for production, all the built files are stored in
build directory which can be deployed as a static app.
/approute is a PWA, single-page app. Rest of the routes are pre-rendered during build time.
assets- used to store the static assets such as images.
components- contains all the UI components of Blaze.
hooks- custom Preact hooks
routes- components related to different routes of Blaze and router configuration.
App- subroutes of the single-page app under
Pages- rest of the routes that need to be pre-rendered.
scss- theme level scss. (Note: component specific scss goes within the corresponding component directory)
constants.js file and utility functions in
nginx directory contains configuration files for nginx to be used in Docker containers. These usually don't change much.
compose-nginx.conf- Used when the project is run using docker-compose.
image-nginx.template- Used when the project is run on a single container from higher level Docker image.
The build process for the frontend internally setup with webpack via preact-cli. Overrides can be made in
preact.config.js file. Following environment variables can be set in the build process:
||URL to the server that is running the Blaze WebSockets server.||'ws://<your-local-ip>:3030'|
||URL to the server that running the Blaze HTTP server.||'http://<your-local-ip>:3030'|
||Max file size limit when transferring files over WebSockets in bytes.||100000000 (100 MBs)|
||Max file size limit when transferring files over WebTorrent in bytes.||700000000 (700 MBs)|
||Array of string URLs to allow CORS.||*|
||Port for the server to run||3030|
||Max file size limit when transferring files over WebSockets in bytes||100000000 (100 MBs)|
Blaze can be easily deployed on your own server using Docker. The frontend and the backend is completely decoupled from each other. Following Docker images are available:
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
Documentation on contributing can be found in CONTRIBUTING.md
npm run build:fe
The frontend built code would be located in the
Blaze app can now be accessed at port
Blaze is MIT Licensed