I recently started my first open-source project for a lightweight UI helper :) Basically, it is just a wrapper for Webview and Jester with some additional helper tools.
The goal was to create something that simplifies creation of offline (desktop) applications based on HTML/CSS/JS on MS-Windows, Linux, Mac and Android. It should be easy to run something in a binary machine language but use some HTML/JS user interface to display the result. Electron and CEF was too big and heavy for me. Webview was perfect, as it worked nearly out of the box on Windows. But unfortunately, it wasn't easy for development, as the integrated IE11 debug interface wasn't available and there wasn't any integrated auto-reload for JavaScript changes that previously really improved development when writing user interfaces with Svelte and Vue-Js.
So - I added a wrapper for Jester, so I could develop a "web application" in IE11/Chrome with auto-reload and just start it as a Webview Application in release mode. I used a single dispatcher that could register Nim/C callback functions in that could be triggered from JavaScript, no matter if Jester or Webview was used as front-end. I also included some wrappers for Python and C/C++ back-ends as these were my preferred languages before I discovered Nim.
The repo is at: https://github.com/marcomq/nimview
Thx for the response :)
This was made with security in mind. No socket will be opened in release mode, when showing the webview desktop window :)
The sockets will just be opened in debug/development mode.
Yes - I had a look to eel and neel. But both had the big disadvantage that they always required to open ports on localhost just to display the ui. This opens a big security attack vector and makes it complicate, if multiple of these applications try to run on the same machine. I'm also not sure if these csn easily run on mobile.
Don't get me wrong - I think that neel also has some advantages, for example: nim functions can be called much easier from js and js can be called easier from nim. But this also makes it hard to move the software from desktop to web, if you decide to do so.
as you would simply create a Jester REST API with the Neel functions. It's a little bit of work, but it's not that hard to implement async functionality in the JS for the API.
You are right - it is not hard to switch between desktop and web in neel. It just came into my mind after sending and reading the posting again. But it is probably even easier in Nimview as it works out of the box to switch between web and desktop.
Nimview has a detection on the client side to check if the JS runs on web and either sends an ajax request to jester or calls a webview callback. Both will just end at the same dispatch function in Nimview and will call your registered callback, so you can just move your application between desktop and web (and with some effort to android).
A bit off topic, just want to share an interesting way of creating Interactive UI without using JavaScript. Saw nice demo yesterday.
An image better than thousands words, try it https://mazes.angelika.me
Basically how it works, you write it like a Desktop UI. Without concepts of Browser, JS, Server, Network, Latency, Remote Function Calls, API, JSON etc. Huge simplification. And the framework magically makes it available on Web. It's kinda like Karax run on Server, without the need for Server, API etc., more about the approach.
Could be useful in building UI, Interactive Data Exploration Tools and Dashboards in a very easy way.
Creator of Neel here. Great project man! :)
I had originally set out to build the Nim version of Eel with the automatic type conversions to make front/backend communication (and GUI app development in general) as easy as possible.
My question for you is what is this big security attack vector with Neel? Is it just because it has to use an open port to serve the UI? I'm not really familiar with the security aspect to be quite honest. I'd love to get feedback and try to resolve this if at all possible. I do want to get this tiny library to the point of being able to make commercial applications, whatever that takes.
"With Nimview, you also don't need a webserver running that might take requests from any other user on localhost. This improves security and makes it possible to run multiple applications without having port conflicts." - https://github.com/marcomq/nimview, Difference to Eel and Neel, Second Bullet Point
I'm also trying to figure out what this big security attack vector is with Neel as well. There isn't another user on localhost, and if we're running a Neel application on localhost:5000, it's not broadcasted across the LAN, so what's the big deal?
@Dan
I just checked the upload again on VirusTotal and it doesn't show any issue for Avast https://www.virustotal.com/gui/file/ce6ecfad7d6f7d2610af89b868a69dae8de11a67bd8871d7d97bab9a08ddae9e/detection
I guess there is no general mitigation, as the general Avast database doesn't has any issue with the file. Usually, Anti-Virus Software doesn't like .exe files from internet. And they also don't like .exe files from zip that might access internet, as server_demo.exe does.
(I updated the demo.zip file 2 days ago. Maybe there was an issue with the old version, even if it didn't contain any virus either)
It is still in an early stage and I will probably add additional testing soon. Currently, it only checks if the samples can be compiled and if some of them can be started without crash. I will also probably move the android branch to the examples section soon.
You were right. I also needed to send some feedback from server to client. A function was running for a long time and I needed some feedback that the server is still alive and doing something. Using threads was too complicate, so I added a function that can call JS from backend.
Nimview is now on version 0.3.0 :)
You can now call "alert('Hello Frontend!')" with the function callFrontendJs("alert", "Hello Frontend").
@Dan So - I just created some basic youtube "hello world" tutorial. https://www.youtube.com/watch?v=OykIbez7Vfc
Again some warning - I'm not good in youtube - but I hope shows most of the basic stuff. Will maybe add some additional video later to show how to create a single-executable-binary that also contains the UI or show how to trigger javascript from backend. Would appreciate some feedback :)