Meteor clicktstart now available

Meteor is, if you have not heard of it:

“An ultra-simple, database-everywhere, data-on-the-wire, pure-Javascript web framework”.
It was announced some time back and has some impressive features. MongoDB is used at the back end. The experience is like writing a JS app, with some parts - transparently (if you like) running on the server, and embarrassingly quick to use.

If you want some convincing, take a look at the video they posted.

You can run out Meteor as a “clickstart” on CloudBees  - it sets up a continuous deployment of the sample “todo” app that ships with Meteor. You can have your own continuously deployed Todo app through the miracle of Science !

A private repo, a build (that runs integration tests in phantomJS), a MongoDB database and the sample App. You can clone this repo and make it your own - use it as a starting point, press the button:

The clickstart repo on github is here if you want to fork it.

Meteor is also known for its web-real-time features - update a collection in the UI, it updates in MongoDB, and vice versa, it is a simple programming model to get started with.

Take a look at the sample leaderboard app:

Note this is 1 file - it runs both server and client side (this is the default with Meteor - all code can run in both places - unless you put it in a client or server folder). Line 4 defines the collection - the database - this maps 1 to 1 with a MongoDB collection (called “players”). Finding and inserting data is easy, as you can see. Line 34 has a directive to check if the code is executing on the server - crazy huh !
Typically apps would not be built like this, with 1 file, but it is interesting to see what it can be distilled down to.

The web pages are done in a template style inside the HTML files themselves, like so. The app js binds to events on this page and collections are rendered (in page templates are typically used - eg see the “template” tag).

Developing is easy - install Meteor and just run “meteor” in the app you have just clickstarted - it will run it locally with a local offline MongoDB instance on your desktop. Push any changes you make and it is all running from there.

There is no officially sanctioned test framework built into Meteor yet for unit testing, so for this clickstart I used PhantomJS and Webspecter to provide some integration test coverage to ensure the app still works before deploying (as part of the build pipeline).

It will be interesting to watch Meteor to see how this stuff develops, it is a very very opinionated framework and one to watch.

Enjoy !

NOTE: there have been some issues with the installation of Meteor, intermittently (cloudfront, it seems, as meteor grabs its dependencies the first time it is run - if you see a failure - try again later - as I work through this).

Blog Categories: 

Add new comment