HACKER Q&A
📣 ibobev

How to create web, mobile, and desktop apps from a common code base?


I have an idea for a few apps that make sense to exist simultaneously as a web, mobile (Android and iOS), and desktop (Windows, Mac, and Linux) app. The research I have done so far is for utilizing JavaScript/TypeScript-based tech stack with React for the web, React Native for mobile, and Electron for desktop versions. Because I have yet not started learning those technologies I want to make sure that a common code base is achievable with them and also to consider some alternatives. For example, a commonly mentioned alternative of Electron is nw.js and I also found that React Native can be used not only for mobile but also for Desktop apps at least for Windows and MacOS.

What are your suggestions for a technological stack for the described cross-platform setting?


  👤 catapart Accepted Answer ✓
Highly recommend Tauri over Electron, if you are going to be using a web ui stack. Same kind of thing as Electron, just fresher so it's more streamlined (for now). It's Rust, but you can use extern libraries from most other languages, if you really need to.

https://tauri.app/


👤 atomicnature
I would recommend Capacitor JS for mobile, responsive CSS (or CSS utility libs such as PrimeCSS, PrimeFlex, or tailwind), and any JS state based library (React, Preact, etc).

Many people underestimate the power of webview based tech in mobile. For most usecases, webview based tech does just fine.


👤 wizzerking
Consider .Net Core it requires c# but all the desktops and android are supported. I don't know about iOS

👤 tzimo
You could look into Flutter. It pretty much fits what you are looking for.

I have tried it myself, but did not love it fwiw


👤 mg
Have you considered making it a website? Then it can be used on every device via the browser.

👤 max_
Flutter would be the best. No one comes close to Android, iOS & Desktop support better than Flutter.

Flutter also does support Web but has a few issues. But still I wou choose it.


👤 mrKola
Compose multiplatform, and you will have a lot of fun.

👤 JaggerJo
.NET with C# / F#

https://avaloniaui.net/


👤 hotgeart
React Native. Why would you want a desktop app when it's already working in a browser?

If you really want a desktop app, I would recommend using React for the web, React with Electron for desktop, and React with CapacitorJS for mobile.


👤 stealthcat
Kotlin multiplatform

👤 tomcam
Livecode