4

I'm planning to write some native applciation with web application method. I've searched quite some pages and was planning to use node.js + angular + something... but now would like to try Meteor since I've already used MongoDb and I don't want to learn too many frameworks "frontend" or "backend". Simple and easy to learn is core to me.

Few questions: Is MeteorJS fit for desktop application? Or, Could MeteorJS app be packaged with node-webkit? Any example to follow?

I would also like to get suggestions if someone uses Python/C++ extension in backend for data manipulation or what ever. Is MeteorJS good for such application?

Thanks,

user2189731
  • 558
  • 8
  • 15
  • I haven't tried Meteor with note-webkit, but it's a tempting idea and it should work. As for working with Python / C++ / other native scripts, keep in mind that Meteor lies on top of Node, and you've got full access to Node methods and packages - so it's as easy to work with native apps as in plain Node. – Hubert OG Mar 11 '14 at 08:37
  • I second it. Meteor is running in node.js environment and should be relatively easy to wrap into node-webkit. MongoDB might be difficult though, unless you are willing to ship a mongodb binary and instantiate a local db in your desktop app. Or if you don't need much persistence. – imslavko Mar 11 '14 at 11:16

2 Answers2

5

Meteor and node-webkit make for an incredibly powerful combination, because they allow you to:

  • rapidly develop a desktop app with meteor/js/html/css goodness
  • dynamically update your app after shipping it to the user
  • fully use the node API on a user's machine

You could probably use these two technologies in a few ways including:

  1. a fairly static app which talks to a remote server via DDP
  2. a completely dynamic app which receives all of its code every time it starts (see below)
  3. a self-hosted meteor server on the user's machine (I have not tried this approach)

Here is an example package.json which demonstrates how to load your app completely dynamically (just like a web page) from myapp.example.com:

{
  "name": "myApp",
  "node-remote": "myapp.example.com",
  "main": "https://myapp.example.com/",
  "version": "0.0.1",
  "window": {
    "icon": "logo.png",
    "toolbar": false,
    "frame": true,
    "resizable": false,
    "position": "center",
    "width": 500,
    "height": 500
  }
}

There are a couple of things I'll caution you about:

  1. While the application code can be updated at any time, if you require node modules or other libraries, you will need to package those ahead of time along with the nw binary. For example, if you want your users to be able to view h264 video, you'll need to ship with the necessary libraries.

  2. If you load your application code from the internet, be aware of the potential dangers. If someone were to gain control of your DNS or your servers, all of your users could have a really bad day. The proper way to deal with this is to sign your application code before it can be loaded by node-webkit but that's beyond the scope of this answer.

David Weldon
  • 63,632
  • 11
  • 148
  • 146
  • Thanks, David for the details. I actually would update application with new package only so this is not a problem for me. What I want to do is to develop a app quickly with web tech since it's fancier than most of desktop tools. And I plan to start a meteor sever on user side and that's the major concern for me to select technology. Actually my plan was to use web frontend and python back end but there is no tool like node-webkit. Anyone happens to see this thread and have some solution, please drop a line. – user2189731 Mar 12 '14 at 06:25
1

GitHub (itself) makes Electron: http://electron.atom.io/, which like node-webkit allows you to make desktop applications with node.js and a Chromium-based browser.

I think that there's a bit more separation of the node.js and browser code in Electron than there is with node-webkit, which is probably a good thing.

Here's a Meteor package to help you integrate Meteor into an Electron-based app. https://atmospherejs.com/jrudio/electron

I haven't tried or tested this solution, but it should give you a good start.

Jay
  • 1,337
  • 1
  • 17
  • 21