quant-ux icon indicating copy to clipboard operation
quant-ux copied to clipboard

Binary Support

Open IsotoxalDev opened this issue 3 years ago • 15 comments

Why?

I am a user who prefers having a binary application instead as an app on the web running in the browser.

How?

As Quant-UX is written as a web app using JS, So by creating a electron or tauri binary would be not too hard...

Electron

In all honesty though, please don't use it! Even though VS Code, Discord etc used it, and the backend logic for electron just have to be written in JS or TS depending on your taste. Electron applications are usually hated by the community for them hogging their ram as it is essentially a separate chrome instance and their binaries are massive which is not something positive.

Tauri

Tauri is the new kid in town for creating cross-platform binaries for web applications. Has a small binary, faster than electron, memory safe & far less ram usage. Although the backend may have be written in rust, it would be a worthwhile investment.

IsotoxalDev avatar Sep 22 '22 16:09 IsotoxalDev

Hi,

Quant-UX is about testing with real users. This will not work when you have it running as an App :(

I was already thinking about doing this. However, his is quite some work, also a lot of the tool would not work. If you want to take this task over, I will gladly help you, but I think I will not have the bandwidth for this currently.

KR,

Klaus

KlausSchaefers avatar Sep 22 '22 20:09 KlausSchaefers

I would really like to implement this but i am a bit preoccupied at the moment once i have freed up some time i would love to tackle it!!

IsotoxalDev avatar Sep 23 '22 04:09 IsotoxalDev

Just tried adding in tauri and it took less than a minute to get the window up and running!! but need to figure out if there are any breaking changes... image

IsotoxalDev avatar Sep 23 '22 07:09 IsotoxalDev

Hi,

this look really cool. I think in the front-end there is not too much to change. I see the following main tasks in the UI:

  • [ ] Remove Login & Analytics: A lot of things don't make sense when it's a binary app. One should just remove them.
  • [ ] Develop Backend in RUST. All methods and interfaces are defined in the ModelService class. Everything related to events can be ignored.
  • [ ] Change ModelService to communicate with the RUST backend. Maybe REST to localhost or some kind of interprocess communication?
  • [ ] Refactor Image rendering. Currently Images are loaded over <img src=...> tags. I just pass the server URL where the image is stored. To make this work in Tauri, one needs ether to have a local web server running or somehow use data urls. In either case, this functionality should be refactored into a separate Service, e.g. ImageService.

I can take care of the image part in the next weeks, if you want to start working...

KlausSchaefers avatar Sep 23 '22 08:09 KlausSchaefers

Remove Login & Analytics: A lot of things don't make sense when it's a binary app. One should just remove them.

For login, maybe we could create a separate npm command that would ignore the login stuff and would start right on the "My Prototypes page"

Develop Backend in RUST. All methods and interfaces are defined in the ModelService class. Everything related to events can be ignored.

By Backend what i meant was stuff like file dialog. that is the only thing that i find not in a working state... But if you want, converting the backend for a more speed and memory safety, that can be done.

Refactor Image rendering. Currently Images are loaded over tags. I just pass the server URL where the image is stored. To make this work in Tauri, one needs ether to have a local web server running or somehow use data urls. In either case, this functionality should be refactored into a separate Service, e.g. ImageService.

With tauri you get some api.. see if it might help https://tauri.app/v1/api/js/

Just so if the earlier screenshot was misleading. It works fine just the part to import the file dialog doesn't popup image

IsotoxalDev avatar Sep 23 '22 10:09 IsotoxalDev

I am not sure how tour works, but I assume we would have to build the app, and it just gets server. This build should be in best case the same for web or local. There is a config mechanism that we could use to inject custom behavior, e.g. dropping the login page.

How to you get the login etc running without a backend?

KlausSchaefers avatar Sep 23 '22 13:09 KlausSchaefers

You need to read and write the files and images somewhere. I would expect the RUST part takes care of this. Also, I think a single file would be best per project, so you need to stream out the different parts. Currently also the saving is incremental, so just the delta are send to the server. For Tauri, one could send always the full JSON and save it.

KlausSchaefers avatar Sep 23 '22 13:09 KlausSchaefers

I am not sure how tour works, but I assume we would have to build the app, and it just gets server. This build should be in best case the same for web or local. There is a config mechanism that we could use to inject custom behavior, e.g. dropping the login page.

How to you get the login etc running without a backend?

image there is an option to set a command to do before building. that is where i've put in npm run build so dropping the login page can be done maybe by a custom npm command. about login without a backend i am also not sure as to why it works. it seamlessly saves the data too!!

IsotoxalDev avatar Sep 23 '22 13:09 IsotoxalDev

How to you get the login etc running without a backend?

So, I realized that i was trying it in the dev mode which just shows whats hosted on the port 8080. so it worked but after building a binary in release mode, it fails to run so i think it has to connect to the back end in tauri... If you were curios these are the errors i get

Asset `rest/login` not found; fallback to rest/login.html
Asset `rest/user` not found; fallback to rest/user.html
Asset `rest/user` not found; fallback to rest/user.html

IsotoxalDev avatar Sep 23 '22 15:09 IsotoxalDev

Hi,

the from end makes all rest requests to '/rest/*' You need a proxy which forwards the request to the real server. In dev mode a proxy is setup to quant-ux.com. In the taura case, there should be a local web service or some kind of message passing.

KlausSchaefers avatar Sep 24 '22 20:09 KlausSchaefers

Hi, any progress?

KlausSchaefers avatar Oct 04 '22 09:10 KlausSchaefers

Sorry have exams going on so i won't be free very soon

IsotoxalDev avatar Oct 09 '22 11:10 IsotoxalDev

Oh dear.. Some one mentioning Tauri brings a lot of joy. thank you @IsotoxalDev for this.

adithyaappu avatar Oct 13 '22 04:10 adithyaappu

Hi guys, would love to contribute to this project, when I initially saw the project I also thought of electron but then the backend made me think twice...

@IsotoxalDev well done on the current progress by the way!

If there's anything I can contribute send me a response or message.

HeXx123321 avatar Nov 06 '23 16:11 HeXx123321

Hi guys, would love to contribute to this project, when I initially saw the project I also thought of electron but then the backend made me think twice...

@IsotoxalDev well done on the current progress by the way!

If there's anything I can contribute send me a response or message.

I am unable to work on anything at the moment with my entrance exams for college on the brink... So you can carry on the progress if you want... I am not active due to prep work so all the best :D

IsotoxalDev avatar Nov 16 '23 05:11 IsotoxalDev