About Choosing Electron/ASP.NET/Angular over .NET UI frameworks
Like many of my fellow developers, I've kicked off countless personal projects only to leave them unfinished.
The primary reason is that my motivation and initial excitement for a new project often wane when I encounter persistent issues—whether technical or non-technical—or when I feel that I am not progressing as quickly as I would like.
When I started this project a couple of years ago, Avalonia was the first framework I considered. However, back then its docs was quite short and challenging and I didn't have a significant XAML background to grasp it quickly.
After struggling for a few days with little progress, I decide to go the Electron way before I lose the last bit of motivation I had. In parallel, I found a dev-mate who excelled in front-end development, which was a huge benefit.
Of course, we looked into MAUI, but at that time the MAUI was still on preview and the online feedback was already quite scary.
So, we end up with an ASP.NET app with an Angular/Electron front-end. Sound a bit unconventional ? Electron front-end is pretty standard in many popular stacks, and, despite .NET having many UI frameworks, there's no reason it can't work with .NET. As for Angular, it has always been a low-key friend framework of the .NET stack, and I had already built several projects with this stack without feeling like I made a terrible life choice.
The overall setup is designed such that all business features are managed by the .NET backend, using the open-source Fluxzy Core library. The Electron front-end is primarily responsible for rendering and distribution functions only.
However, this comes with downsides. The most significant issue is the Electron aversion, which is, to some extent, justified. In fact, during the COVID years, many internet corp spawned some bulky electron apps to fill quickly the market related to remote working, that even non-developers can recognize and hate. Using electron is already nowadays gatekeeping your app to a certain audience.
From a more practical perspective, the app is large (~150MB), the overall memory consumption is not moderate and JIT warmup times (combined with .NET) are particularly slow on Windows. Though the performance is very acceptable on Linux and macOS and can be partially mitigated by using nativeAOT with .NET, which we didn't test extensively yet.
As for using a web stack for desktop app, I personally don't find any issue unless your app requires advanced graphic performance, which we don't.
Still, everything is not that bad in Electron-land. There are a few things worth mentioning that made us gain a lot of time.
End to end tests are invaluable but it's a challenging task for desktop applications, especially across multiple platforms. This is of course largely very simple with Electron because at the endd of day you can take advantage of selenium based tool to do the job.
Publish targets: Out-of-the-box, there's already many platforms distributable that are available for electron app. Most notably linux build (flatpak, snap, rpm build...) which are neglect by many other frameworks.
Distribution : Code signing and notarization with macOS are things that we were very afraid of. With Electron it was easy and well-documented. Special note also for Squirrel which ease the update on supported platforms.
Community Support: Electron has just the largest community among all the desktop frameworks and it's easy to find a solution to any problem you might encounter.
Final words
If I had just to push a button to switch instantly everything into Avalonia. I'll do it without any hesitation. Even if that means, sacrificing my devmate (ugh:) and the benefits of having an easy integration with a future web app we're looking forward to.
However, for now, we are focused on feedbacks provided by the current user base and features that brings more usability to the overall tool.
Migrating to a specialized desktop framework is firmly set on our roadmap, and we won’t miss the chance to boast about it as soon as it’s completed, and Avalonia is the first on the list.
This is just my personal experience without any intention to convince you to use a particular framework. You can always have your own opinion by giving it a try.
Cheers!
haga-rak.bsky.social