Announcing meteor-desktop

Depends on if different clients data are interacting with each other.

  • If you’re looking at the problem of multiple writers for the same documents and you have to worry about last writer wins scenarios, it could be problematic.
  • If you’re looking for basic app functionality that doesn’t need to remember database changes AFTER closing the app, for syncing at a later time - you can just write smart Stub code.
  • If you’re looking at an app with syncing capacities but want it to run smoothly when disconnected to the internet and sync whenever it can, remembering database changes through app closures and re-openings, then GroundDB 2.0 is your pick.

I would highly recommend SubsManager either way for caching your data as long as it isn’t overwhelming.

1 Like

This has always been something that I had in mind, but the only project I know is from kadira subManager and it seems abandonned.

What package are you using ? Thanks

Excellent! Thanks a lot!

Great! will test out both of them, I’ll probably need to consider limitations of MiniMongo when using a desktop client that subscribes / unsubscribes from collections depending on views.
I’ll test SubsManager, since I’m using Meteor + Angular 2, I’m not sure if MeteorObservable.subscribe() can make use of SubsManager.
Thanks for your insight!

Hey @omega,

Cool project! I read through the docs and didn’t really catch the answer to the noobish question I have.

I already have an Meteor web-app. What would be the the minimum steps and/or recommended steps to get it working as an native application with meteor-desktop?

1 Like

Hey @funkyeah,
you should not need to do much. Quick tutorial:

  1. add any mobile platform (you do not have to meet all the requirements for building mobile clients, if meteor add-platform ios fails just add a platform to .meteor/platforms). This integration works on top of the mobile integration so unfortunately you need to do that even if you do not intend to build mobile apps.
  2. follow steps from here https://github.com/wojtkowiak/meteor-desktop#quick-start

npm run desktop runs you desktop app. If you want to see it as executable you can package it with npm run desktop -- package <ddp_url> or just to see how things are easy you can also do a npm run desktop -- build-installer <ddp_url> and it will build a installer for the platform you are on. ddp_url is the address of your meteor server, if you wont provide it, http://127.0.0.1:3000 is assumed.

Last tip, when building your project with meteor build use --server-only so that mobile clients will not be built. That is of ocurse for the case when you do not want to have any mobile clients, just desktop.

hey @omega or anyone else who’s used this project, I’ve got a quick question

I’ve got basic IPC interactions working with the Desktop and Module classes, but it seems like desktop-specific code is required to live within .desktop/.

Is it possible to place desktop-specific code that uses the Module api in files outside .desktop, for example in /src/imports/foobar.js but then import it from within .desktop/? Or does the file have to actually existing within .desktop/?

Hi, does the update package work with this?

1 Like

Does it have React?
I mean this is so good but react is the way to go for many of us

1 Like

It just runs your Meteor client code inside an Electron renderer process, you’re free to use any UI framework you wish. I’ve been using Vue in it but React would work too

2 Likes

very cool but the thing with a project is if it’s already have ready to use components in react :wink:

I recently tried the package - I had a bit of difficulty mapping how Electron works to how this is configured, but it only took me a few hours to figure it out and otherwise, I found the package to be excellent. It would be really great if it were extended to run the Meteor server and database with-in itself.

I was able to get everything working the way I would like, but I am stuck with one thing: does anyone know how to disable pinch to zoom, and how to override the Command + R for refresh

2 Likes

mate without seeming like am imposing, you should totally make a blog post about doing this with a demo meteor react app. would be very much appreciated.

Does anyone have experience distributing on the Mac App Store with this package?

We’re working on that right now and it seems like it’s gonna work. Will post back results.

1 Like

Sweet, please keep us posted on how it’s going. I have been delayed several months now by this issue.

There is a new branch with a commit that might fix an issue around the build tool, however, I’m not sure if its complete or runnable.

@adammoisa hey man have you had any luck?

Hey @msavin, it took a while, a lot of luck, and more importantly, a lot of persistence from my relentless teammate @oleksiitrukhanov (who gets 100% of the credit and is the expert on the matter). Happy to say that Travis is successfully building a macOS app with meteor-desktop and uploading it to Appstoreconnect!


