Hacker News new | past | comments | ask | show | jobs | submit login

I use Flutter for my desktop UI and Rust for my backend. However, I chose to separate the two using gRPC instead of the bridge. This allows me to be agnostic of language on both sides and I suspect gives me a cleaner interface for mocking the backend from my frontend. It also makes it easy to place the UI and backend on different machines giving a true client/server architecture. The con is likely that the interface is probably more verbose, however.



Do you run a gRPC service on the desktop where the UI runs, and connect the 2 via localhost?


If you do this please don't use localhost, the socket domain for IPC is AF_UNIX not AF_INET. Even Windows supports it.


Then I would need two different mechanisms. Local and remote are both satisfied by TCP sockets, so this is easier.


It's not two different mechanisms, they are both sockets.


Not op but I’m developing an application with this exact approach as we speak, although my backend code is in Dart also.

You can also do gRPC over Unix domain sockets too if you’re sticking with desktop but overall I really like this approach as it makes it trivial for me to move from desktop app to web app with only some minor config changes.


How is the dart backend story? I've not heard much about people using dart on the server, are there mature frameworks out there?


I love it personally and with gRPC I don’t really have much of a need for any kind of backend framework at all. I just follow the guidance at aip.dev and raw dog it using language primitives for the most part.


As one option, yes, the other option is to run them on different machines. App isn't done yet but the idea is that you are presented an option to either connect locally (if localhost detected) or remotely via auth on UI startup.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: