Search code examples
javascriptnode.jsnode-webkit

Creating Desktop applications that run on web browser


In the last year I got to know that many developers started developing desktop applications that run on the web browser.

I am also trying to get into it and I'm trying to understand how I should start with such kind of development.

I first thought I should create a regular client-server application, i.e. with Apache Tomcat or with PHP, and for each launch of an application, to launch a new server on localhost and to open a browser that will load the application.

I've lately got to know that there are packages that do the server-client work for you, such as node-webkit.

I don't know where to start and I'm very confused...

When developers say that they develop desktop applications in Javascript or such that run on web browser - do they probably mean that the use node-webkit? Or does they do the complex structure I described above (JSP/PHP server on localhost) ?


Solution

  • Many development models with web technologies exist, but they have different purposes and it all depends on what you want to do.

    You seem to be mixing 3 models

    Classic websites

    A server (with PHP, Java or whatever) generates HTML.

    A user uses a browser to access it.

    When the user clicks somewhere, the server is called again and generates another HTML file.

    Single Page Applications

    This model is often used when writing websites that need a lot of interactivity. For example Gmail, or Google docs are SPAs (more or less).

    SPAs are websites (you can access them at an URL) where all templating is done client side, and the webserver only exposes a HTTP API.

    Most of the times, people use frameworks to make those like:

    • AngularJS
    • React
    • Backbone

    Desktop apps with web technologies

    That's just coding an application that you can install on a computer or phone with web technologies (javascript, css, html).

    There is no server.

    Tools that enable programmers to do this are

    • Node webkit (for desktops)
    • Cordova (for phones)
    • Many others

    Most of the time, programmers also use SPA tools in conjonction with those to help them during development