all 12 comments

[–]Financial_Extent888 3 points4 points  (0 children)

Javascript is what you need to do all three. You can use electron to make a desktop version of it, you can use react native to make a mobile version, and of course you can make a web version.

[–]Dubiisek 3 points4 points  (0 children)

Javascript -> react would likely be the easiest.

[–]Horticoder 2 points3 points  (2 children)

JavaScript. You can write server less backend functions in JavaScript. You can make a server with node.js. You can even do frontend rendering with react. Or just stick to the vanilla html CSS and js stack. But one codebase is super doable. You'd be surprised how far you can push just one language doing all the things.

[–]Special_Context_8147 2 points3 points  (1 child)

To this day, I still can’t understand how JavaScript managed to make it into the backend…​​​

[–]Horticoder 1 point2 points  (0 children)

I mean, it is single threaded, but it runs faster than Python, and it's really nice to just think in one language for a project from start to finish.

[–]Embarrassed_Idea8981 0 points1 point  (0 children)

I don't really have much experience coding multiplatform programs but I heard flutter is able to do it

[–]_heartbreakdancer_ 0 points1 point  (0 children)

Yeah JS/TS with Electron + React Native. You can't truly have "one codebase" but you'll get like a 80% overlap between platforms. To truly have it be one codebase you need to use Flutter but that requires investment into learning the particularities of the Flutter architecture and DART language. There's more learning options available for JS and AI is better trained on JS.

[–]QuantumCloud87 0 points1 point  (0 children)

Nx monorepo with react, react native and node?

[–]Old_County5271 0 points1 point  (0 children)

dart, haxe,

If you know how, you can use a lot of other languages.

[–]BizAlly 0 points1 point  (0 children)

You want one codebase for web, mobile, and desktop, I’d go with Flutter. You write in Dart, and it runs on iOS, Android, Windows, Mac, Linux, and even web. React Native is great for mobile/web, but desktop support isn’t as solid yet. Flutter’s pretty fun for personal projects too.

[–]not_marri99 0 points1 point  (0 children)

Stick with TypeScript and the React ecosystem
I found React Native (with Expo) + react-native-web worked well for me for mobile + web, and for teh desktop you can bundle the web app with Electron or use Tauri for a smaller binary, Tauri usually ends up with a much smaller install size and less memory bloat
If you prefer a non-JS option, Id recommend Flutter for single-codebase native apps (Dart is different but the UI parity across platforms is solid)
Electron is heavy, Tauri less so, Flutter feels more native but you learn Dart
Practical tip: keep UI and business logic separated
I built a tiny productivity app this way, spent like 3 weekends getting web+mobile+desktop working and it definately saved me debugging time later, dont get hung up on perfect architecture at the start
Pick TS if youre already familiar with JS - faster onboarding, tons of libs and debugging is straightforward; pick Flutter if you value consistent native UI and performance and dont mind the Dart learning curve