Can electronjs be used for websites
Asked Answered
D

5

6

I'm offered to build a project, a web application, or basically a website. But the client prefers that I use electronjs to develop it.

But as far as I know (Correct me if I'm wrong), electronjs is for building cross-platform desktop applications ONLY which can run on any OS like Windows, Linus, Mac, etc but not on a browser via URL. Since it uses HTML, CS, JS, or basically the browser's language, it may have confused my client to think that it can be used also for building web applications.

So my questions are:

  • Can I use electronjs for building a web application?
  • If yes, is it wise to use? Or building it in reactjs is better?
Daze answered 12/8, 2020 at 7:32 Comment(2)
You can probably write code that can be reused across an electron app and a website. But yes, "building a website in electron" makes no sense. Electron basically bundles a browser to allow you to run your "website" as an app without the internet…Sodomite
"Building a website by electron" sounds like "Building a website by Chrome/Firefox/IE..." which makes no sense. It's a platform, you are building something running on it, not building by it.Waylonwayman
M
3

I would say no. Electron is used to build cross-platform desktop apps, and is not generally used to build websites. You could probably do it, but this is limited to very special circumstances, I would advise against it. You're probably better off using a framework meant to develop Single Web Apps, like React or Vue.

Maggiore answered 12/8, 2020 at 7:42 Comment(0)
R
3

You are right. Electron was developed for building standalone desktop applications. It bundles a node.js server with a chromium browser to give the feeling of an application but of course uses web technology.

That said you can of course do a lot of things electron can by using a node.js server. But a lot of things - especially clientside file manipulation, or playing around with windows is than limited.

On the other hand you can build an electron application that accesses an online Server to retreive data or display webpages.

Rosarosabel answered 12/8, 2020 at 7:41 Comment(0)
M
3

I would say no. Electron is used to build cross-platform desktop apps, and is not generally used to build websites. You could probably do it, but this is limited to very special circumstances, I would advise against it. You're probably better off using a framework meant to develop Single Web Apps, like React or Vue.

Maggiore answered 12/8, 2020 at 7:42 Comment(0)
S
2

Like @Torf said with electron it's possible to have a nodejs application run in it's own chrome browser window (which looks like it's own application). But it's just a "website" which is displayed. So you can code a simple site and use it as website, windows application etc. it looks the same on all platforms.

Sahib answered 12/8, 2020 at 7:45 Comment(0)
A
1

What the hell then code-server does? https://github.com/cdr/code-server

The fact that it is not yet generically implemented, does not mean "no". Code-server is literally example of electron app that can be run inside a docker container, but have it's gui - as it is - rendered in a webpage.

Yes, not yet generically done, but is exactly possible.

Alkaloid answered 22/11, 2020 at 8:50 Comment(0)
A
0

No, it doesn't make sense to develop a website in ElectronJS. ElectronJS compiles and builds to formats that are not web-browser compatible. Like exe, zip, dmg, deb, etc.

You can develop a website in languages/frameworks which are designed for this purpose.

enter image description here

Appropriate answered 30/10, 2022 at 5:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.