thewh1teagle / mobslide

Turn your smartphone into presentation remote controller
https://thewh1teagle.github.io/mobslide.web
MIT License
356 stars 18 forks source link

general questions #4

Closed davehorner closed 11 months ago

davehorner commented 11 months ago

Cool app.

I am able to get it to run locally using npm run dev -- --host 0.0.0.0 in web and cargo tauri dev in the desktop.

I am wondering how or what you have setup on https://thewh1teagle.github.io/mobslide/ which is where the released binary has the QR code pointed to? Did you host the web folder in github pages?

thewh1teagle commented 11 months ago

Thanks! There's two folders:

Desktop

Tauri based desktop app

Web

React app hosted on github pages

How it works

This is the best part. The communication is peer to peet using webrtc with peerjs library.

When the desktop app starts, it gets new peer ID, Then it shows a QR link points to to the web app and containing the ID.

When the react apl is opened in the phone, the ID extracted from the URL and the webapp connects to the PC with peerjs (webrtc)

This way it works even if the phone on the same network or another

As for the controlling, the desktop app emulate keyboard keystrokes

davehorner commented 11 months ago

Thanks for the response. I didn't realize you could host a react app like that.

I would like to host the web portion of web on my own github pages. How do you go about making a release with that url hardcoded and what process do you use to push to the website?

Is there a way to package the desktop app to run the web portion locally automatically packaged together with the desktop app?

thewh1teagle commented 11 months ago

You can get the desktop app to be with a local http server. I thought to do that in the first place, but for better UX I ended with using webrtc, so it will work even if your phone isn't on the same network, the downside: it won't work if you don't have internet connection

davehorner commented 11 months ago

I tried using gh-pages -d dist in web.
https://github.com/davidhorner/gh-pages/tree/gh-pages it didn't package everything so that doesn't look right.

i would be appreciative of any notes on how you maintain your gh-pages for this. I will keep playing.

thewh1teagle commented 11 months ago

https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site