Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Potentially silly question (I'll go out on a limb anyway).

I would like to create a multi-platform app for non-technical users where their data is transparently self-contained/self-hosted. So, they open a single binary and it presents them with a UI, and the data created from within the app would be stored in their local PocketBase database. However, I wouldn't want the user to have to start a server directly (they wouldn't know what a server is).

So, I think the binary would have to start both the PocketBase server and a front-end server, and then launch a browser (similar to Electron) pointed to their front-end server's port.

Does this sound like a good approach? What could you recommend to orchestrate this seamlessly to make for a simple user experience when launching the app?

Thank you.



Honestly I'd look at using Electron because you can take a hard dependency on the browser capabilities and state. If you rely on the user bringing their own browser you're going to have headaches of people on ancient browsers or just supremely jacked up browsers (messed up browser plugins, proxies, turned off javascript, etc.). Node can easily launch processes and there are even fancy process management libraries like pm2 you can add as a dependency should you need it, so the logic in your electron layer can be very simple and just launch some other processes and ferry requests to the view layer.

Alternatively a webview-based framework or something like Lorca might be another option if you don't want to use Electron: https://maori.geek.nz/golang-desktop-app-webview-vs-lorca-vs...


Thank you!


Hm, there is nothing preventing you to start multiple services from a single binary.

I'm not sure that PocketBase would be suitable for your use case, but it is distributed also as a Go package (see https://pocketbase.io/docs/use-as-framework/) and you could combine it with any other GUI Go package (fyne, go-astilectron, etc.)


Thank you!


Checkout wails.io and tauri.app


:cheers:




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: