blenderskool / blaze

⚡ File sharing progressive web app built using WebTorrent and WebSockets

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to deploy frontend on vercel?

iamswarnadeep opened this issue · comments

Unable to deploy frontend on vercel. Please guide me. Thanks

@iamswarnadeep As a general advice, please include any error messages while you open an issue on projects. Without this, I've no idea about what you tried and what problems you faced while deploying on vercel.

I tried 2 ways to deploy on vercel.

1st...I run "npm run build:fe" with proper environment variable on my local machine, then, I directly deploy the "build" folder on vercel. But it not works, it's showing 404 not found.

2nd...I import the "blaze-3.0.0" repository from github on vercel and run with "npm run build:fe" with proper environment variable but it's also not works, "404 not found".

Actually I didn't find any documentation for vercel deployment and I'm noob in node.

Note: Backend is works on my VPS with Non-SSL(http) and response {"message":"Blaze WebSockets running","rooms":0,"peers":0}

It would be great if you could guide me. Thanks😊

B9C7456F-AA23-4C59-B2A5-C02D70D6DA7D

How to deploy frontend

Branch is main

Any problems please ask and ping me

You need to deploy front and back so all the features can work

@ShadowGaming100
image
Hey I'm having trouble deploying with Vercel.would you like to help me?
As shown in the picture, it doesn't have the symbol it should, but on the phone it does.
The browser is Google Chrome 115.0.5790.173 (official version) (64-bit), I can't solve it.
I set it according to the configuration in your picture.
In addition, although the mobile phone terminal can display it completely, when the two ends enter a room, there is no shadow of the other party.

@1746705990 Did you host an instance of the Blaze server? If you've correctly set it up, make sure you are setting the URL of the Blaze server as an environment variable of Blaze frontend correctly.

Refer "Environment Variables" under https://github.com/blenderskool/blaze#build-process

@ShadowGaming100
image
Hey I'm having trouble deploying with Vercel.would you like to help me?
As shown in the picture, it doesn't have the symbol it should, but on the phone it does.
The browser is Google Chrome 115.0.5790.173 (official version) (64-bit), I can't solve it.
I set it according to the configuration in your picture.
In addition, although the mobile phone terminal can display it completely, when the two ends enter a room, there is no shadow of the other party.

You need to deploy the backend of the blaze server
You can deploy using replit but vercel won’t accept to deploy the backend of blaze

To deploy is very simple
Do
npm install
npm run start:server

@ShadowGaming100
image
image

Hello, I have already done this step, can you tell me how to cooperate with Vercel next.
Please let me know the next steps, thank you very much.

Sorry for late response

Go to settings and go to environmental variables in project settings of your website in Vercel

Add the following variables
SERVER_HOST -http://blaze.1575986479.repl.co

WS_HOST - wss://blaze.1575986479.repl.co

TORRENT_SIZE_LIMIT - (You can change this to anything you want, format is bit)
100000000 (100 MBs)

WS_SIZE_ LIMIT - (You can change this to anything you want, format is bit)
700000000 (700 MBs)

After done adding it should look like this

Then go to deployments click the latest deployment
Click the 3 dots and click redeploy

Check for more environmental variables information

Client is for website

Server is for websocket

https://github.com/blenderskool/blaze#:~:text=exports%20to%20CommonJS.-,environment%20variables,-Following%20environment%20variables

About replit is never stays 24/7 online so it will have a problem

I can host for you

And about the starting command

create a file outside the blaze folder in replit called r.sh and type/copy as how it is shown below

cd blaze
cd server 
npm run start

then open the file manager again click the 3 dots and click show hidden files above

find for .replit file outside the blaze folder

remove everything and add the following thing

run = "bash r.sh"

What does the codes do above

the first code is for starting the replit

the second code is the code for starting the replit using a file

If it shows any error when you click run refresh the webpage or close and open again and check if it has been saved

屏幕截图 2023-09-03 031532

Thank you very much for your kind reply. I tried both ways.

First, I set up the server on Replit, in which case the page can be displayed completely.

But when transferring files on both ends, there was no response for a long time, even though the file was only a few kb.

I doubt it has anything to do with Replit, so I came up with a second attempt that is different from setting up the server on Replit.

Second, I set up that the server was on my own cloud server, and after correctly filling in the environment variables in Vercel, there was no screen that should appear on the page.

The link between my server and client is shown in the figure.

image

image

image

http://newblaze.daichenyang.me/

https://ablaze.daichenyang.me/

I hope you can help me if you can, thank you very much!
I think this is a nice project and if it can be replicated, it will play a big role in my learning.

I tested the website you showed in the message and works for me

I will try to transfer files over it via local network

Can I know which device are you using

Because old devices like iPad mini 2 and Samsung j1 will not work

Can it be used? ! But it doesn't seem to display the page completely. I am using a Windows system computer.

Can it be used? ! But it doesn't seem to display the page completely. I am using a Windows system computer.

It should work for me in my phone is working

windows 7 also works

May be something in your computer is block it

Can you create a room and we can test file transfer?

Join the test room called Test

Check your firewall if is enabled it may block it or your security scanner

I don't see you and can't even share the QR code

Can you create a room and we can test file transfer?

Join my room 'Test' on Blaze to share files

I don't see you and can't even share the QR code

Do you have any other device to test it???

Or check your router if you have any dns server set that may block it

I'm testing on my mobile phone, can you open the shared QR code?

Or check your router if you have any dns server set that may block it

I'm testing on my mobile phone, can you open the shared QR code?

Yes I can open it

I can’t see you

I can't see you either

I am sending you my blaze hosted link let’s check if it has the same problem

OK, I'm waiting.

OK, I'm waiting.

Sent

Room name Hello

I saw you

But the file couldn't come through.

Can you see the file being transferred

I now my wifi speed is slow

Yes, this is the case when I deploy with replit, but I can't transfer files.

Can you send the invite link of the replit project

Yes, this is the case when I deploy with replit, but I can't transfer files.

I am even using replit

@ShadowGaming100 @1746705990 is it possible for y'all to move the discussion to a separate chatroom? Flooding messages here notifies everyone constantly. Would prefer if you could share a summary of what the issue was and how you resolved it at the end!

I will create a new Vercel project and test it with your replit websocket

But replit has a 10GB network transfer per limit

@ShadowGaming100 @1746705990 is it possible for y'all to move the discussion to a separate chatroom? Flooding messages here notifies everyone constantly. Would prefer if you could share a summary of what the issue was and how you resolved it at the end!

Ok sure

Do you have Whatsapp? Let's change places.

I don’t like sharing number
I will create an issue on my github repo let’s talk there

Issue solved problem was with cache

To clear cache in Vercel following the following steps

go to settings
Scroll down until you see data cache
Click on data cache then click purge cache

then go back to deployment, it can be found above when you scroll

You should see something like this
AEC454CA-7E81-4815-A725-A1D8D75881BD

Click the 3 dots of the first one like this you see

It should appear like this

E54BCF5C-B334-4358-827E-D9CEE814AC11

click redeploy and wait until in finishes

@iamswarnadeep is your issue solved

Thanks for the resolution @ShadowGaming100!

Thanks for the resolution @ShadowGaming100!

Welcome

Closing as there's no activity