Our project goals were for Travis to perform the following actions on a push to master (*B&D = build and deploy):

  • iOS: B&D an iOS app to App Store (Appstoreconnect) :white_check_mark:
    • And automatically push the new build out to internal testflight users
  • Android: B&D an Android app to Google Play :white_check_mark:
    • And auto publish to alpha or beta testing channels
  • Windows: B&D a Windows Electron app (using meteor-desktop):
    • And deploy it to the Windows Store :hourglass_flowing_sand:
      • @oleksiitrukhanov is still going strong and I’m confident he’ll get this one too :slight_smile:!
    • As a .exe to an S3 bucket :white_check_mark:
      • We save the previous version to a versions folder and write the new .exe to the same location the old version was. This way, we never have to update download links (it always points to the same spot which always has the latest version)
  • Mac: B&D a macOS Electron app (using meteor-desktop):
    • And deploy it to the Mac App store (Appstoreconnect) :white_check_mark:
    • As a .app to an S3 bucket :white_check_mark:
      • Storage logic same as Windows app
  • Web: B&D the web app to 2 servers behind a load balancer :white_check_mark:
    • Without wasting build time of course, which was a challenge: when PM2 is configured to deploy to multiple servers, it builds & deploys for each server listed, which means you are waiting for a full build for each server! @oleksiitrukhanov successfully configured the process to build once and reuse the same bundle to deploy to multiple servers. The implications are fantastic - scaling and deploying to multiple servers is now only limited by the actual upload-bundle-to-server time, and not also limited by the build time
      • Fast: totalTime = buildTime + (servers.length * uploadTime), vs.
      • Slow: totalTime = servers.length * (buildTime + uploadTime)

We also have a separate ‘server-only’ meteor app that services many client requests (especially reqs to other external services, and another that runs lengthy cron jobs) to which a client (or method) connects over DDP (2 servers behind a LB), but this is a separate repo so it is a totally separate process. We reuse the build once -> deploy to multiple logic in Travis which makes deploying super efficient.

We’d like to eventually create an AMI on deploy and then spawn up instances from the AMI and add any spawned instances to the LB, which would then allow us to both decide on the # of servers at deploy and to scale up post-deploy in realtime, without first configing new servers then redeploying, etc. Ready for another challenge, @oleksiitrukhanov? :smiley:


One important feature we wanted is for each of these main processes to be created and run as separate jobs on Travis instead of one long process on a push to master. Concurrent jobs are great (although more than 1 concurrent build on Travis += $$$ [$69/mo for 1 concurrent, $129/mo for 2, $249/mo for 5]).

Nevertheless, even if you have to wait for each to run one after the other, it’s much easier to debug if (when) one fails (and it takes ~the same amount of time as one long thread would have in any case).


It was beyond a lot of work and persistence and again, I’d like to thank and praise @oleksiitrukhanov for not giving up for weeks and for getting this done. He’ll be publishing an in-depth post on Medium shortly, specifically describing the macOS process to which I’ll provide a link here when complete. It will cover all the provisioning/configs and external services used to successfully deploy the app to Appstoreconnect.

He’ll also be writing an in-depth article covering all of the above (iOS, Android, Windows (.exe and Store), Mac (.app and Store), and Web (multiple servers/load balancing)) for anyone who’s looking for similar functionality but want’s to keep (most of) their hair on their head :slight_smile:. Will post it here as well when complete.

We’d like to help anyone who’s struggling with this so if you or others have questions, don’t hesitate to post! Probably best to wait on the article for initial guidance, but nevertheless we’re here to help if we can.


Side note, we are also using the https://github.com/cult-of-coders/redis-oplog package which kicks butt, especially considering the extreme targeting available using channel: 'threads::' + threadId + '::messages' for publications. On our db of 6M+ docs that are constantly churning, performance is :ok_hand:. And we love the ability to publish updates to redis with total control or from external services via vent and the handy documentation on outside mutations. Big thanks to @diaconutheodor on the fantastic package!

5 Likes

Haha! Niceee! Maybe you could publish some performance specs? I would like to see how it performs on large-scale! The community and I built it exactly for needs like this!

Love the fact you put Vent to good use. Thanks for the appreciation!

2 Likes

We definitely will, as soon as we find time between building new features + fixing bugs :upside_down_face:. But in all seriousness, we will do some tests and post some specs and I’ll share the details in the redis-oplog thread. Needless to say, it’s made the difference between the app not working and being lightning fast. :clap::clap:

1 Like