GithubHelp home page GithubHelp logo

blenderskool / blaze Goto Github PK

View Code? Open in Web Editor NEW
2.2K 30.0 270.0 3.33 MB

⚡ File sharing progressive web app built using WebTorrent and WebSockets

Home Page: https://blaze.now.sh/

License: MIT License

JavaScript 76.14% HTML 2.08% Dockerfile 1.36% SCSS 20.42%
frontend backend webrtc websockets file-transfer sharing node pwa-app hacktoberfest webtorrent

blaze's People

Contributors

abhishek-aa avatar blenderskool avatar cristicismas avatar dalfonzo avatar dependabot[bot] avatar gvirtu avatar hashkazi00 avatar imlonghao avatar medmly20208 avatar omnone avatar redlinus avatar rotonevan avatar ruoduan-hub avatar sergiumaja avatar skywalkerluc avatar sooster910 avatar sreejithns avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blaze's Issues

Project Branding

Logo, favicon, etc. should be created for proper branding of the project.

Add option to share link of room

Even though rooms are meant to be easy to remember, a share link can be added for extra convenience to invite other peers to join the same room.

This option can be added at the right side of the header (which currently shows a fake element to accommodate spacing)
Will make use of Web Share API and option would show up only on browsers that support this API

Update the UI when user gets auto-disconnected

This sounds a little weird, but when the browser decides to close the file-sharing connection (mostly WebRTC) in the background, the UI does not reflect the changes and still shows the user connected.
Further file transfers do not work until the user reconnects.

A new identity for Blaze ⚡

Blaze is built for sharing files across multiple peers in a blazing-fast way. While the current logo mainly featured a cloud with a lightning symbol, it did not capture the true identity of Blaze.

New logo proposal

The new logo tries to improve upon the current logo of Blaze by retaining the original colors and the lightning symbol.

  • The cloud is dropped completely as Blaze is primarily meant to be a peer-to-peer tool and keep very minimal dependency on central server. For the file sharing case, a cloud may have an incorrect perception as a cloud storage solution(which Blaze isn't)

  • The lightning symbol is now the primary part of the logo as it correctly captures the speed and ease of use Blaze tries to achieve. The design of the lightning symbol is updated to look similar to the zap emoji ⚡ which is mostly used for referencing Blaze in articles and posts.

  • Small dots have been added on the lightning symbol to indicate peers connected to each other. The lightning here can also be interpreted as a medium to connect peers with each other.

  • The text gets a new look from the Jost font family. This font change was recently made on the app.

Logo with the text

Logo as an app icon

Logo on installed PWA

Selecting and sending multiple files from Android doesn't work.

Issue sending multiple files between Android and Linux on Firefox. Operation ends up stalling.

Firefox on Linux shows an active WebSocket connection, whereas Android shows WebRTC.

On batch select and send from Android , the files seem to get overlapped, which result in no transmission.

Add settings page

A settings page can be used to allow to edit nicknames and other details of the client.

Remove logs in production

Server in production logs the users joining in the room. It is useful in debugging purposes and must be removed in production.

Migrate from Socket.io

Socket.io is currently handling both WebSocket and WebRTC connections. While it serves the purpose, it has a few downsides which are making me consider this decision:

  • WebSockets is natively supported in targeted browsers.
  • Socket.io P2P (which implements WebRTC connections) has a high bundle size. Also, some changes in the wrapper have been made to suit the project's needs, which tends to become infeasible in certain situations.
  • There's probably some smaller specific libraries that allow more flexibility than using a single large library like Socket.io

While this migration would take time, we do need to keep in mind that following parts of Socket.io are crucial to the functioning of the app:

  • File sharing rooms.
  • WebRTC connections where every peer is sender and receiver at the same time.
  • Support for sharing multiple types of data (i.e. ArrayBuffers and JSON data).
  • WebSockets as a fallback with an upgrade to WebRTC connection when possible.

Use Svelte special elements

Svelte has elements like <svelte:window> that make it simple to attach and automatically remove event listeners from the window object. Right now, this code is written in the onMount of some components.

Web share target

The new Web Share Target API would allow Blaze to accept file data from the native file system itself(currently on Android), thus improving the user experience of the PWA ⚡

The full implementation of this in Blaze is yet to be thought of, as joining a room adds a step to sharing files. One approach may be to make use of Anonymous rooms #46

Fix icon sizes

icon-192.png and icon-512.png are not 192x192 and 512x512 size images respectively.

Implement Desktop layout

As Blaze was developed with the mobile-first approach, the layouts aren't responsive and can be improved especially for desktop screens.

Change first time room join experience

When a user uses Blaze for the first time, the modal for joining a room opens up without giving any context on what a room is and how two different clients must connect in the same room.

Password locked rooms

Rooms that are created may support some type of password which can prevent strangers from joining a room.
Joining a room would require a password which was set by the host of the room.

Allow only unique people in a room

Blaze assumes people to have unique nicknames in a room to work correctly. Hence the backend should disallow people with same nickname accessing same room.

This will also solve the problem when the app is open in multiple windows/tabs, and the user tries to join the same room from both the instances.

Wrong file list shared to new user in the room

When some files have been transferred in a room, and then a new user joins followed by some other file transfer, the new user also gets the old list of files shared between other members in the room before.

Ideally, a new user should only be shown the files that are received by that person.

Show queued files

Indicate the files that are queued for transfer. For WebSocket transfer, multiple files are sent one by one. Hence at the start, only one file is shown in the files list for the sender. This may be confusing if the sender selected multiple files, and initially sees only a single file in the list.

Experiment with WebTorrent instead of native WebRTC

Current issues

While WebRTC is enabling peer to peer connections, Blaze requires a mechanism to implement multiple connections from one peer to the other peers in a room to enable many-to-many file sharing. The number of connections scales up quickly as multiple peers join the same room. This can lead to poorer performance and higher bandwidth consumption compared to the traditional server-based file sharing approach.

Possible solution

The idea of torrenting is something that closely aligns with what Blaze is trying to achieve. Files can be shared to all the peers in the room by sharing it with a few peers and those peers sharing it with other peers and so on, till all the peers have received the file. WebTorrent can make this possible as it also supports seeding on the browser. Combining this with the current WebSocket implementation(as a fallback for devices that don't support WebRTC and sharing metadata), WebTorrent is something worth experimenting for Blaze.

Prevent rooms with reserved symbols

While joining a new room, the room name must not contain characters such as #, ?, & ... which have a special meaning in a URL. When these characters are used, the app stops working as expected.

Hence the room name must be validated to prevent reserved symbols.

Overlapping Room name

In the File transfer screen, the Room name shown in the top bar overlaps with the Back button making it non-clickable.

Compress files before sending

Files with unsupported file formats can be compressed to standard .zip format before they are sent. This also has advantage of reducing file sizes in some situations.

WebSockets crashes server in some instances

curl 'https://blaze.unubo.app/' -H 'authority: blaze.unubo.app' -H 'pragma: no-cache' -H 'cache-control: no-cache' -H 'upgrade-insecure-requests: 1' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36' -H 'sec-fetch-user: ?1' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3' -H 'sec-fetch-site: cross-site' -H 'sec-fetch-mode: navigate' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-US,en;q=0.9' -H 'cookie: __cfduid=dd4671b66d49ae62acba3c9c6bd5a637b1574100693' --compressed

Anonymous rooms

Anonymous rooms would be rooms with random names (sequence of random characters). The current method of creating rooms may involve clashes. There may be someone else already present in a room which some other user wants to use.

To solve this, anonymous rooms would act as self-destruct rooms, where a user creates an anonymous room, shares the direct join link of the form /app/t/<random-room-name> with other users. The rest of the process of sharing files would remain the same.
These anonymous rooms won't show up in the recent rooms list of the user.

Improve README

I ran the README instructions but didn't know where the server or whatever was. And I'm not sure whether this is like a SHAREit competitor where I needn't install an app to use it and such, so maybe state reasons as to why this was made (e.g., just for fun or for actual use).

Show more metadata for transferred files

Transferred files can show more metadata:

  • If the file was sent or received
  • An icon associated with the file type
  • Who sent the file
  • Maybe when the file was transferred? (Eg. Sent 2 mins ago) 🤔

Overflowing files list on desktop

The files list in the transfer page overflows vertically when a large number of files are being shared. It should be made scrollable when it overflows.

Add service worker

Addition of service worker with proper setup will make Blaze a PWA. Blaze was mainly built for mobile devices hence PWA addition would further improve its usability and give more native experience.

Fix development process

The development server does not work correctly with the new directory structure. Only public folder is watched by Gulp. static folder should also be included.

Room on local network

Blaze right now allows public rooms for sharing files. But in some use cases, a room on local network would suffice for sharing files across devices in the same room.

On the Front-end:

  • Show a local room in the rooms list which also shows the live peers who have joined the local room.
  • The local room can be accessed in /app/t/ so that it does not conflict with other existing rooms.

On the Back-end:

  • Local rooms would be created similar to how existing rooms are created except that the room name would be the client's IP address.
  • To get live peers maybe having SSE (Server-side events) would be better than using WebSockets as data should only be sent from the server and there is no data to be sent from client.

Add Deploy buttons to README

💡 Deploy buttons can be added to the README to allow new users to quickly deploy Blaze to their server. Following buttons can be added:

  • Deploy to Heroku - as far as I know, Blaze can run on the free tier of Heroku.
  • Try in PWD - since Blaze is containerized using Docker, this would quickly setup Blaze on a playground server for testing purposes.

Open to discussing if there are other similar services.

Show the backend being used

Add an indicator in the app that will show whether WebSockets is being used or WebRTC for file transfer. It may not be useful for everyone but would help advanced users.

Update README

README needs to be updated to include changes in next branch

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.